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

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: rebase 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 c8fa716929efe53b4a79d82206f6b7027f69d236..17820abc7ff4420bcce22958cca54ed9e2b0a702 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -5256,4 +5256,33 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframeDisplayNone) {
observer->Wait();
}
+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;
nasko 2016/02/12 18:14:08 Are the tests always positioned the same way? I'm
lfg 2016/03/02 18:29:08 This shouldn't be an issue. The important point of
+ 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

Powered by Google App Engine
This is Rietveld 408576698