Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 5238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5249 observer->Wait(); | 5249 observer->Wait(); |
| 5250 | 5250 |
| 5251 // Force the renderer to generate a new frame. | 5251 // Force the renderer to generate a new frame. |
| 5252 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), | 5252 EXPECT_TRUE(ExecuteScript(shell()->web_contents(), |
| 5253 "document.body.style.background = 'black'")); | 5253 "document.body.style.background = 'black'")); |
| 5254 | 5254 |
| 5255 // Waits for the next frame. | 5255 // Waits for the next frame. |
| 5256 observer->Wait(); | 5256 observer->Wait(); |
| 5257 } | 5257 } |
| 5258 | 5258 |
| 5259 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScreenCoordinates) { | |
| 5260 GURL main_url(embedded_test_server()->GetURL( | |
| 5261 "a.com", "/cross_site_iframe_factory.html?a(b)")); | |
| 5262 NavigateToURL(shell(), main_url); | |
| 5263 | |
| 5264 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) | |
| 5265 ->GetFrameTree() | |
| 5266 ->root(); | |
| 5267 FrameTreeNode* child = root->child_at(0); | |
| 5268 | |
| 5269 const char* properties[] = {"screenX", "screenY", "outerWidth", | |
| 5270 "outerHeight"}; | |
| 5271 | |
| 5272 for (const char* property : properties) { | |
| 5273 std::string script = "window.domAutomationController.send(window."; | |
| 5274 script += property; | |
| 5275 script += ");"; | |
| 5276 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
| |
| 5277 int child_value = 2; | |
| 5278 EXPECT_TRUE(ExecuteScriptAndExtractInt(root->current_frame_host(), | |
| 5279 script.c_str(), &root_value)); | |
| 5280 | |
| 5281 EXPECT_TRUE(ExecuteScriptAndExtractInt(child->current_frame_host(), | |
| 5282 script.c_str(), &child_value)); | |
| 5283 | |
| 5284 EXPECT_EQ(root_value, child_value); | |
| 5285 } | |
| 5286 } | |
| 5287 | |
| 5259 } // namespace content | 5288 } // namespace content |
| OLD | NEW |