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

Side by Side Diff: content/browser/loader/resource_loader_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/loader/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 NULL /* cookie_store */)); 318 NULL /* cookie_store */));
319 raw_ptr_to_request_ = request.get(); 319 raw_ptr_to_request_ = request.get();
320 ResourceRequestInfo::AllocateForTesting(request.get(), 320 ResourceRequestInfo::AllocateForTesting(request.get(),
321 RESOURCE_TYPE_MAIN_FRAME, 321 RESOURCE_TYPE_MAIN_FRAME,
322 &resource_context_, 322 &resource_context_,
323 kRenderProcessId, 323 kRenderProcessId,
324 kRenderViewId, 324 kRenderViewId,
325 MSG_ROUTING_NONE, 325 MSG_ROUTING_NONE,
326 true, // is_main_frame 326 true, // is_main_frame
327 false, // parent_is_main_frame 327 false, // parent_is_main_frame
328 true, // allow_download
328 false); // is_async 329 false); // is_async
329 scoped_ptr<ResourceHandlerStub> resource_handler( 330 scoped_ptr<ResourceHandlerStub> resource_handler(
330 new ResourceHandlerStub(request.get())); 331 new ResourceHandlerStub(request.get()));
331 raw_ptr_resource_handler_ = resource_handler.get(); 332 raw_ptr_resource_handler_ = resource_handler.get();
332 loader_.reset(new ResourceLoader( 333 loader_.reset(new ResourceLoader(
333 request.Pass(), 334 request.Pass(),
334 WrapResourceHandler(resource_handler.Pass(), raw_ptr_to_request_), 335 WrapResourceHandler(resource_handler.Pass(), raw_ptr_to_request_),
335 this)); 336 this));
336 } 337 }
337 338
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); 721 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents));
721 EXPECT_EQ(test_data(), contents); 722 EXPECT_EQ(test_data(), contents);
722 723
723 // Release the loader. The file should be gone now. 724 // Release the loader. The file should be gone now.
724 ReleaseLoader(); 725 ReleaseLoader();
725 base::RunLoop().RunUntilIdle(); 726 base::RunLoop().RunUntilIdle();
726 EXPECT_FALSE(base::PathExists(temp_path())); 727 EXPECT_FALSE(base::PathExists(temp_path()));
727 } 728 }
728 729
729 } // namespace content 730 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.h ('k') | content/browser/loader/resource_request_info_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698