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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 1823283003: Fix flakiness in PopupMenu tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5172 matching lines...) Expand 10 before | Expand all | Expand 10 after
5183 embedded_test_server()->GetURL("/cross_site_iframe_factory.html?a(a)")); 5183 embedded_test_server()->GetURL("/cross_site_iframe_factory.html?a(a)"));
5184 NavigateToURL(shell(), main_url); 5184 NavigateToURL(shell(), main_url);
5185 5185
5186 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) 5186 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
5187 ->GetFrameTree() 5187 ->GetFrameTree()
5188 ->root(); 5188 ->root();
5189 5189
5190 // Position main window to ensure consistent screen coordinates. 5190 // Position main window to ensure consistent screen coordinates.
5191 RenderWidgetHostViewBase* rwhv_root = static_cast<RenderWidgetHostViewBase*>( 5191 RenderWidgetHostViewBase* rwhv_root = static_cast<RenderWidgetHostViewBase*>(
5192 root->current_frame_host()->GetRenderWidgetHost()->GetView()); 5192 root->current_frame_host()->GetRenderWidgetHost()->GetView());
5193 rwhv_root->SetBounds(gfx::Rect(100, 100, 500, 500));
5194 static_cast<WebContentsImpl*>(shell()->web_contents())->SendScreenRects(); 5193 static_cast<WebContentsImpl*>(shell()->web_contents())->SendScreenRects();
5195 5194
5196 content::TestNavigationObserver navigation_observer(shell()->web_contents()); 5195 content::TestNavigationObserver navigation_observer(shell()->web_contents());
5197 FrameTreeNode* child_node = root->child_at(0); 5196 FrameTreeNode* child_node = root->child_at(0);
5198 GURL site_url(embedded_test_server()->GetURL( 5197 GURL site_url(embedded_test_server()->GetURL(
5199 "baz.com", "/site_isolation/page-with-select.html")); 5198 "baz.com", "/site_isolation/page-with-select.html"));
5200 NavigateFrameToURL(child_node, site_url); 5199 NavigateFrameToURL(child_node, site_url);
5201 navigation_observer.Wait(); 5200 navigation_observer.Wait();
5202 5201
5203 RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>( 5202 RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5242 "/cross_site_iframe_factory.html?a(b(c))")); 5241 "/cross_site_iframe_factory.html?a(b(c))"));
5243 NavigateToURL(shell(), main_url); 5242 NavigateToURL(shell(), main_url);
5244 5243
5245 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) 5244 FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
5246 ->GetFrameTree() 5245 ->GetFrameTree()
5247 ->root(); 5246 ->root();
5248 5247
5249 // Position main window to ensure consistent screen coordinates. 5248 // Position main window to ensure consistent screen coordinates.
5250 RenderWidgetHostViewBase* rwhv_root = static_cast<RenderWidgetHostViewBase*>( 5249 RenderWidgetHostViewBase* rwhv_root = static_cast<RenderWidgetHostViewBase*>(
5251 root->current_frame_host()->GetRenderWidgetHost()->GetView()); 5250 root->current_frame_host()->GetRenderWidgetHost()->GetView());
5252 rwhv_root->SetBounds(gfx::Rect(100, 100, 500, 500));
5253 static_cast<WebContentsImpl*>(shell()->web_contents())->SendScreenRects(); 5251 static_cast<WebContentsImpl*>(shell()->web_contents())->SendScreenRects();
5254 5252
5255 // For clarity, we are labeling the frame tree nodes as: 5253 // For clarity, we are labeling the frame tree nodes as:
5256 // - root_node 5254 // - root_node
5257 // \-> b_node (out-of-process from root and c_node) 5255 // \-> b_node (out-of-process from root and c_node)
5258 // \-> c_node (out-of-process from root and b_node) 5256 // \-> c_node (out-of-process from root and b_node)
5259 5257
5260 content::TestNavigationObserver navigation_observer(shell()->web_contents()); 5258 content::TestNavigationObserver navigation_observer(shell()->web_contents());
5261 FrameTreeNode* b_node = root->child_at(0); 5259 FrameTreeNode* b_node = root->child_at(0);
5262 FrameTreeNode* c_node = b_node->child_at(0); 5260 FrameTreeNode* c_node = b_node->child_at(0);
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
6245 EXPECT_EQ(b_url, root->current_url()); 6243 EXPECT_EQ(b_url, root->current_url());
6246 6244
6247 // Verify that the same RenderViewHost is preserved and that it is no longer 6245 // Verify that the same RenderViewHost is preserved and that it is no longer
6248 // in swapped out state. 6246 // in swapped out state.
6249 EXPECT_EQ(rvh, contents->GetFrameTree()->GetRenderViewHost( 6247 EXPECT_EQ(rvh, contents->GetFrameTree()->GetRenderViewHost(
6250 root->current_frame_host()->GetSiteInstance())); 6248 root->current_frame_host()->GetSiteInstance()));
6251 EXPECT_FALSE(rvh->is_swapped_out_); 6249 EXPECT_FALSE(rvh->is_swapped_out_);
6252 } 6250 }
6253 6251
6254 } // namespace content 6252 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698