OLD | NEW |
(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_ |
OLD | NEW |