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

Unified Diff: chrome/browser/apps/ephemeral_app_browsertest.cc

Issue 345493002: Promotion of ephemeral apps now handles permission escalation correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/ephemeral_app_browsertest.cc
diff --git a/chrome/browser/apps/ephemeral_app_browsertest.cc b/chrome/browser/apps/ephemeral_app_browsertest.cc
index 732dd436e187e1454dc04a4c4f167ee85585be0f..d022aa16ac3817126d9242904d452e4494e40161 100644
--- a/chrome/browser/apps/ephemeral_app_browsertest.cc
+++ b/chrome/browser/apps/ephemeral_app_browsertest.cc
@@ -554,7 +554,10 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, PromoteEphemeralAppAndEnable) {
const Extension* app = InstallEphemeralApp(kNotificationsTestApp);
ASSERT_TRUE(app);
- // Disable the ephemeral app.
+ // Disable the ephemeral app due to a permissions increase. This also involves
+ // setting the DidExtensionEscalatePermissions flag.
+ ExtensionPrefs* prefs = ExtensionPrefs::Get(profile());
+ prefs->SetDidExtensionEscalatePermissions(app, true);
ExtensionService* service =
ExtensionSystem::Get(profile())->extension_service();
service->DisableExtension(app->id(), Extension::DISABLE_PERMISSIONS_INCREASE);
@@ -564,6 +567,7 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, PromoteEphemeralAppAndEnable) {
// Promote to a regular installed app. It should be enabled.
PromoteEphemeralApp(app);
VerifyPromotedApp(app->id(), ExtensionRegistry::ENABLED);
+ EXPECT_FALSE(prefs->DidExtensionEscalatePermissions(app->id()));
scoped_ptr<AppSyncData> sync_change = GetFirstSyncChangeForApp(app->id());
VerifySyncChange(sync_change.get(), true);
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698