Chromium Code Reviews| Index: athena/content/app_activity_unittest.cc |
| diff --git a/athena/content/app_activity_unittest.cc b/athena/content/app_activity_unittest.cc |
| index 8afc2fc487616f7d3e16e162337858091518bea4..7b48f2d91d3040795100597f0e9b29fc43dc18ad 100644 |
| --- a/athena/content/app_activity_unittest.cc |
| +++ b/athena/content/app_activity_unittest.cc |
| @@ -77,7 +77,9 @@ class TestAppActivity : public AppActivity { |
| virtual bool UsesFrame() const OVERRIDE { return true; } |
| virtual views::View* GetContentsView() OVERRIDE { return view_; } |
| virtual views::Widget* CreateWidget() OVERRIDE { return NULL; } |
| - virtual void CreateOverviewModeImage() OVERRIDE {} |
| + virtual gfx::ImageSkia GetOverviewModeImage() OVERRIDE { |
| + return gfx::ImageSkia(); |
| + } |
| private: |
| // If known the registry which holds all activities for the associated app. |
| @@ -278,12 +280,14 @@ TEST_F(AppActivityTest, TestUnloadFollowedByClose) { |
| // Calling Unload now should not do anything since at least one activity in |
| // the registry is still visible. |
| app_activity_registry->Unload(); |
| + RunAllPendingInMessageLoop(); |
| EXPECT_EQ(0, test_extensions_delegate()->unload_called()); |
| // After setting our activity to unloaded however the application should get |
| // unloaded as requested. |
| app_activity->SetCurrentState(Activity::ACTIVITY_UNLOADED); |
| app_activity_registry->Unload(); |
| + RunAllPendingInMessageLoop(); |
| EXPECT_EQ(1, test_extensions_delegate()->unload_called()); |
| // Check that our created application is gone, and instead a proxy got |
| @@ -325,6 +329,7 @@ TEST_F(AppActivityTest, TestUnloadProxyLocation) { |
| app_activity2a->SetCurrentState(Activity::ACTIVITY_UNLOADED); |
| app_activity2b->SetCurrentState(Activity::ACTIVITY_UNLOADED); |
| app_activity2a->app_activity_registry()->Unload(); |
| + RunAllPendingInMessageLoop(); |
| EXPECT_EQ(0, app_activity_registry->NumberOfActivities()); |
| Activity* activity_proxy = app_activity_registry->unloaded_activity_proxy(); |
| RunAllPendingInMessageLoop(); |
| @@ -362,12 +367,15 @@ TEST_F(AppActivityTest, TestMultipleActivityUnloadLock) { |
| // After setting all activities to UNLOADED the application should unload. |
| app_activity1->SetCurrentState(Activity::ACTIVITY_UNLOADED); |
| app_activity1->app_activity_registry()->Unload(); |
|
sadrul
2014/09/12 16:30:14
Looks like AppActivity::SetCurrentState() takes ca
Mr4D (OOO till 08-26)
2014/09/12 20:11:26
Done.
|
| + RunAllPendingInMessageLoop(); |
| EXPECT_EQ(0, test_extensions_delegate()->unload_called()); |
| app_activity2->SetCurrentState(Activity::ACTIVITY_UNLOADED); |
| app_activity2->app_activity_registry()->Unload(); |
| + RunAllPendingInMessageLoop(); |
| EXPECT_EQ(0, test_extensions_delegate()->unload_called()); |
| app_activity3->SetCurrentState(Activity::ACTIVITY_UNLOADED); |
| app_activity3->app_activity_registry()->Unload(); |
| + RunAllPendingInMessageLoop(); |
| EXPECT_EQ(1, test_extensions_delegate()->unload_called()); |
| // Now there should only be the proxy activity left. |
| @@ -406,6 +414,7 @@ TEST_F(AppActivityTest, TestUnloadWithReload) { |
| // Unload the activity. |
| app_activity->SetCurrentState(Activity::ACTIVITY_UNLOADED); |
| app_activity_registry->Unload(); |
| + RunAllPendingInMessageLoop(); |
| EXPECT_EQ(1, test_extensions_delegate()->unload_called()); |
| // Try to activate the activity again. This will force the application to |