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

Unified Diff: chrome/browser/prerender/prerender_test_utils.h

Issue 2423383002: [Prerender] first contentful paint histograms. (Closed)
Patch Set: MSVC compilation error 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 | « chrome/browser/prerender/prerender_tab_helper.cc ('k') | chrome/browser/prerender/prerender_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_test_utils.h
diff --git a/chrome/browser/prerender/prerender_test_utils.h b/chrome/browser/prerender/prerender_test_utils.h
index dac536759737441a66807d202e570dbf7160fe08..615a4f72b36aecb3d5cdf0b5022b77a62244fef4 100644
--- a/chrome/browser/prerender/prerender_test_utils.h
+++ b/chrome/browser/prerender/prerender_test_utils.h
@@ -237,6 +237,29 @@ class DestructionWaiter {
DISALLOW_COPY_AND_ASSIGN(DestructionWaiter);
};
+// Wait until a PrerenderManager has seen a first contentful paint.
+class FirstContentfulPaintManagerWaiter : public PrerenderManagerObserver {
+ public:
+ // Create and return a pointer to a |FirstContentfulPaintManagerWaiter|. The
+ // instance is owned by the |PrerenderManager|.
+ static FirstContentfulPaintManagerWaiter* Create(PrerenderManager* manager);
+
+ ~FirstContentfulPaintManagerWaiter() override;
+
+ void OnFirstContentfulPaint() override;
+
+ // Wait for a first contentful paint to be seen by our PrerenderManager.
+ void Wait();
+
+ private:
+ FirstContentfulPaintManagerWaiter();
+
+ std::unique_ptr<base::RunLoop> waiter_;
+ bool saw_fcp_;
+
+ DISALLOW_COPY_AND_ASSIGN(FirstContentfulPaintManagerWaiter);
+};
+
// PrerenderContentsFactory that uses TestPrerenderContents.
class TestPrerenderContentsFactory : public PrerenderContents::Factory {
public:
« no previous file with comments | « chrome/browser/prerender/prerender_tab_helper.cc ('k') | chrome/browser/prerender/prerender_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698