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

Unified Diff: media/base/download_rate_monitor_unittest.cc

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix media/event-attributes.html Created 9 years, 1 month 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
Index: media/base/download_rate_monitor_unittest.cc
diff --git a/media/base/download_rate_monitor_unittest.cc b/media/base/download_rate_monitor_unittest.cc
index 787a5b4a96f471e6be4d0dcf80589f7defde004a..10068475827ab181720e5de908742b036d147dcb 100644
--- a/media/base/download_rate_monitor_unittest.cc
+++ b/media/base/download_rate_monitor_unittest.cc
@@ -120,16 +120,27 @@ TEST_F(DownloadRateMonitorTest, DownloadRateLessThanBitrate) {
SimulateNetwork(1, 0, media_bitrate / 8 / 2, 1000, 10);
}
-TEST_F(DownloadRateMonitorTest, MediaIsLoaded) {
+TEST_F(DownloadRateMonitorTest, MediaSourceIsLocal) {
static const int media_bitrate = 1024 * 1024 * 8;
- monitor_.set_loaded(true);
+ monitor_.set_local_source(true);
- // Simulate no data downloaded (source is already loaded).
+ // Simulate no data downloaded.
EXPECT_CALL(*this, CanPlayThrough());
monitor_.Start(base::Bind(&DownloadRateMonitorTest::CanPlayThrough,
base::Unretained(this)), media_bitrate);
- SimulateNetwork(1, 0, 0, 1000, 10);
+}
+
+TEST_F(DownloadRateMonitorTest, MediaSourceIsStreaming) {
+ static const int media_bitrate = 1024 * 1024 * 8;
+
+ monitor_.set_streaming(true);
+
+ // Simulate downloading at the media's bitrate while streaming.
+ EXPECT_CALL(*this, CanPlayThrough());
+ monitor_.Start(base::Bind(&DownloadRateMonitorTest::CanPlayThrough,
+ base::Unretained(this)), media_bitrate);
+ SimulateNetwork(1, 0, media_bitrate / 8, 1000, 10);
}
TEST_F(DownloadRateMonitorTest, VeryFastDownloadRate) {

Powered by Google App Engine
This is Rietveld 408576698