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

Unified Diff: webkit/media/buffered_data_source_unittest.cc

Issue 8667002: Split a portion of BufferedResourceLoader into a separate class ActiveLoader. (Closed) Base URL: svn://chrome-svn/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: webkit/media/buffered_data_source_unittest.cc
diff --git a/webkit/media/buffered_data_source_unittest.cc b/webkit/media/buffered_data_source_unittest.cc
index 2ef2da8cfed486ac45f6800d48c1ca35c4a89f2b..158a5dd56e1241989ccb6b67abffd0095e189df0 100644
--- a/webkit/media/buffered_data_source_unittest.cc
+++ b/webkit/media/buffered_data_source_unittest.cc
@@ -17,7 +17,6 @@
using ::testing::_;
using ::testing::Assign;
using ::testing::Invoke;
-using ::testing::Mock;
using ::testing::StrictMock;
using ::testing::NiceMock;
@@ -55,14 +54,6 @@ class MockBufferedDataSource : public BufferedDataSource {
ON_CALL(*url_loader, cancel())
.WillByDefault(Assign(&loading_, false));
- // TODO(scherkus): this is a real leak detected by http://crbug.com/100914
- // but the fix will have to wait for a more invasive follow up patch.
- //
- // If you're curious what the fix is, we no longer need the reference
- // counting added to BufferedResourceLoader in r23274 since we started
- // using WebURLLoader in r69429.
- Mock::AllowLeak(url_loader);
-
loader->SetURLLoaderForTest(url_loader);
return loader;
}
@@ -173,7 +164,7 @@ class BufferedDataSourceTest : public testing::Test {
}
NiceMock<MockWebURLLoader>* url_loader() {
return static_cast<NiceMock<MockWebURLLoader>*>(
- loader()->url_loader_.get());
+ loader()->active_loader_->loader_.get());
}
media::Preload preload() { return data_source_->preload_; }
@@ -385,6 +376,9 @@ TEST_F(BufferedDataSourceTest, SetBitrate) {
// Verify loader changed but still has same bitrate.
EXPECT_NE(old_loader, loader());
EXPECT_EQ(1234, loader_bitrate());
+
+ // During teardown we'll also report our final network status.
+ EXPECT_CALL(host_, SetBufferedBytes(4000000));
Stop();
}
@@ -404,6 +398,9 @@ TEST_F(BufferedDataSourceTest, SetPlaybackRate) {
// Verify loader changed but still has same bitrate.
EXPECT_NE(old_loader, loader());
+
+ // During teardown we'll also report our final network status.
+ EXPECT_CALL(host_, SetBufferedBytes(4000000));
Stop();
}

Powered by Google App Engine
This is Rietveld 408576698