| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/test/histogram_tester.h" | 6 #include "base/test/histogram_tester.h" |
| 7 #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_obse
rver.h" | 7 #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_obse
rver.h" |
| 8 #include "chrome/browser/page_load_metrics/observers/document_write_page_load_me
trics_observer.h" | 8 #include "chrome/browser/page_load_metrics/observers/document_write_page_load_me
trics_observer.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 browser(), embedded_test_server()->GetURL( | 129 browser(), embedded_test_server()->GetURL( |
| 130 "/page_load_metrics/document_write_script_block.html")); | 130 "/page_load_metrics/document_write_script_block.html")); |
| 131 | 131 |
| 132 ui_test_utils::NavigateToURL( | 132 ui_test_utils::NavigateToURL( |
| 133 browser(), embedded_test_server()->GetURL( | 133 browser(), embedded_test_server()->GetURL( |
| 134 "/page_load_metrics/document_write_script_block.html")); | 134 "/page_load_metrics/document_write_script_block.html")); |
| 135 | 135 |
| 136 histogram_tester_.ExpectTotalCount( | 136 histogram_tester_.ExpectTotalCount( |
| 137 internal::kHistogramDocWriteBlockParseStartToFirstContentfulPaint, 1); | 137 internal::kHistogramDocWriteBlockParseStartToFirstContentfulPaint, 1); |
| 138 | 138 |
| 139 histogram_tester_.ExpectTotalCount( | |
| 140 internal::kHistogramDocWriteBlockReloadCount, 1); | |
| 141 | |
| 142 ui_test_utils::NavigateToURL(browser(), | 139 ui_test_utils::NavigateToURL(browser(), |
| 143 embedded_test_server()->GetURL("/title2.html")); | 140 embedded_test_server()->GetURL("/title2.html")); |
| 144 | 141 |
| 145 histogram_tester_.ExpectTotalCount( | 142 histogram_tester_.ExpectTotalCount( |
| 146 internal::kHistogramDocWriteBlockParseStartToFirstContentfulPaint, 1); | 143 internal::kHistogramDocWriteBlockParseStartToFirstContentfulPaint, 1); |
| 147 | 144 |
| 148 histogram_tester_.ExpectTotalCount( | 145 histogram_tester_.ExpectTotalCount( |
| 149 internal::kHistogramDocWriteBlockReloadCount, 2); | 146 internal::kHistogramDocWriteBlockReloadCount, 2); |
| 150 } | 147 } |
| 151 | 148 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 180 |
| 184 ui_test_utils::NavigateToURL( | 181 ui_test_utils::NavigateToURL( |
| 185 browser(), embedded_test_server()->GetURL( | 182 browser(), embedded_test_server()->GetURL( |
| 186 "/page_load_metrics/document_write_no_script.html")); | 183 "/page_load_metrics/document_write_no_script.html")); |
| 187 ui_test_utils::NavigateToURL(browser(), | 184 ui_test_utils::NavigateToURL(browser(), |
| 188 embedded_test_server()->GetURL("/title2.html")); | 185 embedded_test_server()->GetURL("/title2.html")); |
| 189 | 186 |
| 190 histogram_tester_.ExpectTotalCount( | 187 histogram_tester_.ExpectTotalCount( |
| 191 internal::kHistogramDocWriteBlockParseStartToFirstContentfulPaint, 0); | 188 internal::kHistogramDocWriteBlockParseStartToFirstContentfulPaint, 0); |
| 192 } | 189 } |
| OLD | NEW |