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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 test_dir, crx_path, pem_path, base::FilePath()); | 266 test_dir, crx_path, pem_path, base::FilePath()); |
267 EXPECT_FALSE(app_v2_path.empty()); | 267 EXPECT_FALSE(app_v2_path.empty()); |
268 | 268 |
269 // Update the ephemeral app and wait for the update to finish. | 269 // Update the ephemeral app and wait for the update to finish. |
270 extensions::CrxInstaller* crx_installer = NULL; | 270 extensions::CrxInstaller* crx_installer = NULL; |
271 content::WindowedNotificationObserver windowed_observer( | 271 content::WindowedNotificationObserver windowed_observer( |
272 extensions::NOTIFICATION_CRX_INSTALLER_DONE, | 272 extensions::NOTIFICATION_CRX_INSTALLER_DONE, |
273 content::Source<extensions::CrxInstaller>(crx_installer)); | 273 content::Source<extensions::CrxInstaller>(crx_installer)); |
274 ExtensionService* service = | 274 ExtensionService* service = |
275 ExtensionSystem::Get(profile())->extension_service(); | 275 ExtensionSystem::Get(profile())->extension_service(); |
276 EXPECT_TRUE(service->UpdateExtension(app_id, app_v2_path, true, | 276 EXPECT_TRUE(service->UpdateExtension( |
277 &crx_installer)); | 277 extensions::CRXFileInfo(app_id, app_v2_path), true, &crx_installer)); |
278 windowed_observer.Wait(); | 278 windowed_observer.Wait(); |
279 | 279 |
280 return ExtensionRegistry::Get(profile()) | 280 return ExtensionRegistry::Get(profile()) |
281 ->GetExtensionById(app_id, ExtensionRegistry::EVERYTHING); | 281 ->GetExtensionById(app_id, ExtensionRegistry::EVERYTHING); |
282 } | 282 } |
283 | 283 |
284 void EphemeralAppTestBase::PromoteEphemeralApp( | 284 void EphemeralAppTestBase::PromoteEphemeralApp( |
285 const extensions::Extension* app) { | 285 const extensions::Extension* app) { |
286 ExtensionService* extension_service = | 286 ExtensionService* extension_service = |
287 ExtensionSystem::Get(profile())->extension_service(); | 287 ExtensionSystem::Get(profile())->extension_service(); |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); | 1032 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); |
1033 | 1033 |
1034 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); | 1034 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); |
1035 ASSERT_TRUE(app); | 1035 ASSERT_TRUE(app); |
1036 EXPECT_EQ(1, power_settings.keep_awake_count()); | 1036 EXPECT_EQ(1, power_settings.keep_awake_count()); |
1037 | 1037 |
1038 CloseAppWaitForUnload(app->id()); | 1038 CloseAppWaitForUnload(app->id()); |
1039 | 1039 |
1040 EXPECT_EQ(0, power_settings.keep_awake_count()); | 1040 EXPECT_EQ(0, power_settings.keep_awake_count()); |
1041 } | 1041 } |
OLD | NEW |