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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 1467783002: Use FrameTreeNode::current_origin() in more places. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « content/browser/frame_host/frame_tree_browsertest.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 shell()->web_contents()->SetDelegate(console_delegate.get()); 2778 shell()->web_contents()->SetDelegate(console_delegate.get());
2779 2779
2780 // frames[1] can't be used due to a bug where RemoteFrames are created out of 2780 // frames[1] can't be used due to a bug where RemoteFrames are created out of
2781 // order (https://crbug.com/478792). Instead, target second frame by name. 2781 // order (https://crbug.com/478792). Instead, target second frame by name.
2782 EXPECT_TRUE(ExecuteScript( 2782 EXPECT_TRUE(ExecuteScript(
2783 root->child_at(0)->current_frame_host(), 2783 root->child_at(0)->current_frame_host(),
2784 "window.domAutomationController.send(" 2784 "window.domAutomationController.send("
2785 " parent.frames['frame2'].location.href = 'data:text/html,foo');")); 2785 " parent.frames['frame2'].location.href = 'data:text/html,foo');"));
2786 console_delegate->Wait(); 2786 console_delegate->Wait();
2787 2787
2788 std::string frame_origin = 2788 std::string frame_origin = root->child_at(1)->current_origin().Serialize();
2789 root->child_at(1)->current_replication_state().origin.Serialize();
2790 EXPECT_EQ(frame_origin + "/", frame_url.GetOrigin().spec()); 2789 EXPECT_EQ(frame_origin + "/", frame_url.GetOrigin().spec());
2791 EXPECT_TRUE( 2790 EXPECT_TRUE(
2792 base::MatchPattern(console_delegate->message(), "*" + frame_origin + "*")) 2791 base::MatchPattern(console_delegate->message(), "*" + frame_origin + "*"))
2793 << "Error message does not contain the frame's latest origin (" 2792 << "Error message does not contain the frame's latest origin ("
2794 << frame_origin << ")"; 2793 << frame_origin << ")";
2795 } 2794 }
2796 2795
2797 // Ensure that navigating subframes in --site-per-process mode properly fires 2796 // Ensure that navigating subframes in --site-per-process mode properly fires
2798 // the DidStopLoading event on WebContentsObserver. 2797 // the DidStopLoading event on WebContentsObserver.
2799 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteDidStopLoading) { 2798 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteDidStopLoading) {
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
4062 SimulateKeyPress(web_contents, ui::VKEY_O, false, false, false, false); 4061 SimulateKeyPress(web_contents, ui::VKEY_O, false, false, false, false);
4063 4062
4064 // Verify that the input field in the subframe received the keystrokes. 4063 // Verify that the input field in the subframe received the keystrokes.
4065 EXPECT_TRUE(ExecuteScriptAndExtractString( 4064 EXPECT_TRUE(ExecuteScriptAndExtractString(
4066 root->child_at(0)->current_frame_host(), 4065 root->child_at(0)->current_frame_host(),
4067 "window.domAutomationController.send(getInputFieldText());", &result)); 4066 "window.domAutomationController.send(getInputFieldText());", &result));
4068 EXPECT_EQ("FOO", result); 4067 EXPECT_EQ("FOO", result);
4069 } 4068 }
4070 4069
4071 } // namespace content 4070 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698