| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 void SetTimingUpdatedAndQuit() { | 140 void SetTimingUpdatedAndQuit() { |
| 141 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 141 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 142 matched_timing_update_ = true; | 142 matched_timing_update_ = true; |
| 143 Quit(); | 143 Quit(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 ~TimingUpdatedObserver() override {} | 146 ~TimingUpdatedObserver() override {} |
| 147 | 147 |
| 148 std::unique_ptr<base::RunLoop> run_loop_; | 148 std::unique_ptr<base::RunLoop> run_loop_; |
| 149 int matching_fields_; // A bitvector composed from ExpectedTimingFields. | 149 int matching_fields_ = 0; // A bitvector composed from ExpectedTimingFields. |
| 150 bool matched_timing_update_ = false; | 150 bool matched_timing_update_ = false; |
| 151 int match_document_write_block_reload_ = 0; | 151 int match_document_write_block_reload_ = 0; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace | 154 } // namespace |
| 155 | 155 |
| 156 class PageLoadMetricsBrowserTest : public InProcessBrowserTest { | 156 class PageLoadMetricsBrowserTest : public InProcessBrowserTest { |
| 157 public: | 157 public: |
| 158 PageLoadMetricsBrowserTest() {} | 158 PageLoadMetricsBrowserTest() {} |
| 159 ~PageLoadMetricsBrowserTest() override {} | 159 ~PageLoadMetricsBrowserTest() override {} |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( | 743 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( |
| 744 "/page_load_metrics/large.html")); | 744 "/page_load_metrics/large.html")); |
| 745 NavigateToUntrackedUrl(); | 745 NavigateToUntrackedUrl(); |
| 746 | 746 |
| 747 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); | 747 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); |
| 748 | 748 |
| 749 // Verify that there is a single sample recorded in the 10kB bucket (the size | 749 // Verify that there is a single sample recorded in the 10kB bucket (the size |
| 750 // of the main HTML response). | 750 // of the main HTML response). |
| 751 histogram_tester_.ExpectBucketCount(internal::kHistogramTotalBytes, 10, 1); | 751 histogram_tester_.ExpectBucketCount(internal::kHistogramTotalBytes, 10, 1); |
| 752 } | 752 } |
| OLD | NEW |