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

Side by Side Diff: chrome/renderer/page_load_metrics/fake_page_timing_sender.h

Issue 2823523003: [Page Load Metrics] PageLoadMetrics Mojofication. (Closed)
Patch Set: Addressed comments, remove unnecessary RunUntilIdle, call OnTimingUpdated directly in unit tests 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
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_SENDER_H_
6 #define CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_SENDER_H_
7
8 #include "chrome/common/page_load_metrics/page_load_metrics.mojom.h"
9 #include "chrome/common/page_load_metrics/page_load_timing.h"
10 #include "chrome/renderer/page_load_metrics/page_timing_sender.h"
11
12 namespace page_load_metrics {
13
14 // PageTimingSender fake implementation for use in tests. Allows to implement
15 // customized Send() in order to send mojo to specific mojom::PageLoadMetrics
16 // for tests.
17 // It does not verify any message it sends.
18 // The pointer to mojom::PageLoadMetrics implementation must be set before
19 // calling SendTiming.
20 class FakePageTimingSender : public PageTimingSender {
21 public:
22 FakePageTimingSender();
23 ~FakePageTimingSender();
24 void SendTiming(const PageLoadTiming& timing,
25 const PageLoadMetadata& metadata) override;
26 mojom::PageLoadMetricsPtr& page_load_metrics_ptr() {
27 return page_load_metrics_ptr_;
28 }
29
30 private:
31 mojom::PageLoadMetricsPtr page_load_metrics_ptr_;
32 DISALLOW_COPY_AND_ASSIGN(FakePageTimingSender);
33 };
34
35 } // namespace page_load_metrics
36
37 #endif // CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698