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

Side by Side Diff: chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h

Issue 2780003003: Send an event to the page load metrics to track resource starting. (Closed)
Patch Set: FREEZE.unindexed - took merge and fixed it up Created 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_LOAD_METRICS_OBSERVER_TE ST_HARNESS_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_LOAD_METRICS_OBSERVER_TE ST_HARNESS_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_LOAD_METRICS_OBSERVER_TE ST_HARNESS_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_LOAD_METRICS_OBSERVER_TE ST_HARNESS_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/test/histogram_tester.h" 9 #include "base/test/histogram_tester.h"
10 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" 10 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 // Call this to simulate sending a PageLoadTiming IPC from the render process 52 // Call this to simulate sending a PageLoadTiming IPC from the render process
53 // to the browser process. These will update the timing information for the 53 // to the browser process. These will update the timing information for the
54 // most recently committed navigation. 54 // most recently committed navigation.
55 void SimulateTimingUpdate(const PageLoadTiming& timing); 55 void SimulateTimingUpdate(const PageLoadTiming& timing);
56 void SimulateTimingAndMetadataUpdate(const PageLoadTiming& timing, 56 void SimulateTimingAndMetadataUpdate(const PageLoadTiming& timing,
57 const PageLoadMetadata& metadata); 57 const PageLoadMetadata& metadata);
58 58
59 // Simulates a loaded resource. 59 // Simulates a loaded resource.
60 void SimulateLoadedResource(const ExtraRequestInfo& info); 60 void SimulateStartedResource(const ExtraRequestStartInfo& info);
61
62 // Simulates a loaded resource.
63 void SimulateLoadedResource(const ExtraRequestCompleteInfo& info);
61 64
62 // Simulates a user input. 65 // Simulates a user input.
63 void SimulateInputEvent(const blink::WebInputEvent& event); 66 void SimulateInputEvent(const blink::WebInputEvent& event);
64 67
65 // Simulates the app being backgrounded. 68 // Simulates the app being backgrounded.
66 void SimulateAppEnterBackground(); 69 void SimulateAppEnterBackground();
67 70
68 // Simulate playing a media element. 71 // Simulate playing a media element.
69 void SimulateMediaPlayed(); 72 void SimulateMediaPlayed();
70 73
71 const base::HistogramTester& histogram_tester() const; 74 const base::HistogramTester& histogram_tester() const;
72 75
73 // Gets the PageLoadExtraInfo for the committed_load_ in observer_. 76 // Gets the PageLoadExtraInfo for the committed_load_ in observer_.
74 const PageLoadExtraInfo GetPageLoadExtraInfoForCommittedLoad(); 77 const PageLoadExtraInfo GetPageLoadExtraInfoForCommittedLoad();
75 78
76 private: 79 private:
77 base::HistogramTester histogram_tester_; 80 base::HistogramTester histogram_tester_;
78 MetricsWebContentsObserver* observer_; 81 MetricsWebContentsObserver* observer_;
79 82
80 DISALLOW_COPY_AND_ASSIGN(PageLoadMetricsObserverTestHarness); 83 DISALLOW_COPY_AND_ASSIGN(PageLoadMetricsObserverTestHarness);
81 }; 84 };
82 85
83 } // namespace page_load_metrics 86 } // namespace page_load_metrics
84 87
85 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_LOAD_METRICS_OBSERVER _TEST_HARNESS_H_ 88 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PAGE_LOAD_METRICS_OBSERVER _TEST_HARNESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698