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

Unified Diff: content/test/content_browser_test_utils_internal.cc

Issue 715203004: PlzNavigate: Add a browser test for basic navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a browser test for renderer initiated navigations Created 6 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: content/test/content_browser_test_utils_internal.cc
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc
index 21a33d0fee3e8f73c587ca9e5cf34a5675526d1c..00cb0bf52f2b10e1160ad5895805acde44d8ec51 100644
--- a/content/test/content_browser_test_utils_internal.cc
+++ b/content/test/content_browser_test_utils_internal.cc
@@ -11,6 +11,39 @@
namespace content {
+TestNavigationWebContentsObserver::TestNavigationWebContentsObserver(
+ WebContents* web_contents)
+ : WebContentsObserver(web_contents), navigation_succeeded_(false) {
+}
+
+TestNavigationWebContentsObserver::~TestNavigationWebContentsObserver() {
+}
+
+void TestNavigationWebContentsObserver::DidStartProvisionalLoadForFrame(
+ RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ bool is_error_page,
+ bool is_iframe_srcdoc) {
+ navigation_succeeded_ = false;
+}
+
+void TestNavigationWebContentsObserver::DidFailProvisionalLoad(
+ RenderFrameHost* render_frame_host,
+ const GURL& validated_url,
+ int error_code,
+ const base::string16& error_description) {
+ navigation_url_ = validated_url;
+ navigation_succeeded_ = false;
+}
+
+void TestNavigationWebContentsObserver::DidCommitProvisionalLoadForFrame(
+ RenderFrameHost* render_frame_host,
+ const GURL& url,
+ ui::PageTransition transition_type) {
+ navigation_url_ = url;
+ navigation_succeeded_ = true;
+}
+
void NavigateFrameToURL(FrameTreeNode* node, const GURL& url) {
TestFrameNavigationObserver observer(node);
NavigationController::LoadURLParams params(url);

Powered by Google App Engine
This is Rietveld 408576698