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

Unified Diff: chrome/test/base/in_process_browser_test_browsertest.cc

Issue 2349893002: Change LoadFailObserver to use WebContentsObserver::DidFinishNavigation notification. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/in_process_browser_test_browsertest.cc
diff --git a/chrome/test/base/in_process_browser_test_browsertest.cc b/chrome/test/base/in_process_browser_test_browsertest.cc
index c0cb53fefb7a3bb1f2394f6d0a5b9afc76b50bef..22953ce9dade2ffb78d3bdfd66fd90ff02d407e6 100644
--- a/chrome/test/base/in_process_browser_test_browsertest.cc
+++ b/chrome/test/base/in_process_browser_test_browsertest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
@@ -43,15 +44,14 @@ class LoadFailObserver : public content::WebContentsObserver {
failed_load_(false),
error_code_(net::OK) { }
- void DidFailProvisionalLoad(
- content::RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- int error_code,
- const base::string16& error_description,
- bool was_ignored_by_handler) override {
+ void DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) override {
+ if (navigation_handle->GetNetErrorCode() == net::OK)
+ return;
+
failed_load_ = true;
- error_code_ = static_cast<net::Error>(error_code);
- validated_url_ = validated_url;
+ error_code_ = navigation_handle->GetNetErrorCode();
+ validated_url_ = navigation_handle->GetURL();
}
bool failed_load() const { return failed_load_; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698