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

Side by Side 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: addressing comments Created 4 years, 9 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 5408 matching lines...) Expand 10 before | Expand all | Expand 10 after
5419 observer->Wait(); 5419 observer->Wait();
5420 5420
5421 // Force the renderer to generate a new frame. 5421 // Force the renderer to generate a new frame.
5422 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), 5422 EXPECT_TRUE(ExecuteScript(shell()->web_contents(),
5423 "document.body.style.background = 'black'")); 5423 "document.body.style.background = 'black'"));
5424 5424
5425 // Waits for the next frame. 5425 // Waits for the next frame.
5426 observer->Wait(); 5426 observer->Wait();
5427 } 5427 }
5428 5428
5429 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScreenCoordinates) {
5430 GURL main_url(embedded_test_server()->GetURL(
5431 "a.com", "/cross_site_iframe_factory.html?a(b)"));
5432 NavigateToURL(shell(), main_url);
5433
5434 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
5435 ->GetFrameTree()
5436 ->root();
5437 FrameTreeNode* child = root->child_at(0);
5438
5439 const char* properties[] = {"screenX", "screenY", "outerWidth",
5440 "outerHeight"};
5441
5442 for (const char* property : properties) {
5443 std::string script = "window.domAutomationController.send(window.";
5444 script += property;
5445 script += ");";
5446 int root_value = 1;
5447 int child_value = 2;
5448 EXPECT_TRUE(ExecuteScriptAndExtractInt(root->current_frame_host(),
5449 script.c_str(), &root_value));
5450
5451 EXPECT_TRUE(ExecuteScriptAndExtractInt(child->current_frame_host(),
5452 script.c_str(), &child_value));
5453
5454 EXPECT_EQ(root_value, child_value);
5455 }
5456 }
5457
5429 } // namespace content 5458 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698