| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 expected_set == ExtensionRegistry::ENABLED); | 476 expected_set == ExtensionRegistry::ENABLED); |
| 477 } | 477 } |
| 478 | 478 |
| 479 void PromoteEphemeralAppFromSyncAndVerify( | 479 void PromoteEphemeralAppFromSyncAndVerify( |
| 480 const Extension* app, | 480 const Extension* app, |
| 481 bool enable_from_sync, | 481 bool enable_from_sync, |
| 482 ExtensionRegistry::IncludeFlag expected_set) { | 482 ExtensionRegistry::IncludeFlag expected_set) { |
| 483 ASSERT_TRUE(app); | 483 ASSERT_TRUE(app); |
| 484 | 484 |
| 485 // Simulate an install from sync. | 485 // Simulate an install from sync. |
| 486 int disable_reasons = enable_from_sync ? 0 : Extension::DISABLE_USER_ACTION; |
| 486 const syncer::StringOrdinal kAppLaunchOrdinal("x"); | 487 const syncer::StringOrdinal kAppLaunchOrdinal("x"); |
| 487 const syncer::StringOrdinal kPageOrdinal("y"); | 488 const syncer::StringOrdinal kPageOrdinal("y"); |
| 488 AppSyncData app_sync_data(*app, | 489 AppSyncData app_sync_data(*app, |
| 489 enable_from_sync, | 490 enable_from_sync, |
| 491 disable_reasons, |
| 490 false /* incognito enabled */, | 492 false /* incognito enabled */, |
| 491 false /* remote install */, | 493 false /* remote install */, |
| 492 extensions::ExtensionSyncData::BOOLEAN_UNSET, | 494 extensions::ExtensionSyncData::BOOLEAN_UNSET, |
| 493 kAppLaunchOrdinal, | 495 kAppLaunchOrdinal, |
| 494 kPageOrdinal, | 496 kPageOrdinal, |
| 495 extensions::LAUNCH_TYPE_REGULAR); | 497 extensions::LAUNCH_TYPE_REGULAR); |
| 496 | 498 |
| 497 std::string app_id = app->id(); | 499 std::string app_id = app->id(); |
| 498 app = NULL; | 500 app = NULL; |
| 499 | 501 |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); | 1031 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); |
| 1030 | 1032 |
| 1031 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); | 1033 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); |
| 1032 ASSERT_TRUE(app); | 1034 ASSERT_TRUE(app); |
| 1033 EXPECT_EQ(1, power_settings.keep_awake_count()); | 1035 EXPECT_EQ(1, power_settings.keep_awake_count()); |
| 1034 | 1036 |
| 1035 CloseAppWaitForUnload(app->id()); | 1037 CloseAppWaitForUnload(app->id()); |
| 1036 | 1038 |
| 1037 EXPECT_EQ(0, power_settings.keep_awake_count()); | 1039 EXPECT_EQ(0, power_settings.keep_awake_count()); |
| 1038 } | 1040 } |
| OLD | NEW |