Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: media/blink/multibuffer_data_source_unittest.cc

Issue 1941783004: Fix seeking after redirect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/blink/resource_multibuffer_data_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | media/blink/resource_multibuffer_data_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698