| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 std::string test_data() const { | 299 std::string test_data() const { |
| 300 return net::URLRequestTestJob::test_data_1(); | 300 return net::URLRequestTestJob::test_data_1(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 virtual scoped_ptr<ResourceHandler> WrapResourceHandler( | 303 virtual scoped_ptr<ResourceHandler> WrapResourceHandler( |
| 304 scoped_ptr<ResourceHandlerStub> leaf_handler, | 304 scoped_ptr<ResourceHandlerStub> leaf_handler, |
| 305 net::URLRequest* request) { | 305 net::URLRequest* request) { |
| 306 return leaf_handler.Pass(); | 306 return leaf_handler.Pass(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 virtual void SetUp() override { | 309 void SetUp() override { |
| 310 const int kRenderProcessId = 1; | 310 const int kRenderProcessId = 1; |
| 311 const int kRenderViewId = 2; | 311 const int kRenderViewId = 2; |
| 312 | 312 |
| 313 scoped_ptr<net::URLRequest> request( | 313 scoped_ptr<net::URLRequest> request( |
| 314 resource_context_.GetRequestContext()->CreateRequest( | 314 resource_context_.GetRequestContext()->CreateRequest( |
| 315 test_url(), | 315 test_url(), |
| 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(); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); | 718 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); |
| 719 EXPECT_EQ(test_data(), contents); | 719 EXPECT_EQ(test_data(), contents); |
| 720 | 720 |
| 721 // Release the loader. The file should be gone now. | 721 // Release the loader. The file should be gone now. |
| 722 ReleaseLoader(); | 722 ReleaseLoader(); |
| 723 base::RunLoop().RunUntilIdle(); | 723 base::RunLoop().RunUntilIdle(); |
| 724 EXPECT_FALSE(base::PathExists(temp_path())); | 724 EXPECT_FALSE(base::PathExists(temp_path())); |
| 725 } | 725 } |
| 726 | 726 |
| 727 } // namespace content | 727 } // namespace content |
| OLD | NEW |