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

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: 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..2272bf3d92fe9f4c113f3aa9ee83039c5b39b034 100644
--- a/media/base/download_rate_monitor_unittest.cc
+++ b/media/base/download_rate_monitor_unittest.cc
@@ -132,6 +132,19 @@ TEST_F(DownloadRateMonitorTest, MediaIsLoaded) {
SimulateNetwork(1, 0, 0, 1000, 10);
}
+// Test the MediaStream object, e.g. video capture.
+TEST_F(DownloadRateMonitorTest, IsMediaStream) {
+ static const int media_bitrate = 1024 * 1024 * 8;
+
+ monitor_.set_media_stream(true);
+
+ // Simulate no data downloaded (as if source is a local webcam).
+ EXPECT_CALL(*this, CanPlayThrough());
+ monitor_.Start(base::Bind(&DownloadRateMonitorTest::CanPlayThrough,
+ base::Unretained(this)), media_bitrate);
+ SimulateNetwork(1, 0, 0, 1000, 10);
+}
+
TEST_F(DownloadRateMonitorTest, VeryFastDownloadRate) {
static const int media_bitrate = 1024 * 1024 * 8;

Powered by Google App Engine
This is Rietveld 408576698