| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 } | 938 } |
| 939 | 939 |
| 940 // Test that navigations to blob: and filesystem: URLs with extension origins | 940 // Test that navigations to blob: and filesystem: URLs with extension origins |
| 941 // are disallowed in an unprivileged, non-guest web process when the extension | 941 // are disallowed in an unprivileged, non-guest web process when the extension |
| 942 // origin corresponds to a Chrome app with the "webview" permission. See | 942 // origin corresponds to a Chrome app with the "webview" permission. See |
| 943 // https://crbug.com/656752. These requests should still be allowed inside | 943 // https://crbug.com/656752. These requests should still be allowed inside |
| 944 // actual <webview> guest processes created by a Chrome app; this is checked in | 944 // actual <webview> guest processes created by a Chrome app; this is checked in |
| 945 // WebViewTest.Shim_TestBlobURL. | 945 // WebViewTest.Shim_TestBlobURL. |
| 946 IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, | 946 IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, |
| 947 NestedURLNavigationsToAppBlocked) { | 947 NestedURLNavigationsToAppBlocked) { |
| 948 // TODO(alexmos): Re-enable this test for PlzNavigate after tightening | |
| 949 // nested URL blocking for apps with the "webview" permission in | |
| 950 // ExtensionNavigationThrottle and removing the corresponding check from | |
| 951 // ChromeExtensionsNetworkDelegate. The latter is incompatible with | |
| 952 // PlzNavigate. | |
| 953 if (content::IsBrowserSideNavigationEnabled()) | |
| 954 return; | |
| 955 | |
| 956 // Disabling web security is necessary to test the browser enforcement; | 948 // Disabling web security is necessary to test the browser enforcement; |
| 957 // without it, the loads in this test would be blocked by | 949 // without it, the loads in this test would be blocked by |
| 958 // SecurityOrigin::canDisplay() as invalid local resource loads. | 950 // SecurityOrigin::canDisplay() as invalid local resource loads. |
| 959 PrefService* prefs = browser()->profile()->GetPrefs(); | 951 PrefService* prefs = browser()->profile()->GetPrefs(); |
| 960 prefs->SetBoolean(prefs::kWebKitWebSecurityEnabled, false); | 952 prefs->SetBoolean(prefs::kWebKitWebSecurityEnabled, false); |
| 961 | 953 |
| 962 // Load a simple app that has the "webview" permission. The app will also | 954 // Load a simple app that has the "webview" permission. The app will also |
| 963 // open a <webview> when it's loaded. | 955 // open a <webview> when it's loaded. |
| 964 ASSERT_TRUE(embedded_test_server()->Start()); | 956 ASSERT_TRUE(embedded_test_server()->Start()); |
| 965 base::FilePath dir; | 957 base::FilePath dir; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 GURL b_url(embedded_test_server()->GetURL("b.com", "/empty.html")); | 1235 GURL b_url(embedded_test_server()->GetURL("b.com", "/empty.html")); |
| 1244 EXPECT_TRUE(content::NavigateIframeToURL(tab, "frame0", b_url)); | 1236 EXPECT_TRUE(content::NavigateIframeToURL(tab, "frame0", b_url)); |
| 1245 { | 1237 { |
| 1246 content::RenderFrameHost* subframe = ChildFrameAt(main_frame, 0); | 1238 content::RenderFrameHost* subframe = ChildFrameAt(main_frame, 0); |
| 1247 EXPECT_EQ(subframe->GetProcess(), main_frame->GetProcess()); | 1239 EXPECT_EQ(subframe->GetProcess(), main_frame->GetProcess()); |
| 1248 EXPECT_EQ(subframe->GetSiteInstance(), main_frame->GetSiteInstance()); | 1240 EXPECT_EQ(subframe->GetSiteInstance(), main_frame->GetSiteInstance()); |
| 1249 } | 1241 } |
| 1250 } | 1242 } |
| 1251 | 1243 |
| 1252 } // namespace extensions | 1244 } // namespace extensions |
| OLD | NEW |