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

Unified Diff: content/test/test_render_frame_host.cc

Issue 2698393002: Allow asynchronous deferral in NavigationSimulator (Closed)
Patch Set: Just return the throttle check on Start/Redirect/COmmit Created 3 years, 10 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/test/test_render_frame_host.cc
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index 6558a129032199dc9ab0101ae138eb3b566d3fea..6ae61c7aa62963d61d74907eb94122c02cd824ad 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -34,6 +34,15 @@
namespace content {
+namespace {
+
+void CallbackRunner(const base::Closure& closure,
+ NavigationThrottle::ThrottleCheckResult result) {
+ closure.Run();
+}
+
+} // namesapce
+
TestRenderFrameHostCreationObserver::TestRenderFrameHostCreationObserver(
WebContents* web_contents)
: WebContentsObserver(web_contents), last_created_frame_(NULL) {
@@ -122,8 +131,8 @@ void TestRenderFrameHost::SimulateRedirect(const GURL& new_url) {
NavigationRequest* request = frame_tree_node_->navigation_request();
if (!request->loader_for_testing()) {
base::RunLoop loop;
- request->set_on_start_checks_complete_closure_for_testing(
- loop.QuitClosure());
+ request->set_on_checks_complete_callback_for_testing(
+ base::Bind(&CallbackRunner, loop.QuitClosure()));
loop.Run();
}
TestNavigationURLLoader* url_loader =
@@ -194,8 +203,8 @@ void TestRenderFrameHost::SimulateNavigationError(const GURL& url,
}
if (!request->loader_for_testing()) {
base::RunLoop loop;
- request->set_on_start_checks_complete_closure_for_testing(
- loop.QuitClosure());
+ request->set_on_checks_complete_callback_for_testing(
+ base::Bind(&CallbackRunner, loop.QuitClosure()));
loop.Run();
}
TestNavigationURLLoader* url_loader =
@@ -478,8 +487,8 @@ void TestRenderFrameHost::PrepareForCommitWithServerRedirect(
if (!request->loader_for_testing()) {
base::RunLoop loop;
- request->set_on_start_checks_complete_closure_for_testing(
- loop.QuitClosure());
+ request->set_on_checks_complete_callback_for_testing(
+ base::Bind(&CallbackRunner, loop.QuitClosure()));
loop.Run();
}
« content/public/test/navigation_simulator.cc ('K') | « content/test/navigation_simulator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698