| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 metadata.behavior_flags & | 104 metadata.behavior_flags & |
| 105 blink::WebLoadingBehaviorFlag:: | 105 blink::WebLoadingBehaviorFlag:: |
| 106 kWebLoadingBehaviorDocumentWriteBlockReload) { | 106 kWebLoadingBehaviorDocumentWriteBlockReload) { |
| 107 --match_document_write_block_reload_; | 107 --match_document_write_block_reload_; |
| 108 } | 108 } |
| 109 | 109 |
| 110 if (match_document_write_block_reload_ > 0) { | 110 if (match_document_write_block_reload_ > 0) { |
| 111 return true; | 111 return true; |
| 112 } | 112 } |
| 113 | 113 |
| 114 if ((!(matching_fields_ & FIRST_PAINT) || timing.first_paint) && | 114 if ((!(matching_fields_ & FIRST_PAINT) || |
| 115 timing.paint_timing.first_paint) && |
| 115 (!(matching_fields_ & FIRST_CONTENTFUL_PAINT) || | 116 (!(matching_fields_ & FIRST_CONTENTFUL_PAINT) || |
| 116 timing.first_contentful_paint) && | 117 timing.paint_timing.first_contentful_paint) && |
| 117 (!(matching_fields_ & STYLE_UPDATE_BEFORE_FCP) || | 118 (!(matching_fields_ & STYLE_UPDATE_BEFORE_FCP) || |
| 118 timing.style_sheet_timing.update_style_duration_before_fcp)) { | 119 timing.style_sheet_timing.update_style_duration_before_fcp)) { |
| 119 // Ensure that any other handlers of this message, for example the real | 120 // Ensure that any other handlers of this message, for example the real |
| 120 // PageLoadMetric observers, get a chance to handle this message before | 121 // PageLoadMetric observers, get a chance to handle this message before |
| 121 // this waiter unblocks. | 122 // this waiter unblocks. |
| 122 content::BrowserThread::PostTask( | 123 content::BrowserThread::PostTask( |
| 123 content::BrowserThread::IO, FROM_HERE, | 124 content::BrowserThread::IO, FROM_HERE, |
| 124 base::Bind(&TimingUpdatedObserver::BounceTimingUpdate, this, timing, | 125 base::Bind(&TimingUpdatedObserver::BounceTimingUpdate, this, timing, |
| 125 metadata)); | 126 metadata)); |
| 126 } | 127 } |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( | 769 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL( |
| 769 "/page_load_metrics/large.html")); | 770 "/page_load_metrics/large.html")); |
| 770 NavigateToUntrackedUrl(); | 771 NavigateToUntrackedUrl(); |
| 771 | 772 |
| 772 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); | 773 histogram_tester_.ExpectTotalCount(internal::kHistogramTotalBytes, 1); |
| 773 | 774 |
| 774 // Verify that there is a single sample recorded in the 10kB bucket (the size | 775 // Verify that there is a single sample recorded in the 10kB bucket (the size |
| 775 // of the main HTML response). | 776 // of the main HTML response). |
| 776 histogram_tester_.ExpectBucketCount(internal::kHistogramTotalBytes, 10, 1); | 777 histogram_tester_.ExpectBucketCount(internal::kHistogramTotalBytes, 10, 1); |
| 777 } | 778 } |
| OLD | NEW |