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

Unified Diff: components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc

Issue 2650653008: Convert Distiller browser test 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
« 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: components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc
diff --git a/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc b/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc
index f79702cd409a77a884776ac4756ee3639ff13a83..2805c3e761acb4aa4b564ca25358cd8f92d685f5 100644
--- a/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc
+++ b/components/dom_distiller/content/browser/distiller_page_web_contents_browsertest.cc
@@ -23,6 +23,7 @@
#include "components/dom_distiller/core/viewer.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/isolated_world_ids.h"
@@ -55,13 +56,11 @@ class WebContentsMainFrameHelper : public content::WebContentsObserver {
callback_(callback),
wait_for_document_loaded_(wait_for_document_loaded) {}
- void DidCommitProvisionalLoadForFrame(
- content::RenderFrameHost* render_frame_host,
- const GURL& url,
- ui::PageTransition transition_type) override {
+ void DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) override {
if (wait_for_document_loaded_)
return;
- if (!render_frame_host->GetParent())
+ if (navigation_handle->HasCommitted() && navigation_handle->IsInMainFrame())
callback_.Run();
}
« 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