Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Unified Diff: chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc

Issue 2512953002: Prerender: Add FCP histograms to nostate browsertests. (Closed)
Patch Set: rebase Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
diff --git a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
index 6c1d72ff9bc201bdcb292665c6110df47712c3d7..a14ad92b52bd494d7856eab917ba6c61e43d3f8b 100644
--- a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
+++ b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
@@ -154,6 +154,28 @@ IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchLoadFlag) {
test_prerender->WaitForLoads(0);
}
+// Check that a prefetch followed by a load produces the approriate
+// histograms. Note that other histogram testing is done in
+// browser/page_load_metrics, in particular, testing the combinations of
+// Warm/Cold and Cacheable/NoCacheable.
+IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchHistograms) {
+ PrefetchFromFile(kPrefetchPage, FINAL_STATUS_NOSTATE_PREFETCH_FINISHED);
+ histogram_tester().ExpectTotalCount(
+ "Prerender.websame_NoStatePrefetchTTFCP.Warm", 0);
+
+ test_utils::FirstContentfulPaintManagerWaiter* fcp_waiter =
+ test_utils::FirstContentfulPaintManagerWaiter::Create(
+ GetPrerenderManager());
+ ui_test_utils::NavigateToURL(
+ current_browser(), src_server()->GetURL(MakeAbsolute(kPrefetchPage)));
+ fcp_waiter->Wait();
+
+ histogram_tester().ExpectTotalCount(
+ "Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Visible", 1);
+ histogram_tester().ExpectTotalCount(
+ "Prerender.websame_NoStatePrefetchResponseTypes", 2);
+}
+
// Checks the prefetch of an img tag.
IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchImage) {
RequestCounter image_counter;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698