| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 response.setHTTPStatusCode(307); | 1310 response.setHTTPStatusCode(307); |
| 1311 data_provider()->willFollowRedirect(url_loader(), request, response); | 1311 data_provider()->willFollowRedirect(url_loader(), request, response); |
| 1312 Respond(response_generator_->Generate206(kDataSize)); | 1312 Respond(response_generator_->Generate206(kDataSize)); |
| 1313 ReceiveData(kDataSize); | 1313 ReceiveData(kDataSize); |
| 1314 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize * 3)); | 1314 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize * 3)); |
| 1315 FinishLoading(); | 1315 FinishLoading(); |
| 1316 EXPECT_FALSE(loading()); | 1316 EXPECT_FALSE(loading()); |
| 1317 Stop(); | 1317 Stop(); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 TEST_F(MultibufferDataSourceTest, Http_NotStreamingAfterRedirect) { |
| 1321 Initialize(kHttpUrl, true); |
| 1322 |
| 1323 // Server responds with a redirect. |
| 1324 blink::WebURLRequest request((GURL(kHttpDifferentPathUrl))); |
| 1325 blink::WebURLResponse response((GURL(kHttpUrl))); |
| 1326 response.setHTTPStatusCode(307); |
| 1327 data_provider()->willFollowRedirect(url_loader(), request, response); |
| 1328 |
| 1329 EXPECT_CALL(host_, SetTotalBytes(response_generator_->content_length())); |
| 1330 Respond(response_generator_->Generate206(0)); |
| 1331 |
| 1332 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize)); |
| 1333 ReceiveData(kDataSize); |
| 1334 |
| 1335 EXPECT_FALSE(data_source_->IsStreaming()); |
| 1336 |
| 1337 FinishLoading(); |
| 1338 EXPECT_FALSE(loading()); |
| 1339 Stop(); |
| 1340 } |
| 1341 |
| 1320 } // namespace media | 1342 } // namespace media |
| OLD | NEW |