OLD | NEW |
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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file.h" | 8 #include "base/files/file.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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 const int kRenderProcessId = 1; | 312 const int kRenderProcessId = 1; |
313 const int kRenderViewId = 2; | 313 const int kRenderViewId = 2; |
314 | 314 |
315 scoped_ptr<net::URLRequest> request( | 315 scoped_ptr<net::URLRequest> request( |
316 new net::URLRequest(test_url(), | 316 new net::URLRequest(test_url(), |
317 net::DEFAULT_PRIORITY, | 317 net::DEFAULT_PRIORITY, |
318 NULL, | 318 NULL, |
319 resource_context_.GetRequestContext())); | 319 resource_context_.GetRequestContext())); |
320 raw_ptr_to_request_ = request.get(); | 320 raw_ptr_to_request_ = request.get(); |
321 ResourceRequestInfo::AllocateForTesting(request.get(), | 321 ResourceRequestInfo::AllocateForTesting(request.get(), |
322 ResourceType::MAIN_FRAME, | 322 RESOURCE_TYPE_MAIN_FRAME, |
323 &resource_context_, | 323 &resource_context_, |
324 kRenderProcessId, | 324 kRenderProcessId, |
325 kRenderViewId, | 325 kRenderViewId, |
326 MSG_ROUTING_NONE, | 326 MSG_ROUTING_NONE, |
327 false); | 327 false); |
328 scoped_ptr<ResourceHandlerStub> resource_handler( | 328 scoped_ptr<ResourceHandlerStub> resource_handler( |
329 new ResourceHandlerStub(request.get())); | 329 new ResourceHandlerStub(request.get())); |
330 raw_ptr_resource_handler_ = resource_handler.get(); | 330 raw_ptr_resource_handler_ = resource_handler.get(); |
331 loader_.reset(new ResourceLoader( | 331 loader_.reset(new ResourceLoader( |
332 request.Pass(), | 332 request.Pass(), |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); | 721 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); |
722 EXPECT_EQ(test_data(), contents); | 722 EXPECT_EQ(test_data(), contents); |
723 | 723 |
724 // Release the loader. The file should be gone now. | 724 // Release the loader. The file should be gone now. |
725 ReleaseLoader(); | 725 ReleaseLoader(); |
726 base::RunLoop().RunUntilIdle(); | 726 base::RunLoop().RunUntilIdle(); |
727 EXPECT_FALSE(base::PathExists(temp_path())); | 727 EXPECT_FALSE(base::PathExists(temp_path())); |
728 } | 728 } |
729 | 729 |
730 } // namespace content | 730 } // namespace content |
OLD | NEW |