| 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/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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 net::DEFAULT_PRIORITY, | 316 net::DEFAULT_PRIORITY, |
| 317 NULL /* delegate */, | 317 NULL /* delegate */, |
| 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, |
| 326 false); | 327 false); |
| 327 scoped_ptr<ResourceHandlerStub> resource_handler( | 328 scoped_ptr<ResourceHandlerStub> resource_handler( |
| 328 new ResourceHandlerStub(request.get())); | 329 new ResourceHandlerStub(request.get())); |
| 329 raw_ptr_resource_handler_ = resource_handler.get(); | 330 raw_ptr_resource_handler_ = resource_handler.get(); |
| 330 loader_.reset(new ResourceLoader( | 331 loader_.reset(new ResourceLoader( |
| 331 request.Pass(), | 332 request.Pass(), |
| 332 WrapResourceHandler(resource_handler.Pass(), raw_ptr_to_request_), | 333 WrapResourceHandler(resource_handler.Pass(), raw_ptr_to_request_), |
| 333 this)); | 334 this)); |
| 334 } | 335 } |
| 335 | 336 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); | 719 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); |
| 719 EXPECT_EQ(test_data(), contents); | 720 EXPECT_EQ(test_data(), contents); |
| 720 | 721 |
| 721 // Release the loader. The file should be gone now. | 722 // Release the loader. The file should be gone now. |
| 722 ReleaseLoader(); | 723 ReleaseLoader(); |
| 723 base::RunLoop().RunUntilIdle(); | 724 base::RunLoop().RunUntilIdle(); |
| 724 EXPECT_FALSE(base::PathExists(temp_path())); | 725 EXPECT_FALSE(base::PathExists(temp_path())); |
| 725 } | 726 } |
| 726 | 727 |
| 727 } // namespace content | 728 } // namespace content |
| OLD | NEW |