| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <deque> | 6 #include <deque> |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 GetPrerenderManager()); | 1076 GetPrerenderManager()); |
| 1077 ui_test_utils::NavigateToURL( | 1077 ui_test_utils::NavigateToURL( |
| 1078 current_browser(), src_server()->GetURL("/prerender/prefetch_page.html")); | 1078 current_browser(), src_server()->GetURL("/prerender/prefetch_page.html")); |
| 1079 simple_fcp_waiter->Wait(); | 1079 simple_fcp_waiter->Wait(); |
| 1080 | 1080 |
| 1081 histogram_tester().ExpectTotalCount( | 1081 histogram_tester().ExpectTotalCount( |
| 1082 "Prerender.none_PrefetchTTFCP.Reference.Cacheable.Visible", 1); | 1082 "Prerender.none_PrefetchTTFCP.Reference.Cacheable.Visible", 1); |
| 1083 histogram_tester().ExpectTotalCount( | 1083 histogram_tester().ExpectTotalCount( |
| 1084 "PageLoad.DocumentTiming.NavigationToFirstLayout", 1); | 1084 "PageLoad.DocumentTiming.NavigationToFirstLayout", 1); |
| 1085 histogram_tester().ExpectTotalCount( | 1085 histogram_tester().ExpectTotalCount( |
| 1086 "PageLoad.PaintTiming.NavigationToFirstContentfulPaint", 1); | 1086 "PageLoad.ParseTiming.NavigationToParseStart", 1); |
| 1087 | 1087 |
| 1088 // Histogram only emitted during a prerender, which should not happen here. | 1088 // Histogram only emitted during a prerender, which should not happen here. |
| 1089 histogram_tester().ExpectTotalCount( | 1089 histogram_tester().ExpectTotalCount( |
| 1090 "Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Visible", 0); | 1090 "Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Visible", 0); |
| 1091 } | 1091 } |
| 1092 | 1092 |
| 1093 // Checks that the correct page load metrics observers are produced with a | 1093 // Checks that the correct page load metrics observers are produced with a |
| 1094 // prerender. | 1094 // prerender. |
| 1095 // TODO(https://crbug.com/678976) Fails on ChromeOS and Linux. | 1095 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PageLoadMetricsPrerender) { |
| 1096 #if defined(OS_CHROMEOS) || defined(OS_LINUX) | |
| 1097 #define MAYBE_PageLoadMetricsPrerender DISABLED_PageLoadMetricsPrerender | |
| 1098 #else | |
| 1099 #define MAYBE_PageLoadMetricsPrerender PageLoadMetricsPrerender | |
| 1100 #endif | |
| 1101 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MAYBE_PageLoadMetricsPrerender) { | |
| 1102 test_utils::FirstContentfulPaintManagerWaiter* prerender_fcp_waiter = | 1096 test_utils::FirstContentfulPaintManagerWaiter* prerender_fcp_waiter = |
| 1103 test_utils::FirstContentfulPaintManagerWaiter::Create( | 1097 test_utils::FirstContentfulPaintManagerWaiter::Create( |
| 1104 GetPrerenderManager()); | 1098 GetPrerenderManager()); |
| 1105 PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1); | 1099 PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1); |
| 1106 NavigateToDestURL(); | 1100 NavigateToDestURL(); |
| 1107 prerender_fcp_waiter->Wait(); | 1101 prerender_fcp_waiter->Wait(); |
| 1108 | 1102 |
| 1109 histogram_tester().ExpectTotalCount( | 1103 histogram_tester().ExpectTotalCount( |
| 1110 "Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Visible", 1); | 1104 "Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Visible", 1); |
| 1111 | 1105 |
| 1112 // Histogram logged during the prefetch_loader.html load, but not during the | 1106 // Histogram logged during the prefetch_loader.html load, but not during the |
| 1113 // prerender. | 1107 // prerender. |
| 1114 histogram_tester().ExpectTotalCount( | 1108 histogram_tester().ExpectTotalCount( |
| 1115 "PageLoad.DocumentTiming.NavigationToFirstLayout", 1); | 1109 "PageLoad.ParseTiming.NavigationToParseStart", 1); |
| 1116 | 1110 |
| 1117 // Histograms only emitted during the simple load which does not happen here | 1111 // Histograms only emitted during the simple load which does not happen here |
| 1118 // (as prefetch_loader.html has an empty body, it does not generate a FCP). | 1112 // (as prefetch_loader.html has an empty body, it does not generate a FCP). |
| 1119 histogram_tester().ExpectTotalCount( | 1113 histogram_tester().ExpectTotalCount( |
| 1120 "Prerender.none_PrefetchTTFCP.Reference.Cacheable.Visible", 0); | 1114 "Prerender.none_PrefetchTTFCP.Reference.Cacheable.Visible", 0); |
| 1121 histogram_tester().ExpectTotalCount( | 1115 histogram_tester().ExpectTotalCount( |
| 1122 "PageLoad.PaintTiming.NavigationToFirstContentfulPaint", 0); | 1116 "PageLoad.PaintTiming.NavigationToFirstContentfulPaint", 0); |
| 1123 } | 1117 } |
| 1124 | 1118 |
| 1125 // Checks that cross-domain prerenders emit the correct histograms. | 1119 // Checks that cross-domain prerenders emit the correct histograms. |
| (...skipping 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3757 browser()->tab_strip_model()->GetActiveWebContents(); | 3751 browser()->tab_strip_model()->GetActiveWebContents(); |
| 3758 bool display_test_result = false; | 3752 bool display_test_result = false; |
| 3759 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, | 3753 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, |
| 3760 "DidDisplayReallyPass()", | 3754 "DidDisplayReallyPass()", |
| 3761 &display_test_result)); | 3755 &display_test_result)); |
| 3762 ASSERT_TRUE(display_test_result); | 3756 ASSERT_TRUE(display_test_result); |
| 3763 } | 3757 } |
| 3764 #endif // !defined(DISABLE_NACL) | 3758 #endif // !defined(DISABLE_NACL) |
| 3765 | 3759 |
| 3766 } // namespace prerender | 3760 } // namespace prerender |
| OLD | NEW |