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

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

Issue 868313004: Revert "Revert of PlzNavigate: Add a browser test for basic navigations" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Nasko's comments Created 5 years, 11 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/content_tests.gypi ('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..31a94d63f6d2ea2f9fb35e8fbbcf4099550ccd39 100644
--- a/content/public/test/test_navigation_observer.h
+++ b/content/public/test/test_navigation_observer.h
@@ -11,8 +11,11 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/test/test_utils.h"
+#include "ui/base/page_transition_types.h"
+#include "url/gurl.h"
namespace content {
+class RenderFrameHost;
class WebContents;
struct LoadCommittedDetails;
@@ -37,6 +40,10 @@ class TestNavigationObserver {
void StartWatchingNewWebContents();
void StopWatchingNewWebContents();
+ const GURL& last_navigation_url() const { return last_navigation_url_; }
+
+ int last_navigation_succeeded() const { return last_navigation_succeeded_; }
+
protected:
// Register this TestNavigationObserver as an observer of the |web_contents|.
void RegisterAsObserver(WebContents* web_contents);
@@ -55,6 +62,17 @@ class TestNavigationObserver {
void OnDidAttachInterstitialPage(WebContents* web_contents);
void OnDidStartLoading(WebContents* web_contents);
void OnDidStopLoading(WebContents* web_contents);
+ void OnDidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ bool is_error_page,
+ bool is_iframe_srcdoc);
+ void OnDidFailProvisionalLoad(RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code,
+ const base::string16& error_description);
+ void OnDidCommitProvisionalLoadForFrame(RenderFrameHost* render_frame_host,
+ const GURL& url,
+ ui::PageTransition transition_type);
// If true the navigation has started.
bool navigation_started_;
@@ -65,6 +83,12 @@ class TestNavigationObserver {
// The number of navigations to wait for.
int number_of_navigations_;
+ // The url of the navigation that last committed.
+ GURL last_navigation_url_;
+
+ // True if the last navigation succeeded.
+ bool last_navigation_succeeded_;
+
// The MessageLoopRunner used to spin the message loop.
scoped_refptr<MessageLoopRunner> message_loop_runner_;
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/test/test_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698