| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/apps/ephemeral_app_browsertest.h" | 5 #include "chrome/browser/apps/ephemeral_app_browsertest.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "apps/app_restore_service.h" | 9 #include "apps/app_restore_service.h" |
| 10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 ExtensionSystem::Get(profile())->extension_service()->DisableExtension( | 303 ExtensionSystem::Get(profile())->extension_service()->DisableExtension( |
| 304 app->id(), disable_reason); | 304 app->id(), disable_reason); |
| 305 | 305 |
| 306 ASSERT_TRUE(ExtensionRegistry::Get(profile())->disabled_extensions().Contains( | 306 ASSERT_TRUE(ExtensionRegistry::Get(profile())->disabled_extensions().Contains( |
| 307 app->id())); | 307 app->id())); |
| 308 } | 308 } |
| 309 | 309 |
| 310 void EphemeralAppTestBase::CloseApp(const std::string& app_id) { | 310 void EphemeralAppTestBase::CloseApp(const std::string& app_id) { |
| 311 EXPECT_EQ(1U, GetAppWindowCountForApp(app_id)); | 311 EXPECT_EQ(1U, GetAppWindowCountForApp(app_id)); |
| 312 apps::AppWindow* app_window = GetFirstAppWindowForApp(app_id); | 312 extensions::AppWindow* app_window = GetFirstAppWindowForApp(app_id); |
| 313 ASSERT_TRUE(app_window); | 313 ASSERT_TRUE(app_window); |
| 314 CloseAppWindow(app_window); | 314 CloseAppWindow(app_window); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void EphemeralAppTestBase::CloseAppWaitForUnload(const std::string& app_id) { | 317 void EphemeralAppTestBase::CloseAppWaitForUnload(const std::string& app_id) { |
| 318 // Ephemeral apps are unloaded from extension system after they stop running. | 318 // Ephemeral apps are unloaded from extension system after they stop running. |
| 319 content::WindowedNotificationObserver unloaded_signal( | 319 content::WindowedNotificationObserver unloaded_signal( |
| 320 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 320 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
| 321 content::Source<Profile>(profile())); | 321 content::Source<Profile>(profile())); |
| 322 CloseApp(app_id); | 322 CloseApp(app_id); |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); | 1033 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); |
| 1034 | 1034 |
| 1035 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); | 1035 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); |
| 1036 ASSERT_TRUE(app); | 1036 ASSERT_TRUE(app); |
| 1037 EXPECT_EQ(1, power_settings.keep_awake_count()); | 1037 EXPECT_EQ(1, power_settings.keep_awake_count()); |
| 1038 | 1038 |
| 1039 CloseAppWaitForUnload(app->id()); | 1039 CloseAppWaitForUnload(app->id()); |
| 1040 | 1040 |
| 1041 EXPECT_EQ(0, power_settings.keep_awake_count()); | 1041 EXPECT_EQ(0, power_settings.keep_awake_count()); |
| 1042 } | 1042 } |
| OLD | NEW |