Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/apps/ephemeral_app_browsertest.cc

Issue 1136543003: Extensions: Store disable reasons in Sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/app_sync_data.h » ('j') | chrome/browser/extensions/extension_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698