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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_browsertest.cc

Issue 2838293002: Ensure all content_browsertests call the host resolver in SetUpOnMainThread and not after. (Closed)
Patch Set: Created 3 years, 8 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdint.h> 5 #include <stdint.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/barrier_closure.h" 8 #include "base/barrier_closure.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 IPC_BEGIN_MESSAGE_MAP(CommitBeforeSwapAckSentHelper, message) 225 IPC_BEGIN_MESSAGE_MAP(CommitBeforeSwapAckSentHelper, message)
226 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, 226 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad,
227 WaitForSwapCompositorFrame()) 227 WaitForSwapCompositorFrame())
228 IPC_END_MESSAGE_MAP() 228 IPC_END_MESSAGE_MAP()
229 return false; 229 return false;
230 } 230 }
231 231
232 DISALLOW_COPY_AND_ASSIGN(CommitBeforeSwapAckSentHelper); 232 DISALLOW_COPY_AND_ASSIGN(CommitBeforeSwapAckSentHelper);
233 }; 233 };
234 234
235 using RenderWidgetHostViewBrowserTestBase = ContentBrowserTest; 235 class RenderWidgetHostViewBrowserTestBase : public ContentBrowserTest {
236 public:
237 ~RenderWidgetHostViewBrowserTestBase() override {}
238
239 protected:
240 void SetUpOnMainThread() override {
241 host_resolver()->AddRule("*", "127.0.0.1");
242 }
243 };
236 244
237 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewBrowserTestBase, 245 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewBrowserTestBase,
238 CompositorWorksWhenReusingRenderer) { 246 CompositorWorksWhenReusingRenderer) {
239 host_resolver()->AddRule("*", "127.0.0.1");
240 ASSERT_TRUE(embedded_test_server()->Start()); 247 ASSERT_TRUE(embedded_test_server()->Start());
241 auto* web_contents = shell()->web_contents(); 248 auto* web_contents = shell()->web_contents();
242 // Load a page that draws new frames infinitely. 249 // Load a page that draws new frames infinitely.
243 NavigateToURL(shell(), 250 NavigateToURL(shell(),
244 embedded_test_server()->GetURL("/page_with_animation.html")); 251 embedded_test_server()->GetURL("/page_with_animation.html"));
245 252
246 // Open a new page in the same renderer to keep it alive. 253 // Open a new page in the same renderer to keep it alive.
247 WebContents::CreateParams new_contents_params( 254 WebContents::CreateParams new_contents_params(
248 web_contents->GetBrowserContext(), web_contents->GetSiteInstance()); 255 web_contents->GetBrowserContext(), web_contents->GetSiteInstance());
249 std::unique_ptr<WebContents> new_web_contents( 256 std::unique_ptr<WebContents> new_web_contents(
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 kTestCompositingModes); 1008 kTestCompositingModes);
1002 INSTANTIATE_TEST_CASE_P( 1009 INSTANTIATE_TEST_CASE_P(
1003 GLAndSoftwareCompositing, 1010 GLAndSoftwareCompositing,
1004 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI, 1011 CompositingRenderWidgetHostViewBrowserTestTabCaptureHighDPI,
1005 kTestCompositingModes); 1012 kTestCompositingModes);
1006 1013
1007 #endif // !defined(OS_ANDROID) 1014 #endif // !defined(OS_ANDROID)
1008 1015
1009 } // namespace 1016 } // namespace
1010 } // namespace content 1017 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698