| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_METRICS_IPC_SENDER_H_ | 5 #ifndef CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_METRICS_IPC_SENDER_H_ |
| 6 #define CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_METRICS_IPC_SENDER_H_ | 6 #define CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_METRICS_IPC_SENDER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "chrome/common/page_load_metrics/page_load_timing.h" | 10 #include "chrome/common/page_load_metrics/page_load_timing.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 bool Send(IPC::Message* message) override; | 46 bool Send(IPC::Message* message) override; |
| 47 | 47 |
| 48 // PageLoadTimings that are expected to be sent through Send() should be | 48 // PageLoadTimings that are expected to be sent through Send() should be |
| 49 // passed to ExpectPageLoadTiming. | 49 // passed to ExpectPageLoadTiming. |
| 50 void ExpectPageLoadTiming(const PageLoadTiming& timing); | 50 void ExpectPageLoadTiming(const PageLoadTiming& timing); |
| 51 | 51 |
| 52 // Forces verification that actual timings sent through Send match | 52 // Forces verification that actual timings sent through Send match |
| 53 // expected timings provided via ExpectPageLoadTiming. | 53 // expected timings provided via ExpectPageLoadTiming. |
| 54 void VerifyExpectedTimings() const; | 54 void VerifyExpectedTimings() const; |
| 55 | 55 |
| 56 const std::vector<PageLoadTiming>& expected_timings() const { | 56 const std::vector<mojo::StructPtr<PageLoadTiming>>& expected_timings() const { |
| 57 return expected_timings_; | 57 return expected_timings_; |
| 58 } | 58 } |
| 59 const std::vector<PageLoadTiming>& actual_timings() const { | 59 const std::vector<mojo::StructPtr<PageLoadTiming>>& actual_timings() const { |
| 60 return actual_timings_; | 60 return actual_timings_; |
| 61 } | 61 } |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 void OnTimingUpdated(const PageLoadTiming& timing, PageLoadMetadata metadata); | 64 void OnTimingUpdated(const PageLoadTiming& timing, PageLoadMetadata metadata); |
| 65 | 65 |
| 66 std::vector<PageLoadTiming> expected_timings_; | 66 std::vector<mojo::StructPtr<PageLoadTiming>> expected_timings_; |
| 67 std::vector<PageLoadTiming> actual_timings_; | 67 std::vector<mojo::StructPtr<PageLoadTiming>> actual_timings_; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace page_load_metrics | 70 } // namespace page_load_metrics |
| 71 | 71 |
| 72 #endif // CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_METRICS_IPC_SENDER
_H_ | 72 #endif // CHROME_RENDERER_PAGE_LOAD_METRICS_FAKE_PAGE_TIMING_METRICS_IPC_SENDER
_H_ |
| OLD | NEW |