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

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

Issue 2776713002: Prerender: clarify prerender origin for purposes of FCP histograms. (Closed)
Patch Set: Created 3 years, 9 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
Index: chrome/browser/prerender/prerender_browsertest.cc
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc
index ec6f6eadce82fa9b555f3d597d5a2243197127d2..1e7cc48751bd963075c1c3a498ffb647ae7268d2 100644
--- a/chrome/browser/prerender/prerender_browsertest.cc
+++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -3454,22 +3454,18 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PopulateRequiredTimingFields(&timing);
observer.OnFirstContentfulPaint(timing, GenericPageLoadExtraInfo(dest_url()));
+ // The prerender start will be classified as websame, but the FCP will seen
+ // but not recored (PerceivedTTFCPRecorded = 0) because the prerender was not
+ // swapped in. Nothing should be recorded under ORIGIN_NONE because the
+ // prefetch entry should be created.
histogram_tester().ExpectTotalCount(
"Prerender.none_PrefetchTTFCP.Warm.Cacheable.Visible", 0);
histogram_tester().ExpectTotalCount(
- "Prerender.none_PerceivedTTFCPRecorded.Visible", 1);
-
- // Check that the prerender didn't happen with a defined origin.
- histogram_tester().ExpectTotalCount(
"Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Visible", 0);
histogram_tester().ExpectTotalCount(
- "Prerender.websame_PerceivedTTFCPRecorded.Visible", 0);
-
- // A FCP is fired by the observer, but as a swap did not occur the perceived
- // time cannot be calculated, and an unrecorded perceived FCP time histogram
- // entry is made.
+ "Prerender.none_PerceivedTTFCPRecorded.Visible", 0);
histogram_tester().ExpectUniqueSample(
- "Prerender.none_PerceivedTTFCPRecorded.Visible", 0, 1);
+ "Prerender.websame_PerceivedTTFCPRecorded.Visible", 0, 1);
}
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
@@ -3578,21 +3574,18 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PopulateRequiredTimingFields(&timing);
observer.OnFirstContentfulPaint(timing, GenericPageLoadExtraInfo(dest_url()));
+ // The prerender start will be classified as websame, but the FCP will seen
+ // but not recored (PerceivedTTFCPRecorded = 0) because the prerender was not
+ // swapped in. Nothing should be recorded under ORIGIN_NONE because the
+ // prefetch entry should be created.
histogram_tester().ExpectTotalCount(
"Prerender.none_PrefetchTTFCP.Warm.Cacheable.Hidden", 0);
histogram_tester().ExpectTotalCount(
- "Prerender.none_PerceivedTTFCPRecorded.Hidden", 1);
-
- // Check that the prerender didn't happen with a defined origin.
- histogram_tester().ExpectTotalCount(
"Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Hidden", 0);
histogram_tester().ExpectTotalCount(
- "Prerender.websame_PerceivedTTFCPRecorded.Hidden", 0);
-
- // A FCP is fired by the observer, but the manager should detect that the
- // perceived time is not set and so update the following histogram.
+ "Prerender.none_PerceivedTTFCPRecorded.Hidden", 0);
histogram_tester().ExpectUniqueSample(
- "Prerender.none_PerceivedTTFCPRecorded.Hidden", 0, 1);
+ "Prerender.websame_PerceivedTTFCPRecorded.Hidden", 0, 1);
}
// When instantiated, mocks out the global text-to-speech engine with something
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_manager.cc » ('j') | chrome/browser/prerender/prerender_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698