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

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: fixes Created 9 years 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 | « webkit/media/active_loader.cc ('k') | webkit/media/buffered_resource_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2bcae64b681e0abf326634e46f125682ea2bac40..84dfb28deda3a0ddcb89a6f2ed41b131dffc4c42 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;
@@ -56,14 +55,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;
}
@@ -163,8 +154,12 @@ class BufferedDataSourceTest : public testing::Test {
}
// Accessors for private variables on |data_source_|.
- BufferedResourceLoader* loader() { return data_source_->loader_.get(); }
- WebURLLoader* url_loader() { return loader()->url_loader_.get(); }
+ BufferedResourceLoader* loader() {
+ return data_source_->loader_.get();
+ }
+ WebURLLoader* url_loader() {
+ return loader()->active_loader_->loader_.get();
+ }
media::Preload preload() { return data_source_->preload_; }
BufferedResourceLoader::DeferStrategy defer_strategy() {
@@ -409,6 +404,10 @@ TEST_F(BufferedDataSourceTest, SetBitrate) {
EXPECT_NE(old_loader, loader());
EXPECT_EQ(1234, loader_bitrate());
+ // During teardown we'll also report our final network status.
+ EXPECT_CALL(host_, SetNetworkActivity(true));
+ EXPECT_CALL(host_, SetBufferedBytes(4000000));
+
EXPECT_TRUE(data_source_->loading());
EXPECT_CALL(*this, ReadCallback(media::DataSource::kReadError));
Stop();
@@ -431,6 +430,10 @@ TEST_F(BufferedDataSourceTest, SetPlaybackRate) {
// Verify loader changed but still has same playback rate.
EXPECT_NE(old_loader, loader());
+ // During teardown we'll also report our final network status.
+ EXPECT_CALL(host_, SetNetworkActivity(true));
+ EXPECT_CALL(host_, SetBufferedBytes(4000000));
+
EXPECT_TRUE(data_source_->loading());
EXPECT_CALL(*this, ReadCallback(media::DataSource::kReadError));
Stop();
@@ -449,7 +452,7 @@ TEST_F(BufferedDataSourceTest, Read) {
// During teardown we'll also report our final network status.
EXPECT_CALL(host_, SetBufferedBytes(kDataSize));
- EXPECT_CALL(host_, SetNetworkActivity(false));
+ //EXPECT_CALL(host_, SetNetworkActivity(false));
EXPECT_TRUE(data_source_->loading());
Stop();
« no previous file with comments | « webkit/media/active_loader.cc ('k') | webkit/media/buffered_resource_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698