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

Side by Side Diff: chrome/browser/chrome_site_per_process_browsertest.cc

Issue 1852903002: Create an interactive site-per-process browsertest class and move DocumentHasFocus there. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig's comments 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 | chrome/browser/site_per_process_interactive_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html")); 63 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html"));
64 ui_test_utils::NavigateToURL(browser(), main_url); 64 ui_test_utils::NavigateToURL(browser(), main_url);
65 65
66 // Navigate subframe cross-site. 66 // Navigate subframe cross-site.
67 content::WebContents* active_web_contents = 67 content::WebContents* active_web_contents =
68 browser()->tab_strip_model()->GetActiveWebContents(); 68 browser()->tab_strip_model()->GetActiveWebContents();
69 GURL cross_site_url(embedded_test_server()->GetURL("b.com", "/title2.html")); 69 GURL cross_site_url(embedded_test_server()->GetURL("b.com", "/title2.html"));
70 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", cross_site_url)); 70 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", cross_site_url));
71 71
72 // Find the subframe's RenderFrameHost. 72 // Find the subframe's RenderFrameHost.
73 content::RenderFrameHost* frame_host = FrameMatchingPredicate( 73 content::RenderFrameHost* frame_host =
74 active_web_contents, 74 ChildFrameAt(active_web_contents->GetMainFrame(), 0);
75 base::Bind(&content::FrameHasSourceUrl, cross_site_url));
76 ASSERT_TRUE(frame_host); 75 ASSERT_TRUE(frame_host);
76 EXPECT_EQ(cross_site_url, frame_host->GetLastCommittedURL());
77 EXPECT_TRUE(frame_host->IsCrossProcessSubframe()); 77 EXPECT_TRUE(frame_host->IsCrossProcessSubframe());
78 78
79 // Check that JS storage APIs can be accessed successfully. 79 // Check that JS storage APIs can be accessed successfully.
80 EXPECT_TRUE( 80 EXPECT_TRUE(
81 content::ExecuteScript(frame_host, "localStorage['foo'] = 'bar'")); 81 content::ExecuteScript(frame_host, "localStorage['foo'] = 'bar'"));
82 std::string result; 82 std::string result;
83 EXPECT_TRUE(ExecuteScriptAndExtractString( 83 EXPECT_TRUE(ExecuteScriptAndExtractString(
84 frame_host, "window.domAutomationController.send(localStorage['foo']);", 84 frame_host, "window.domAutomationController.send(localStorage['foo']);",
85 &result)); 85 &result));
86 EXPECT_EQ(result, "bar"); 86 EXPECT_EQ(result, "bar");
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 main_lost_focus = true; 171 main_lost_focus = true;
172 if (status == "\"popup-got-focus\"") 172 if (status == "\"popup-got-focus\"")
173 popup_got_focus = true; 173 popup_got_focus = true;
174 if (main_lost_focus && popup_got_focus) 174 if (main_lost_focus && popup_got_focus)
175 break; 175 break;
176 } 176 }
177 177
178 // The popup should be focused now. 178 // The popup should be focused now.
179 EXPECT_EQ(popup, browser()->tab_strip_model()->GetActiveWebContents()); 179 EXPECT_EQ(popup, browser()->tab_strip_model()->GetActiveWebContents());
180 } 180 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/site_per_process_interactive_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698