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

Side by Side Diff: components/navigation_interception/intercept_navigation_resource_throttle_unittest.cc

Issue 694773003: Allow URL requests for object/embed tags to be intercepted as streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-guest-view-container-3
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "components/navigation_interception/intercept_navigation_resource_throt tle.h" 10 #include "components/navigation_interception/intercept_navigation_resource_throt tle.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 render_frame_id != MSG_ROUTING_NONE) { 124 render_frame_id != MSG_ROUTING_NONE) {
125 content::ResourceRequestInfo::AllocateForTesting( 125 content::ResourceRequestInfo::AllocateForTesting(
126 request_.get(), 126 request_.get(),
127 content::RESOURCE_TYPE_MAIN_FRAME, 127 content::RESOURCE_TYPE_MAIN_FRAME,
128 &resource_context_, 128 &resource_context_,
129 render_process_id, 129 render_process_id,
130 MSG_ROUTING_NONE, 130 MSG_ROUTING_NONE,
131 render_frame_id, 131 render_frame_id,
132 true, // is_main_frame 132 true, // is_main_frame
133 false, // parent_is_main_frame 133 false, // parent_is_main_frame
134 true, // allow_download
134 false); // is_async 135 false); // is_async
135 } 136 }
136 throttle_.reset(new InterceptNavigationResourceThrottle( 137 throttle_.reset(new InterceptNavigationResourceThrottle(
137 request_.get(), 138 request_.get(),
138 base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, 139 base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation,
139 base::Unretained(callback_receiver)))); 140 base::Unretained(callback_receiver))));
140 throttle_->set_controller_for_testing(&throttle_controller_); 141 throttle_->set_controller_for_testing(&throttle_controller_);
141 request_->set_method(request_method); 142 request_->set_method(request_method);
142 143
143 if (redirect_mode == REDIRECT_MODE_302) { 144 if (redirect_mode == REDIRECT_MODE_302) {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 REDIRECT_MODE_302, 466 REDIRECT_MODE_302,
466 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), 467 web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
467 web_contents()->GetMainFrame()->GetRoutingID(), 468 web_contents()->GetMainFrame()->GetRoutingID(),
468 base::Unretained(&defer))); 469 base::Unretained(&defer)));
469 470
470 // Wait for the request to finish processing. 471 // Wait for the request to finish processing.
471 base::RunLoop().RunUntilIdle(); 472 base::RunLoop().RunUntilIdle();
472 } 473 }
473 474
474 } // namespace navigation_interception 475 } // namespace navigation_interception
OLDNEW
« no previous file with comments | « chrome/browser/search/iframe_source_unittest.cc ('k') | content/browser/loader/buffered_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698