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

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

Issue 1911093002: Remove incorrect DCHECK in RequestOpenURL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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 2670 matching lines...) Expand 10 before | Expand all | Expand 10 after
2681 } else { 2681 } else {
2682 // Accessing a property with normal security checks should throw a 2682 // Accessing a property with normal security checks should throw a
2683 // SecurityError if the same-origin windows are in different processes. 2683 // SecurityError if the same-origin windows are in different processes.
2684 EXPECT_THAT(result, 2684 EXPECT_THAT(result,
2685 ::testing::MatchesRegex("SecurityError: Blocked a frame with " 2685 ::testing::MatchesRegex("SecurityError: Blocked a frame with "
2686 "origin \"http://a.com:\\d+\" from " 2686 "origin \"http://a.com:\\d+\" from "
2687 "accessing a cross-origin frame.")); 2687 "accessing a cross-origin frame."));
2688 } 2688 }
2689 } 2689 }
2690 2690
2691 // Test coverage for attempts to open subframe links in new windows, to prevent
2692 // incorrect invariant checks. See https://crbug.com/605055.
2693 IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, CtrlClickSubframeLink) {
2694 StartEmbeddedServer();
2695
2696 // Load a page with a subframe link.
2697 NavigateToURL(shell(), embedded_test_server()->GetURL(
2698 "/ctrl-click-subframe-link.html"));
2699
2700 // Simulate a ctrl click on the link. This won't actually create a new Shell
2701 // because Shell::OpenURLFromTab only supports CURRENT_TAB, but it's enough to
2702 // trigger the crash from https://crbug.com/605055.
2703 EXPECT_TRUE(
2704 ExecuteScript(shell()->web_contents(),
2705 "window.domAutomationController.send(ctrlClickLink());"));
2706 }
2707
2691 } // namespace content 2708 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/test/data/ctrl-click-subframe-link.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698