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

Unified Diff: webkit/media/buffered_data_source_unittest.cc

Issue 10535101: Replace Pipeline::SetNetworkActivity() with BufferedDataSource -> WebMediaPlayerImpl callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/media/buffered_data_source.cc ('k') | webkit/media/webmediaplayer_impl.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 b8a88ac27399d5af6633159ff55627c668fb7628..c17cc8023a5c1e9ea4941d5703278c470acee0c1 100644
--- a/webkit/media/buffered_data_source_unittest.cc
+++ b/webkit/media/buffered_data_source_unittest.cc
@@ -37,7 +37,10 @@ namespace webkit_media {
class MockBufferedDataSource : public BufferedDataSource {
public:
MockBufferedDataSource(MessageLoop* message_loop, WebFrame* frame)
- : BufferedDataSource(message_loop, frame, new media::MediaLog()),
+ : BufferedDataSource(message_loop, frame, new media::MediaLog(),
+ base::Bind(&MockBufferedDataSource::set_downloading,
+ base::Unretained(this))),
+ downloading_(false),
loading_(false) {
}
@@ -64,10 +67,15 @@ class MockBufferedDataSource : public BufferedDataSource {
bool loading() { return loading_; }
void set_loading(bool loading) { loading_ = loading; }
+ bool downloading() { return downloading_; }
+ void set_downloading(bool downloading) { downloading_ = downloading; }
private:
virtual ~MockBufferedDataSource() {}
+ // Whether the resource is downloading or deferred.
+ bool downloading_;
+
// Whether the resource load has starting loading but yet to been cancelled.
bool loading_;
@@ -173,7 +181,6 @@ class BufferedDataSourceTest : public testing::Test {
int loader_bitrate() { return loader()->bitrate_; }
int loader_playback_rate() { return loader()->playback_rate_; }
-
scoped_refptr<MockBufferedDataSource> data_source_;
TestResponseGenerator response_generator_;
@@ -432,16 +439,16 @@ TEST_F(BufferedDataSourceTest, Read) {
// When the read completes we'll update our network status.
EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1));
- EXPECT_CALL(host_, SetNetworkActivity(true));
EXPECT_CALL(*this, ReadCallback(kDataSize));
FinishRead();
+ EXPECT_TRUE(data_source_->downloading());
// During teardown we'll also report our final network status.
- EXPECT_CALL(host_, SetNetworkActivity(false));
EXPECT_CALL(host_, AddBufferedByteRange(0, kDataSize - 1));
- EXPECT_TRUE(data_source_->loading());
+ EXPECT_TRUE(data_source_->downloading());
Stop();
+ EXPECT_FALSE(data_source_->downloading());
}
} // namespace webkit_media
« no previous file with comments | « webkit/media/buffered_data_source.cc ('k') | webkit/media/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698