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 24fb1e9248866b169861a12aafb4d0d33804925c..0b10ffb94177e5e3fad7c53267d5ee30d2e08006 100644 |
--- a/content/browser/site_per_process_browsertest.cc |
+++ b/content/browser/site_per_process_browsertest.cc |
@@ -5426,4 +5426,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; |
+ 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 |