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

Side by Side Diff: components/page_load_metrics/browser/metrics_web_contents_observer_unittest.cc

Issue 1913693002: Histogram the amount of time spent on HTTP(S) page loads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Equality operations are hard, let's go trybotting Created 4 years, 7 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "components/page_load_metrics/browser/metrics_web_contents_observer.h" 5 #include "components/page_load_metrics/browser/metrics_web_contents_observer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 24 matching lines...) Expand all
35 public: 35 public:
36 explicit TestPageLoadMetricsObserver( 36 explicit TestPageLoadMetricsObserver(
37 std::vector<PageLoadTiming>* updated_timings, 37 std::vector<PageLoadTiming>* updated_timings,
38 std::vector<PageLoadTiming>* complete_timings, 38 std::vector<PageLoadTiming>* complete_timings,
39 std::vector<GURL>* observed_committed_urls) 39 std::vector<GURL>* observed_committed_urls)
40 : updated_timings_(updated_timings), 40 : updated_timings_(updated_timings),
41 complete_timings_(complete_timings), 41 complete_timings_(complete_timings),
42 observed_committed_urls_(observed_committed_urls) {} 42 observed_committed_urls_(observed_committed_urls) {}
43 43
44 void OnStart(content::NavigationHandle* navigation_handle, 44 void OnStart(content::NavigationHandle* navigation_handle,
45 const GURL& currently_committed_url) override { 45 const GURL& currently_committed_url,
46 bool started_in_foreground) override {
46 observed_committed_urls_->push_back(currently_committed_url); 47 observed_committed_urls_->push_back(currently_committed_url);
47 } 48 }
48 49
49 void OnTimingUpdate(const PageLoadTiming& timing, 50 void OnTimingUpdate(const PageLoadTiming& timing,
50 const PageLoadExtraInfo& extra_info) override { 51 const PageLoadExtraInfo& extra_info) override {
51 updated_timings_->push_back(timing); 52 updated_timings_->push_back(timing);
52 } 53 }
53 54
54 void OnComplete(const PageLoadTiming& timing, 55 void OnComplete(const PageLoadTiming& timing,
55 const PageLoadExtraInfo& extra_info) override { 56 const PageLoadExtraInfo& extra_info) override {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 rfh_tester->SimulateNavigationStop(); 442 rfh_tester->SimulateNavigationStop();
442 443
443 web_contents()->Stop(); 444 web_contents()->Stop();
444 445
445 histogram_tester_.ExpectTotalCount(internal::kAbortChainSizeNoCommit, 1); 446 histogram_tester_.ExpectTotalCount(internal::kAbortChainSizeNoCommit, 1);
446 histogram_tester_.ExpectBucketCount(internal::kAbortChainSizeNoCommit, 3, 447 histogram_tester_.ExpectBucketCount(internal::kAbortChainSizeNoCommit, 3,
447 1); 448 1);
448 } 449 }
449 450
450 } // namespace page_load_metrics 451 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698