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

Unified Diff: chrome/browser/extensions/active_script_controller_unittest.cc

Issue 475333006: Don't clear the activeTab permission for same-origin navigations when the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
Index: chrome/browser/extensions/active_script_controller_unittest.cc
diff --git a/chrome/browser/extensions/active_script_controller_unittest.cc b/chrome/browser/extensions/active_script_controller_unittest.cc
index 01fe26ba0cf72bcc319482f4dd6684c120a1d75c..b206887ab78558e5bd099b65ff4cfbf840a9a2a1 100644
--- a/chrome/browser/extensions/active_script_controller_unittest.cc
+++ b/chrome/browser/extensions/active_script_controller_unittest.cc
@@ -282,7 +282,18 @@ TEST_F(ActiveScriptControllerUnitTest, ActiveScriptsUseActiveTabPermissions) {
// Also test that granting active tab runs any pending tasks.
Devlin 2014/08/15 21:24:00 this comment was somewhat misplaced before, and is
not at google - send to devlin 2014/08/15 21:38:29 Done.
Reload();
- // Navigating should mean we need permission again.
+ // Reloading and other same-origin navigations maintain the permission to
+ // execute.
+ EXPECT_FALSE(RequiresUserConsent(extension));
+ NavigateAndCommit(GURL("https://www.google.com/some-page"));
+ EXPECT_FALSE(RequiresUserConsent(extension));
+
+ // Navigating to a different origin will require user consent again.
+ NavigateAndCommit(GURL("https://yahoo.com"));
+ EXPECT_TRUE(RequiresUserConsent(extension));
+
+ // Back to the original origin should also re-require constent.
+ NavigateAndCommit(GURL("https://www.google.com"));
EXPECT_TRUE(RequiresUserConsent(extension));
RequestInjection(extension);

Powered by Google App Engine
This is Rietveld 408576698