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

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

Issue 1991033002: Make http/tests/media/audio-seekable-contains-zero-without-ranges.html work with multibuffers. (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 | « media/blink/multibuffer_data_source.cc ('k') | no next file » | 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize)); 1332 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize));
1333 ReceiveData(kDataSize); 1333 ReceiveData(kDataSize);
1334 1334
1335 EXPECT_FALSE(data_source_->IsStreaming()); 1335 EXPECT_FALSE(data_source_->IsStreaming());
1336 1336
1337 FinishLoading(); 1337 FinishLoading();
1338 EXPECT_FALSE(loading()); 1338 EXPECT_FALSE(loading());
1339 Stop(); 1339 Stop();
1340 } 1340 }
1341 1341
1342 TEST_F(MultibufferDataSourceTest, LengthKnownAtEOF) {
1343 Initialize(kHttpUrl, true);
1344 // Server responds without content-length.
1345 WebURLResponse response = response_generator_->Generate200();
1346 response.clearHTTPHeaderField(WebString::fromUTF8("Content-Length"));
1347 response.setExpectedContentLength(kPositionNotSpecified);
1348 Respond(response);
1349 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize));
1350 ReceiveData(kDataSize);
1351 int64_t len;
1352 EXPECT_FALSE(data_source_->GetSize(&len));
1353 EXPECT_TRUE(data_source_->IsStreaming());
1354 EXPECT_CALL(*this, ReadCallback(kDataSize));
1355 ReadAt(0);
1356
1357 ReadAt(kDataSize);
1358 EXPECT_CALL(host_, SetTotalBytes(kDataSize));
1359 EXPECT_CALL(*this, ReadCallback(0));
1360 EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize * 2));
1361 FinishLoading();
1362
1363 // Done loading, now we should know the length.
1364 EXPECT_TRUE(data_source_->GetSize(&len));
1365 EXPECT_EQ(kDataSize, len);
1366 Stop();
1367 }
1368
1342 } // namespace media 1369 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/multibuffer_data_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698