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

Unified Diff: media/blink/multibuffer_data_source_unittest.cc

Issue 2133803004: Fix MultibufferDataSource::GetSize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bugfix Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/blink/resource_multibuffer_data_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/multibuffer_data_source_unittest.cc
diff --git a/media/blink/multibuffer_data_source_unittest.cc b/media/blink/multibuffer_data_source_unittest.cc
index db4edbe3c9f74f0b38504d6681c1994329c62547..ec1b6ab0325ab9e27c9c4bd115af04f4109060b0 100644
--- a/media/blink/multibuffer_data_source_unittest.cc
+++ b/media/blink/multibuffer_data_source_unittest.cc
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/strings/string_number_conversions.h"
#include "media/base/media_log.h"
#include "media/base/mock_filters.h"
#include "media/base/test_helpers.h"
@@ -1425,4 +1426,26 @@ TEST_F(MultibufferDataSourceTest, LengthKnownAtEOF) {
Stop();
}
+TEST_F(MultibufferDataSourceTest, FileSizeLessThanBlockSize) {
+ Initialize(kHttpUrl, true);
+ GURL gurl(kHttpUrl);
+ blink::WebURLResponse response(gurl);
+ response.setHTTPStatusCode(200);
+ response.setHTTPHeaderField(
+ WebString::fromUTF8("Content-Length"),
+ WebString::fromUTF8(base::Int64ToString(kDataSize / 2)));
+ response.setExpectedContentLength(kDataSize / 2);
+ Respond(response);
+ EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize / 2));
+ EXPECT_CALL(host_, SetTotalBytes(kDataSize / 2));
+ EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize * 2));
+ ReceiveData(kDataSize / 2);
+ FinishLoading();
+
+ int64_t len = 0;
+ EXPECT_TRUE(data_source_->GetSize(&len));
+ EXPECT_EQ(kDataSize / 2, len);
+ Stop();
+}
+
} // namespace media
« 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