| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/feature_list.h" | 6 #include "base/feature_list.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 scoped_feature_list_.InitAndEnableFeature( | 315 scoped_feature_list_.InitAndEnableFeature( |
| 316 features::kPageLoadMetricsMojofication); | 316 features::kPageLoadMetricsMojofication); |
| 317 break; | 317 break; |
| 318 default: | 318 default: |
| 319 CHECK(false) << "Unknown IPCType."; | 319 CHECK(false) << "Unknown IPCType."; |
| 320 break; | 320 break; |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| 324 void SetUpOnMainThread() override { | 324 void SetUpOnMainThread() override { |
| 325 InProcessBrowserTest::SetUpOnMainThread(); | |
| 326 | |
| 327 content::WebContents* web_contents = | 325 content::WebContents* web_contents = |
| 328 browser()->tab_strip_model()->GetActiveWebContents(); | 326 browser()->tab_strip_model()->GetActiveWebContents(); |
| 329 ipc_type_verifier_ = base::MakeUnique<IPCTypeVerifier>(web_contents); | 327 ipc_type_verifier_ = base::MakeUnique<IPCTypeVerifier>(web_contents); |
| 330 } | 328 } |
| 331 | 329 |
| 332 // Force navigation to a new page, so the currently tracked page load runs its | 330 // Force navigation to a new page, so the currently tracked page load runs its |
| 333 // OnComplete callback. You should prefer to use PageLoadMetricsWaiter, and | 331 // OnComplete callback. You should prefer to use PageLoadMetricsWaiter, and |
| 334 // only use NavigateToUntrackedUrl for cases where the waiter isn't | 332 // only use NavigateToUntrackedUrl for cases where the waiter isn't |
| 335 // sufficient. | 333 // sufficient. |
| 336 void NavigateToUntrackedUrl() { | 334 void NavigateToUntrackedUrl() { |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 | 1133 |
| 1136 NavigateToUntrackedUrl(); | 1134 NavigateToUntrackedUrl(); |
| 1137 | 1135 |
| 1138 histogram_tester_.ExpectUniqueSample(internal::kHistogramTotalBytes, 0, 1); | 1136 histogram_tester_.ExpectUniqueSample(internal::kHistogramTotalBytes, 0, 1); |
| 1139 } | 1137 } |
| 1140 | 1138 |
| 1141 INSTANTIATE_TEST_CASE_P( | 1139 INSTANTIATE_TEST_CASE_P( |
| 1142 /* no prefix */, | 1140 /* no prefix */, |
| 1143 PageLoadMetricsBrowserTest, | 1141 PageLoadMetricsBrowserTest, |
| 1144 testing::Values(IPCType::LEGACY, IPCType::MOJO)); | 1142 testing::Values(IPCType::LEGACY, IPCType::MOJO)); |
| OLD | NEW |