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

Side by Side Diff: content/public/test/test_renderer_host.cc

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created a DRP PageLoadMetricsObserver 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/public/test/test_renderer_host.h" 5 #include "content/public/test/test_renderer_host.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/frame_host/navigation_entry_impl.h" 9 #include "content/browser/frame_host/navigation_entry_impl.h"
10 #include "content/browser/renderer_host/render_view_host_factory.h" 10 #include "content/browser/renderer_host/render_view_host_factory.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 SiteInstance* instance = SiteInstance::Create(browser_context_.get()); 155 SiteInstance* instance = SiteInstance::Create(browser_context_.get());
156 instance->GetProcess()->Init(); 156 instance->GetProcess()->Init();
157 157
158 return TestWebContents::Create(browser_context_.get(), instance); 158 return TestWebContents::Create(browser_context_.get(), instance);
159 } 159 }
160 160
161 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { 161 void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) {
162 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url); 162 static_cast<TestWebContents*>(web_contents())->NavigateAndCommit(url);
163 } 163 }
164 164
165 void RenderViewHostTestHarness::SetSimulateUsedDataReductionProxy(
166 bool enabled) {
167 static_cast<TestWebContents*>(web_contents())
168 ->set_simulate_used_data_reduction_proxy(enabled);
169 }
170
165 void RenderViewHostTestHarness::Reload() { 171 void RenderViewHostTestHarness::Reload() {
166 NavigationEntry* entry = controller().GetLastCommittedEntry(); 172 NavigationEntry* entry = controller().GetLastCommittedEntry();
167 DCHECK(entry); 173 DCHECK(entry);
168 controller().Reload(false); 174 controller().Reload(false);
169 RenderFrameHostTester::For(main_rfh()) 175 RenderFrameHostTester::For(main_rfh())
170 ->SendNavigateWithTransition(entry->GetPageID(), entry->GetUniqueID(), 176 ->SendNavigateWithTransition(entry->GetPageID(), entry->GetUniqueID(),
171 false, entry->GetURL(), 177 false, entry->GetURL(),
172 ui::PAGE_TRANSITION_RELOAD); 178 ui::PAGE_TRANSITION_RELOAD);
173 } 179 }
174 180
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() { 250 BrowserContext* RenderViewHostTestHarness::CreateBrowserContext() {
245 return new TestBrowserContext(); 251 return new TestBrowserContext();
246 } 252 }
247 253
248 void RenderViewHostTestHarness::SetRenderProcessHostFactory( 254 void RenderViewHostTestHarness::SetRenderProcessHostFactory(
249 RenderProcessHostFactory* factory) { 255 RenderProcessHostFactory* factory) {
250 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory); 256 rvh_test_enabler_.rvh_factory_->set_render_process_host_factory(factory);
251 } 257 }
252 258
253 } // namespace content 259 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698