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

Side by Side Diff: content/test/test_render_frame_host.cc

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing nits 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "content/test/test_render_frame_host.h" 5 #include "content/test/test_render_frame_host.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "content/browser/frame_host/frame_tree.h" 8 #include "content/browser/frame_host/frame_tree.h"
9 #include "content/browser/frame_host/navigation_handle_impl.h" 9 #include "content/browser/frame_host/navigation_handle_impl.h"
10 #include "content/browser/frame_host/navigation_request.h" 10 #include "content/browser/frame_host/navigation_request.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 render_view_host, 53 render_view_host,
54 delegate, 54 delegate,
55 rwh_delegate, 55 rwh_delegate,
56 frame_tree, 56 frame_tree,
57 frame_tree_node, 57 frame_tree_node,
58 routing_id, 58 routing_id,
59 widget_routing_id, 59 widget_routing_id,
60 flags), 60 flags),
61 child_creation_observer_(delegate ? delegate->GetAsWebContents() : NULL), 61 child_creation_observer_(delegate ? delegate->GetAsWebContents() : NULL),
62 contents_mime_type_("text/html"), 62 contents_mime_type_("text/html"),
63 simulate_history_list_was_cleared_(false) {} 63 simulate_history_list_was_cleared_(false),
64 simulate_fetch_via_data_reduction_proxy_(false) {}
64 65
65 TestRenderFrameHost::~TestRenderFrameHost() { 66 TestRenderFrameHost::~TestRenderFrameHost() {
66 } 67 }
67 68
68 TestRenderViewHost* TestRenderFrameHost::GetRenderViewHost() { 69 TestRenderViewHost* TestRenderFrameHost::GetRenderViewHost() {
69 return static_cast<TestRenderViewHost*>( 70 return static_cast<TestRenderViewHost*>(
70 RenderFrameHostImpl::GetRenderViewHost()); 71 RenderFrameHostImpl::GetRenderViewHost());
71 } 72 }
72 73
73 MockRenderProcessHost* TestRenderFrameHost::GetProcess() { 74 MockRenderProcessHost* TestRenderFrameHost::GetProcess() {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 params.should_update_history = true; 288 params.should_update_history = true;
288 params.did_create_new_entry = did_create_new_entry; 289 params.did_create_new_entry = did_create_new_entry;
289 params.gesture = NavigationGestureUser; 290 params.gesture = NavigationGestureUser;
290 params.contents_mime_type = contents_mime_type_; 291 params.contents_mime_type = contents_mime_type_;
291 params.is_post = false; 292 params.is_post = false;
292 params.http_status_code = response_code; 293 params.http_status_code = response_code;
293 params.socket_address.set_host("2001:db8::1"); 294 params.socket_address.set_host("2001:db8::1");
294 params.socket_address.set_port(80); 295 params.socket_address.set_port(80);
295 params.history_list_was_cleared = simulate_history_list_was_cleared_; 296 params.history_list_was_cleared = simulate_history_list_was_cleared_;
296 params.original_request_url = url_copy; 297 params.original_request_url = url_copy;
298 params.used_data_reduction_proxy = simulate_fetch_via_data_reduction_proxy_;
297 299
298 // In most cases, the origin will match the URL's origin. Tests that need to 300 // In most cases, the origin will match the URL's origin. Tests that need to
299 // check corner cases (like about:blank) should specify the origin param 301 // check corner cases (like about:blank) should specify the origin param
300 // manually. 302 // manually.
301 url::Origin origin(url_copy); 303 url::Origin origin(url_copy);
302 params.origin = origin; 304 params.origin = origin;
303 305
304 url::Replacements<char> replacements; 306 url::Replacements<char> replacements;
305 replacements.ClearRef(); 307 replacements.ClearRef();
306 params.was_within_same_page = 308 params.was_within_same_page =
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 // cleared during DidFailProvisionalLoad). 420 // cleared during DidFailProvisionalLoad).
419 int page_id = entry ? entry->GetPageID() : -1; 421 int page_id = entry ? entry->GetPageID() : -1;
420 if (page_id == -1) { 422 if (page_id == -1) {
421 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); 423 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate());
422 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; 424 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1;
423 } 425 }
424 return page_id; 426 return page_id;
425 } 427 }
426 428
427 } // namespace content 429 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698