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

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

Issue 958083002: PlzNavigate: Show error pages when the navigation failed before commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@support-data-urls
Patch Set: Added a browsertest Created 5 years, 8 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
Index: content/public/test/test_navigation_observer.cc
diff --git a/content/public/test/test_navigation_observer.cc b/content/public/test/test_navigation_observer.cc
index 7c2d0281a59b552e57522f317a001b445940ca53..5e16f35ea087a97391f139e2b3a733d6d1fc2f4d 100644
--- a/content/public/test/test_navigation_observer.cc
+++ b/content/public/test/test_navigation_observer.cc
@@ -76,31 +76,29 @@ class TestNavigationObserver::TestWebContentsObserver
DISALLOW_COPY_AND_ASSIGN(TestWebContentsObserver);
};
-TestNavigationObserver::TestNavigationObserver(
- WebContents* web_contents,
- int number_of_navigations)
+TestNavigationObserver::TestNavigationObserver(WebContents* web_contents,
+ int number_of_navigations)
: navigation_started_(false),
navigations_completed_(0),
number_of_navigations_(number_of_navigations),
+ navigations_failed_(0),
message_loop_runner_(new MessageLoopRunner),
web_contents_created_callback_(
- base::Bind(
- &TestNavigationObserver::OnWebContentsCreated,
- base::Unretained(this))) {
+ base::Bind(&TestNavigationObserver::OnWebContentsCreated,
+ base::Unretained(this))) {
if (web_contents)
RegisterAsObserver(web_contents);
}
-TestNavigationObserver::TestNavigationObserver(
- WebContents* web_contents)
+TestNavigationObserver::TestNavigationObserver(WebContents* web_contents)
: navigation_started_(false),
navigations_completed_(0),
number_of_navigations_(1),
+ navigations_failed_(0),
message_loop_runner_(new MessageLoopRunner),
web_contents_created_callback_(
- base::Bind(
- &TestNavigationObserver::OnWebContentsCreated,
- base::Unretained(this))) {
+ base::Bind(&TestNavigationObserver::OnWebContentsCreated,
+ base::Unretained(this))) {
if (web_contents)
RegisterAsObserver(web_contents);
}
@@ -186,6 +184,7 @@ void TestNavigationObserver::OnDidFailProvisionalLoad(
const base::string16& error_description) {
last_navigation_url_ = validated_url;
last_navigation_succeeded_ = false;
+ ++navigations_failed_;
}
void TestNavigationObserver::OnDidCommitProvisionalLoadForFrame(

Powered by Google App Engine
This is Rietveld 408576698