~mir-team/unity-mir/mir-0.2.0-compatibility-changes

« back to all changes in this revision

Viewing changes to tests/application_manager_test.cpp

  • Committer: CI bot
  • Author(s): Gerry Boland
  • Date: 2014-04-01 22:49:46 UTC
  • mfrom: (204.1.3 phone-surface-bad-position)
  • Revision ID: ps-jenkins@lists.canonical.com-20140401224946-jnfhtz43g4m493qx
Fix bug where sidestage app launched by upstart on the phone would not have stage overridden to be main stage, and thus positioned incorrectly. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
300
300
    EXPECT_EQ(second_session, the_app->session());
301
301
}
302
302
 
 
303
TEST_F(ApplicationManagerTests,upstart_launching_sidestage_app_on_phone_forced_into_mainstage)
 
304
{
 
305
    using namespace ::testing;
 
306
    QString appId("sideStage");
 
307
 
 
308
    auto mockDesktopFileReader = new NiceMock<MockDesktopFileReader>(appId);
 
309
    ON_CALL(*mockDesktopFileReader, loaded()).WillByDefault(Return(true));
 
310
    ON_CALL(*mockDesktopFileReader, stageHint()).WillByDefault(Return("SideStage"));
 
311
 
 
312
    ON_CALL(desktopFileReaderFactory, createInstanceForAppId(appId)).WillByDefault(Return(mockDesktopFileReader));
 
313
 
 
314
    // mock upstart launching an app which reports itself as sidestage, but we're on phone
 
315
    applicationManager.onProcessStartReportReceived(appId, false);
 
316
 
 
317
    // ensure the app stage is overridden to be main stage
 
318
    Application* theApp = applicationManager.findApplication(appId);
 
319
    ASSERT_NE(theApp, nullptr);
 
320
    EXPECT_EQ(Application::MainStage, theApp->stage());
 
321
}
 
322
 
303
323
TEST_F(ApplicationManagerTests,two_session_on_one_application_after_starting)
304
324
{
305
325
    using namespace ::testing;