| OLD | NEW |
| 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 #include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_
test_harness.h" | 5 #include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_
test_harness.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 const PageLoadMetadata& metadata) { | 133 const PageLoadMetadata& metadata) { |
| 134 observer_->OnMessageReceived(PageLoadMetricsMsg_TimingUpdated( | 134 observer_->OnMessageReceived(PageLoadMetricsMsg_TimingUpdated( |
| 135 observer_->routing_id(), timing, metadata), | 135 observer_->routing_id(), timing, metadata), |
| 136 web_contents()->GetMainFrame()); | 136 web_contents()->GetMainFrame()); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void PageLoadMetricsObserverTestHarness::SimulateLoadedResource( | 139 void PageLoadMetricsObserverTestHarness::SimulateLoadedResource( |
| 140 const ExtraRequestInfo& info) { | 140 const ExtraRequestInfo& info) { |
| 141 observer_->OnRequestComplete( | 141 observer_->OnRequestComplete( |
| 142 content::GlobalRequestID(), content::RESOURCE_TYPE_SCRIPT, | 142 content::GlobalRequestID(), content::RESOURCE_TYPE_SCRIPT, |
| 143 info.was_cached, info.data_reduction_proxy_used, info.raw_body_bytes, | 143 info.was_cached, info.data_reduction_proxy_used, info.was_lofi_response, |
| 144 info.original_network_content_length, base::TimeTicks::Now()); | 144 info.raw_body_bytes, info.original_network_content_length, |
| 145 base::TimeTicks::Now()); |
| 145 } | 146 } |
| 146 | 147 |
| 147 void PageLoadMetricsObserverTestHarness::SimulateInputEvent( | 148 void PageLoadMetricsObserverTestHarness::SimulateInputEvent( |
| 148 const blink::WebInputEvent& event) { | 149 const blink::WebInputEvent& event) { |
| 149 observer_->OnInputEvent(event); | 150 observer_->OnInputEvent(event); |
| 150 } | 151 } |
| 151 | 152 |
| 152 void PageLoadMetricsObserverTestHarness::SimulateAppEnterBackground() { | 153 void PageLoadMetricsObserverTestHarness::SimulateAppEnterBackground() { |
| 153 observer_->FlushMetricsOnAppEnterBackground(); | 154 observer_->FlushMetricsOnAppEnterBackground(); |
| 154 } | 155 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 172 } | 173 } |
| 173 | 174 |
| 174 void PageLoadMetricsObserverTestHarness::NavigateWithPageTransitionAndCommit( | 175 void PageLoadMetricsObserverTestHarness::NavigateWithPageTransitionAndCommit( |
| 175 const GURL& url, | 176 const GURL& url, |
| 176 ui::PageTransition transition) { | 177 ui::PageTransition transition) { |
| 177 controller().LoadURL(url, content::Referrer(), transition, std::string()); | 178 controller().LoadURL(url, content::Referrer(), transition, std::string()); |
| 178 content::WebContentsTester::For(web_contents())->CommitPendingNavigation(); | 179 content::WebContentsTester::For(web_contents())->CommitPendingNavigation(); |
| 179 } | 180 } |
| 180 | 181 |
| 181 } // namespace page_load_metrics | 182 } // namespace page_load_metrics |
| OLD | NEW |