diff options
author | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-04 09:00:39 +0000 |
---|---|---|
committer | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-04 09:00:39 +0000 |
commit | 8d5cb21f876a51c4fddcb90954e0dd819a09a7a5 (patch) | |
tree | 0005719b9fbf9fd1757f5d028f557215487d1645 /chrome/browser/extensions/active_script_controller_unittest.cc | |
parent | ce3651bc735d21ca677642616c454cf2e97797ca (diff) | |
download | chromium_src-8d5cb21f876a51c4fddcb90954e0dd819a09a7a5.zip chromium_src-8d5cb21f876a51c4fddcb90954e0dd819a09a7a5.tar.gz chromium_src-8d5cb21f876a51c4fddcb90954e0dd819a09a7a5.tar.bz2 |
Trust the renderer's same-document navigation flag if it is a same-origin nav.
Currently in AreURLsInPageNavigation, we only trust renderer_says_in_page if
the before and after urls are identical. This prevents us from correctly
classifying history.pushState and history.replaceState navigations as in-page.
Navigations via the history API are required to be same-origin, but can differ
by more than just the ref component, so we get the correct behavior without
the renderer process being able to lie about a cross-origin navigation.
BUG=138324
TEST=Added cases to NavigationControllerTest.IsInPageNavigation
Review URL: https://codereview.chromium.org/304763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/active_script_controller_unittest.cc')
-rw-r--r-- | chrome/browser/extensions/active_script_controller_unittest.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/extensions/active_script_controller_unittest.cc b/chrome/browser/extensions/active_script_controller_unittest.cc index a670a53f..0b40328 100644 --- a/chrome/browser/extensions/active_script_controller_unittest.cc +++ b/chrome/browser/extensions/active_script_controller_unittest.cc @@ -219,9 +219,9 @@ TEST_F(ActiveScriptControllerUnitTest, PendingInjectionsRemovedAtNavigation) { EXPECT_TRUE(controller()->GetActionForExtension(extension)); EXPECT_EQ(0u, GetExecutionCountForExtension(extension->id())); - // Navigate away. This should remove the pending injection, and we should not + // Reload. This should remove the pending injection, and we should not // execute anything. - NavigateAndCommit(GURL("https://www.google.com")); + Reload(); EXPECT_FALSE(controller()->GetActionForExtension(extension)); EXPECT_EQ(0u, GetExecutionCountForExtension(extension->id())); @@ -281,7 +281,7 @@ TEST_F(ActiveScriptControllerUnitTest, ActiveScriptsUseActiveTabPermissions) { EXPECT_FALSE(controller()->RequiresUserConsentForScriptInjection(extension)); // Also test that granting active tab runs any pending tasks. - NavigateAndCommit(GURL("https://www.google.com")); + Reload(); // Navigating should mean we need permission again. EXPECT_TRUE(controller()->RequiresUserConsentForScriptInjection(extension)); |