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

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

Issue 2979893002: media: Allow suspend on HTTP 200 videos (Closed)
Patch Set: layout test fix Created 3 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 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 594
595 EXPECT_FALSE(loading()); 595 EXPECT_FALSE(loading());
596 Stop(); 596 Stop();
597 } 597 }
598 598
599 // Test the case where the initial response from the server indicates that 599 // Test the case where the initial response from the server indicates that
600 // Range requests are supported, but a later request prove otherwise. 600 // Range requests are supported, but a later request prove otherwise.
601 TEST_F(MultibufferDataSourceTest, Range_ServerLied) { 601 TEST_F(MultibufferDataSourceTest, Range_ServerLied) {
602 InitializeWith206Response(); 602 InitializeWith206Response();
603 603
604 // Read causing a new request to be made -- we'll expect it to error. 604 // Read causing a new request to be made, we will discard the data that
605 // was already read in the first request.
605 ReadAt(kFarReadPosition); 606 ReadAt(kFarReadPosition);
606 607
607 // Return a 200 in response to a range request. 608 // Return a 200 in response to a range request.
608 EXPECT_CALL(*this, ReadCallback(media::DataSource::kReadError)); 609 EXPECT_CALL(*this, ReadCallback(media::DataSource::kReadError));
609 Respond(response_generator_->Generate200()); 610 Respond(response_generator_->Generate200());
610 611
611 EXPECT_FALSE(loading()); 612 EXPECT_TRUE(loading());
612 Stop(); 613 Stop();
613 } 614 }
614 615
615 TEST_F(MultibufferDataSourceTest, Http_AbortWhileReading) { 616 TEST_F(MultibufferDataSourceTest, Http_AbortWhileReading) {
616 InitializeWith206Response(); 617 InitializeWith206Response();
617 618
618 // Make sure there's a pending read -- we'll expect it to error. 619 // Make sure there's a pending read -- we'll expect it to error.
619 ReadAt(kFileSize); 620 ReadAt(kFileSize);
620 621
621 // Abort!!! 622 // Abort!!!
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 base::Bind(&MultibufferDataSourceTest::ReadCallback, 1622 base::Bind(&MultibufferDataSourceTest::ReadCallback,
1622 base::Unretained(this))); 1623 base::Unretained(this)));
1623 base::RunLoop().RunUntilIdle(); 1624 base::RunLoop().RunUntilIdle();
1624 1625
1625 // Make sure we're not downloading anymore. 1626 // Make sure we're not downloading anymore.
1626 EXPECT_EQ(data_source_->downloading(), false); 1627 EXPECT_EQ(data_source_->downloading(), false);
1627 Stop(); 1628 Stop();
1628 } 1629 }
1629 1630
1630 } // namespace media 1631 } // 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