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

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

Issue 2423383002: [Prerender] first contentful paint histograms. (Closed)
Patch Set: comments Created 4 years, 1 month 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_test_utils.h
diff --git a/chrome/browser/prerender/prerender_test_utils.h b/chrome/browser/prerender/prerender_test_utils.h
index d7f4af8de292a2d9585e96eb596dcaeefde913c7..245a66bc65f05397bdf1cd26c7ff39285005f922 100644
--- a/chrome/browser/prerender/prerender_test_utils.h
+++ b/chrome/browser/prerender/prerender_test_utils.h
@@ -242,6 +242,26 @@ 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();
+
+ 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_;
+};
+
// PrerenderContentsFactory that uses TestPrerenderContents.
class TestPrerenderContentsFactory : public PrerenderContents::Factory {
public:

Powered by Google App Engine
This is Rietveld 408576698