| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 // A valid partial response should always result in this being true. | 196 // A valid partial response should always result in this being true. |
| 197 EXPECT_TRUE(loader_->range_supported()); | 197 EXPECT_TRUE(loader_->range_supported()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void Redirect(const char* url) { | 200 void Redirect(const char* url) { |
| 201 GURL redirectUrl(url); | 201 GURL redirectUrl(url); |
| 202 blink::WebURLRequest newRequest(redirectUrl); | 202 blink::WebURLRequest newRequest(redirectUrl); |
| 203 blink::WebURLResponse redirectResponse(gurl_); | 203 blink::WebURLResponse redirectResponse(gurl_); |
| 204 | 204 |
| 205 loader_->willFollowRedirect(url_loader_, newRequest, redirectResponse); | 205 loader_->willFollowRedirect(url_loader_, newRequest, redirectResponse, 0); |
| 206 | 206 |
| 207 base::RunLoop().RunUntilIdle(); | 207 base::RunLoop().RunUntilIdle(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void StopWhenLoad() { | 210 void StopWhenLoad() { |
| 211 InSequence s; | 211 InSequence s; |
| 212 EXPECT_CALL(*url_loader_, cancel()); | 212 EXPECT_CALL(*url_loader_, cancel()); |
| 213 loader_->Stop(); | 213 loader_->Stop(); |
| 214 loader_.reset(); | 214 loader_.reset(); |
| 215 } | 215 } |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 | 1164 |
| 1165 // As soon as we have received enough data to fulfill the read, defer. | 1165 // As soon as we have received enough data to fulfill the read, defer. |
| 1166 EXPECT_CALL(*this, LoadingCallback(BufferedResourceLoader::kLoadingDeferred)); | 1166 EXPECT_CALL(*this, LoadingCallback(BufferedResourceLoader::kLoadingDeferred)); |
| 1167 EXPECT_CALL(*this, ReadCallback(BufferedResourceLoader::kOk, 10)); | 1167 EXPECT_CALL(*this, ReadCallback(BufferedResourceLoader::kOk, 10)); |
| 1168 WriteLoader(19, 1); | 1168 WriteLoader(19, 1); |
| 1169 VerifyBuffer(buffer, 10, 10); | 1169 VerifyBuffer(buffer, 10, 10); |
| 1170 EXPECT_FALSE(HasActiveLoader()); | 1170 EXPECT_FALSE(HasActiveLoader()); |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 } // namespace media | 1173 } // namespace media |
| OLD | NEW |