| 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/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/test/histogram_tester.h" | 7 #include "base/test/histogram_tester.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" | 9 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" |
| 10 #include "chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_ob
server.h" | 10 #include "chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_ob
server.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 internal::kHistogramParseBlockedOnScriptExecution, 1); | 219 internal::kHistogramParseBlockedOnScriptExecution, 1); |
| 220 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); | 220 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); |
| 221 histogram_tester_.ExpectTotalCount( | 221 histogram_tester_.ExpectTotalCount( |
| 222 internal::kHistogramPageTimingForegroundDuration, 1); | 222 internal::kHistogramPageTimingForegroundDuration, 1); |
| 223 | 223 |
| 224 // Verify that NoPageLoadMetricsRecorded returns false when PageLoad metrics | 224 // Verify that NoPageLoadMetricsRecorded returns false when PageLoad metrics |
| 225 // have been recorded. | 225 // have been recorded. |
| 226 EXPECT_FALSE(NoPageLoadMetricsRecorded()); | 226 EXPECT_FALSE(NoPageLoadMetricsRecorded()); |
| 227 } | 227 } |
| 228 | 228 |
| 229 IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, SamePageNavigation) { | 229 IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, SameDocumentNavigation) { |
| 230 ASSERT_TRUE(embedded_test_server()->Start()); | 230 ASSERT_TRUE(embedded_test_server()->Start()); |
| 231 | 231 |
| 232 ui_test_utils::NavigateToURL(browser(), | 232 ui_test_utils::NavigateToURL(browser(), |
| 233 embedded_test_server()->GetURL("/title1.html")); | 233 embedded_test_server()->GetURL("/title1.html")); |
| 234 ui_test_utils::NavigateToURL( | 234 ui_test_utils::NavigateToURL( |
| 235 browser(), embedded_test_server()->GetURL("/title1.html#hash")); | 235 browser(), embedded_test_server()->GetURL("/title1.html#hash")); |
| 236 NavigateToUntrackedUrl(); | 236 NavigateToUntrackedUrl(); |
| 237 | 237 |
| 238 histogram_tester_.ExpectTotalCount(internal::kHistogramDomContentLoaded, 1); | 238 histogram_tester_.ExpectTotalCount(internal::kHistogramDomContentLoaded, 1); |
| 239 histogram_tester_.ExpectTotalCount(internal::kHistogramLoad, 1); | 239 histogram_tester_.ExpectTotalCount(internal::kHistogramLoad, 1); |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( | 753 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( |
| 754 "/page_load_metrics/large.html")); | 754 "/page_load_metrics/large.html")); |
| 755 NavigateToUntrackedUrl(); | 755 NavigateToUntrackedUrl(); |
| 756 | 756 |
| 757 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); | 757 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); |
| 758 | 758 |
| 759 // Verify that there is a single sample recorded in the 10kB bucket (the size | 759 // Verify that there is a single sample recorded in the 10kB bucket (the size |
| 760 // of the main HTML response). | 760 // of the main HTML response). |
| 761 histogram_tester_.ExpectBucketCount(internal::kHistogramTotalBytes, 10, 1); | 761 histogram_tester_.ExpectBucketCount(internal::kHistogramTotalBytes, 10, 1); |
| 762 } | 762 } |
| OLD | NEW |