| 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 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 const PageLoadExtraInfo | 135 const PageLoadExtraInfo |
| 136 PageLoadMetricsObserverTestHarness::GetPageLoadExtraInfoForCommittedLoad() { | 136 PageLoadMetricsObserverTestHarness::GetPageLoadExtraInfoForCommittedLoad() { |
| 137 return observer_->GetPageLoadExtraInfoForCommittedLoad(); | 137 return observer_->GetPageLoadExtraInfoForCommittedLoad(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void PageLoadMetricsObserverTestHarness::NavigateWithPageTransitionAndCommit( | 140 void PageLoadMetricsObserverTestHarness::NavigateWithPageTransitionAndCommit( |
| 141 const GURL& url, | 141 const GURL& url, |
| 142 ui::PageTransition transition) { | 142 ui::PageTransition transition) { |
| 143 controller().LoadURL(url, content::Referrer(), transition, std::string()); | 143 controller().LoadURL(url, content::Referrer(), transition, std::string()); |
| 144 int pending_id = controller().GetPendingEntry()->GetUniqueID(); | 144 content::WebContentsTester::For(web_contents())->CommitPendingNavigation(); |
| 145 const bool did_create_new_entry = true; | |
| 146 content::WebContentsTester::For(web_contents()) | |
| 147 ->TestDidNavigate(web_contents()->GetMainFrame(), 1, pending_id, | |
| 148 did_create_new_entry, url, transition); | |
| 149 } | 145 } |
| 150 | 146 |
| 151 } // namespace page_load_metrics | 147 } // namespace page_load_metrics |
| OLD | NEW |