Index: chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc |
diff --git a/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc b/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc |
index 2a0e0313ad875123910fff5c1be73b19b1e3be14..bac746efc627dae9fa2d0772d739994bbaa66a38 100644 |
--- a/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc |
+++ b/chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc |
@@ -9,8 +9,10 @@ |
#include "base/macros.h" |
#include "base/memory/ptr_util.h" |
+#include "base/run_loop.h" |
#include "chrome/browser/page_load_metrics/page_load_metrics_embedder_interface.h" |
#include "chrome/browser/page_load_metrics/page_load_metrics_util.h" |
+#include "chrome/common/page_load_metrics/page_load_metrics.mojom.h" |
#include "chrome/common/page_load_metrics/page_load_metrics_messages.h" |
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h" |
#include "content/public/browser/navigation_entry.h" |
@@ -147,6 +149,14 @@ void PageLoadMetricsObserverTestHarness::SimulateTimingAndMetadataUpdate( |
observer_->OnMessageReceived(PageLoadMetricsMsg_TimingUpdated( |
Bryan McQuade
2017/04/26 16:04:34
let's switch this to invoke OnTimingUpdated direct
lpy
2017/04/27 10:58:35
Done. Forgot to change this part
|
observer_->routing_id(), timing, metadata), |
web_contents()->GetMainFrame()); |
+ observer_->page_load_metrics_binding_for_testing() |
+ .SetCurrentTargetFrameForTesting(web_contents()->GetMainFrame()); |
+ mojo::Binding<page_load_metrics::mojom::PageLoadMetrics> binding(observer_); |
+ mojom::PageLoadMetricsPtr ptr; |
+ mojom::PageLoadMetricsRequest request = MakeRequest(&ptr); |
+ binding.Bind(std::move(request)); |
+ ptr->UpdateTiming(timing, metadata); |
+ base::RunLoop().RunUntilIdle(); |
} |
void PageLoadMetricsObserverTestHarness::SimulateStartedResource( |