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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 1900923003: Fix CrossProcessPopupInheritsSandboxFlagsWithNoOpener on M50 official builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 "frame.sandbox = 'allow-scripts allow-popups';\n" 2506 "frame.sandbox = 'allow-scripts allow-popups';\n"
2507 "document.body.appendChild(frame);\n"; 2507 "document.body.appendChild(frame);\n";
2508 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), script)); 2508 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), script));
2509 } 2509 }
2510 2510
2511 // Navigate iframe to a page with target=_blank links, and rewrite the links 2511 // Navigate iframe to a page with target=_blank links, and rewrite the links
2512 // to point to valid cross-site URLs. 2512 // to point to valid cross-site URLs.
2513 GURL frame_url( 2513 GURL frame_url(
2514 embedded_test_server()->GetURL("a.com", "/click-noreferrer-links.html")); 2514 embedded_test_server()->GetURL("a.com", "/click-noreferrer-links.html"));
2515 NavigateFrameToURL(root->child_at(0), frame_url); 2515 NavigateFrameToURL(root->child_at(0), frame_url);
2516 EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
2516 std::string script = "setOriginForLinks('http://b.com:" + 2517 std::string script = "setOriginForLinks('http://b.com:" +
2517 embedded_test_server()->base_url().port() + "/');"; 2518 embedded_test_server()->base_url().port() + "/');";
2518 EXPECT_TRUE(ExecuteScript(root->child_at(0)->current_frame_host(), script)); 2519 EXPECT_TRUE(ExecuteScript(root->child_at(0)->current_frame_host(), script));
2519 2520
2520 // Helper to click on the 'rel=noreferrer target=_blank' and 'rel=noopener 2521 // Helper to click on the 'rel=noreferrer target=_blank' and 'rel=noopener
2521 // target=_blank' links. Checks that these links open a popup that ends up 2522 // target=_blank' links. Checks that these links open a popup that ends up
2522 // in a new SiteInstance even without site-per-process and then verifies that 2523 // in a new SiteInstance even without site-per-process and then verifies that
2523 // the popup is still sandboxed. 2524 // the popup is still sandboxed.
2524 auto click_link_and_verify_popup = [this, 2525 auto click_link_and_verify_popup = [this,
2525 root](std::string link_opening_script) { 2526 root](std::string link_opening_script) {
(...skipping 17 matching lines...) Expand all
2543 new_shell->web_contents(), 2544 new_shell->web_contents(),
2544 "domAutomationController.send(document.origin)", &origin)); 2545 "domAutomationController.send(document.origin)", &origin));
2545 EXPECT_EQ("null", origin); 2546 EXPECT_EQ("null", origin);
2546 }; 2547 };
2547 2548
2548 click_link_and_verify_popup("clickNoOpenerTargetBlankLink()"); 2549 click_link_and_verify_popup("clickNoOpenerTargetBlankLink()");
2549 click_link_and_verify_popup("clickNoRefTargetBlankLink()"); 2550 click_link_and_verify_popup("clickNoRefTargetBlankLink()");
2550 } 2551 }
2551 2552
2552 } // namespace content 2553 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698