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

Unified Diff: content/browser/renderer_host/render_view_host_browsertest.cc

Issue 2660403006: Convert RenderViewHostTest to use the new navigation callbacks. (Closed)
Patch Set: Created 3 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
Index: content/browser/renderer_host/render_view_host_browsertest.cc
diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc
index 6efcbf302d97ffc09f832a7de6db8e62c153f9c7..9d8c9f75879609f6e9c64317f34aa28f4ca9f599 100644
--- a/content/browser/renderer_host/render_view_host_browsertest.cc
+++ b/content/browser/renderer_host/render_view_host_browsertest.cc
@@ -8,6 +8,7 @@
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
@@ -38,10 +39,16 @@ class RenderViewHostTestWebContentsObserver : public WebContentsObserver {
navigation_count_(0) {}
~RenderViewHostTestWebContentsObserver() override {}
- void DidNavigateMainFrame(const LoadCommittedDetails& details,
- const FrameNavigateParams& params) override {
- observed_socket_address_ = params.socket_address;
- base_url_ = params.base_url;
+ void DidFinishNavigation(NavigationHandle* navigation_handle) override {
+ if (!navigation_handle->IsInMainFrame() ||
+ !navigation_handle->HasCommitted()) {
+ return;
+ }
+
+ NavigationHandleImpl* impl =
+ static_cast<NavigationHandleImpl*>(navigation_handle);
+ observed_socket_address_ = navigation_handle->GetSocketAddress();
+ base_url_ = impl->base_url();
++navigation_count_;
}

Powered by Google App Engine
This is Rietveld 408576698