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

Unified Diff: content/public/test/test_navigation_observer.h

Issue 436603002: Enable Screen Orientation integration tests for Chrome OS and Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reduce_flakiness
Patch Set: fix android Created 6 years, 5 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 | « content/public/test/browser_test_base.cc ('k') | content/public/test/test_navigation_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_navigation_observer.h
diff --git a/content/public/test/test_navigation_observer.h b/content/public/test/test_navigation_observer.h
index 438af744eb56c076d561664818243aa4be4aabe8..03b3da3ac3b0cd9e395402569e92918d16e415e6 100644
--- a/content/public/test/test_navigation_observer.h
+++ b/content/public/test/test_navigation_observer.h
@@ -20,9 +20,18 @@ struct LoadCommittedDetails;
// MessageLoop and quit when the navigation completes loading.
class TestNavigationObserver {
public:
+ enum FirstPaint {
+ FirstPaintRequired,
+ FirstPaintNotRequired
+ };
+
// Create and register a new TestNavigationObserver against the
// |web_contents|.
TestNavigationObserver(WebContents* web_contents,
+ int number_of_navigations,
+ FirstPaint first_paint);
+ // Like above but doesn't wait for the first paint after the navigations.
+ TestNavigationObserver(WebContents* web_contents,
int number_of_navigations);
// Like above but waits for one navigation.
explicit TestNavigationObserver(WebContents* web_contents);
@@ -33,6 +42,8 @@ class TestNavigationObserver {
// navigations are complete.
void Wait();
+ // Runs a nested message loop and blocks until the expected
+
// Start/stop watching newly created WebContents.
void StartWatchingNewWebContents();
void StopWatchingNewWebContents();
@@ -55,6 +66,7 @@ class TestNavigationObserver {
void OnDidAttachInterstitialPage(WebContents* web_contents);
void OnDidStartLoading(WebContents* web_contents);
void OnDidStopLoading(WebContents* web_contents);
+ void OnDidFirstVisuallyNonEmptyPaint(WebContents* web_contents);
// If true the navigation has started.
bool navigation_started_;
@@ -65,6 +77,9 @@ class TestNavigationObserver {
// The number of navigations to wait for.
int number_of_navigations_;
+ // Whether we want to wait for first paint after navigations.
+ FirstPaint first_paint_;
+
// The MessageLoopRunner used to spin the message loop.
scoped_refptr<MessageLoopRunner> message_loop_runner_;
« no previous file with comments | « content/public/test/browser_test_base.cc ('k') | content/public/test/test_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698