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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 135 virtual bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
136 ResourceResponse* response, | 136 ResourceResponse* response, |
137 bool* defer) OVERRIDE { | 137 bool* defer) OVERRIDE { |
138 NOTREACHED(); | 138 NOTREACHED(); |
139 return true; | 139 return true; |
140 } | 140 } |
141 | 141 |
142 virtual bool OnResponseStarted(ResourceResponse* response, | 142 virtual bool OnResponseStarted(ResourceResponse* response, |
143 bool* defer) OVERRIDE { | 143 bool* defer) OVERRIDE { |
144 EXPECT_FALSE(response_); | 144 EXPECT_FALSE(response_.get()); |
145 response_ = response; | 145 response_ = response; |
146 return true; | 146 return true; |
147 } | 147 } |
148 | 148 |
149 virtual bool OnWillStart(const GURL& url, bool* defer) OVERRIDE { | 149 virtual bool OnWillStart(const GURL& url, bool* defer) OVERRIDE { |
150 EXPECT_TRUE(start_url_.is_empty()); | 150 EXPECT_TRUE(start_url_.is_empty()); |
151 start_url_ = url; | 151 start_url_ = url; |
152 *defer = defer_request_on_will_start_; | 152 *defer = defer_request_on_will_start_; |
153 return true; | 153 return true; |
154 } | 154 } |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); | 722 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); |
723 EXPECT_EQ(test_data(), contents); | 723 EXPECT_EQ(test_data(), contents); |
724 | 724 |
725 // Release the loader. The file should be gone now. | 725 // Release the loader. The file should be gone now. |
726 ReleaseLoader(); | 726 ReleaseLoader(); |
727 base::RunLoop().RunUntilIdle(); | 727 base::RunLoop().RunUntilIdle(); |
728 EXPECT_FALSE(base::PathExists(temp_path())); | 728 EXPECT_FALSE(base::PathExists(temp_path())); |
729 } | 729 } |
730 | 730 |
731 } // namespace content | 731 } // namespace content |
OLD | NEW |