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

Unified Diff: media/blink/multibuffer_data_source_unittest.cc

Issue 2078833003: fix a semi-rare crash in multibuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 6 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.cc » ('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 499c3c8217d6024be461da9260f72823bc24bfc5..f562094fe8b1220262d5a6d0652316fa060c4fe6 100644
--- a/media/blink/multibuffer_data_source_unittest.cc
+++ b/media/blink/multibuffer_data_source_unittest.cc
@@ -527,6 +527,14 @@ TEST_F(MultibufferDataSourceTest, Range_NotSupported) {
Stop();
}
+TEST_F(MultibufferDataSourceTest, Range_NotSatisfiable) {
+ Initialize(kHttpUrl, true);
+ EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize));
+ Respond(response_generator_->GenerateResponse(416));
+ EXPECT_FALSE(loading());
+ Stop();
+}
+
// Special carve-out for Apache versions that choose to return a 200 for
// Range:0- ("because it's more efficient" than a 206)
TEST_F(MultibufferDataSourceTest, Range_SupportedButReturned200) {
@@ -1376,6 +1384,20 @@ TEST_F(MultibufferDataSourceTest, Http_NotStreamingAfterRedirect) {
Stop();
}
+TEST_F(MultibufferDataSourceTest, Http_RangeNotSatisfiableAfterRedirect) {
+ Initialize(kHttpUrl, true);
+
+ // Server responds with a redirect.
+ blink::WebURLRequest request((GURL(kHttpDifferentPathUrl)));
+ blink::WebURLResponse response((GURL(kHttpUrl)));
+ response.setHTTPStatusCode(307);
+ data_provider()->willFollowRedirect(url_loader(), request, response);
+
+ EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize));
+ Respond(response_generator_->GenerateResponse(416));
+ Stop();
+}
+
TEST_F(MultibufferDataSourceTest, LengthKnownAtEOF) {
Initialize(kHttpUrl, true);
// Server responds without content-length.
« no previous file with comments | « no previous file | media/blink/resource_multibuffer_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698