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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1685213002: Propagate window coordinates to out-of-process iframes renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sendscreenrects
Patch Set: properly rebasing Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 4031eec450898b84b4c7852430ad65f262a28ade..e0e89f185ba45950a57ece2bc981b17950464c19 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -5584,8 +5584,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
std::string frame_title;
EXPECT_TRUE(ExecuteScriptAndExtractString(
root->child_at(0)->current_frame_host(),
- "domAutomationController.send(document.title)",
- &frame_title));
+ "domAutomationController.send(document.title)", &frame_title));
EXPECT_EQ("", frame_title);
// Navigate the subframe to another cross-origin page and ensure that this
@@ -5607,4 +5606,33 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
}
}
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScreenCoordinates) {
+ GURL main_url(embedded_test_server()->GetURL(
+ "a.com", "/cross_site_iframe_factory.html?a(b)"));
+ NavigateToURL(shell(), main_url);
+
+ FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
+ ->GetFrameTree()
+ ->root();
+ FrameTreeNode* child = root->child_at(0);
+
+ const char* properties[] = {"screenX", "screenY", "outerWidth",
+ "outerHeight"};
+
+ for (const char* property : properties) {
+ std::string script = "window.domAutomationController.send(window.";
+ script += property;
+ script += ");";
+ int root_value = 1;
+ int child_value = 2;
+ EXPECT_TRUE(ExecuteScriptAndExtractInt(root->current_frame_host(),
+ script.c_str(), &root_value));
+
+ EXPECT_TRUE(ExecuteScriptAndExtractInt(child->current_frame_host(),
+ script.c_str(), &child_value));
+
+ EXPECT_EQ(root_value, child_value);
+ }
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698