summaryrefslogtreecommitdiffstats
path: root/webkit/media/buffered_resource_loader_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/media/buffered_resource_loader_unittest.cc')
-rw-r--r--webkit/media/buffered_resource_loader_unittest.cc33
1 files changed, 17 insertions, 16 deletions
diff --git a/webkit/media/buffered_resource_loader_unittest.cc b/webkit/media/buffered_resource_loader_unittest.cc
index 7769ca5..35fc24d 100644
--- a/webkit/media/buffered_resource_loader_unittest.cc
+++ b/webkit/media/buffered_resource_loader_unittest.cc
@@ -94,8 +94,9 @@ class BufferedResourceLoaderTest : public testing::Test {
}
void SetLoaderBuffer(int forward_capacity, int backward_capacity) {
- loader_->buffer_.reset(
- new media::SeekableBuffer(backward_capacity, forward_capacity));
+ loader_->buffer_.set_forward_capacity(forward_capacity);
+ loader_->buffer_.set_backward_capacity(backward_capacity);
+ loader_->buffer_.Clear();
}
void Start() {
@@ -218,8 +219,8 @@ class BufferedResourceLoaderTest : public testing::Test {
}
void WriteUntilThreshold() {
- int buffered = loader_->buffer_->forward_bytes();
- int capacity = loader_->buffer_->forward_capacity();
+ int buffered = loader_->buffer_.forward_bytes();
+ int capacity = loader_->buffer_.forward_capacity();
CHECK_LT(buffered, capacity);
EXPECT_CALL(*this, NetworkCallback());
@@ -251,19 +252,19 @@ class BufferedResourceLoaderTest : public testing::Test {
int backward_capacity,
int forward_bytes,
int forward_capacity) {
- EXPECT_EQ(backward_bytes, loader_->buffer_->backward_bytes());
- EXPECT_EQ(backward_capacity, loader_->buffer_->backward_capacity());
- EXPECT_EQ(forward_bytes, loader_->buffer_->forward_bytes());
- EXPECT_EQ(forward_capacity, loader_->buffer_->forward_capacity());
+ EXPECT_EQ(backward_bytes, loader_->buffer_.backward_bytes());
+ EXPECT_EQ(backward_capacity, loader_->buffer_.backward_capacity());
+ EXPECT_EQ(forward_bytes, loader_->buffer_.forward_bytes());
+ EXPECT_EQ(forward_capacity, loader_->buffer_.forward_capacity());
}
void ConfirmLoaderBufferBackwardCapacity(int expected_backward_capacity) {
- EXPECT_EQ(loader_->buffer_->backward_capacity(),
+ EXPECT_EQ(loader_->buffer_.backward_capacity(),
expected_backward_capacity);
}
void ConfirmLoaderBufferForwardCapacity(int expected_forward_capacity) {
- EXPECT_EQ(loader_->buffer_->forward_capacity(), expected_forward_capacity);
+ EXPECT_EQ(loader_->buffer_.forward_capacity(), expected_forward_capacity);
}
void ConfirmLoaderDeferredState(bool expectedVal) {
@@ -274,13 +275,13 @@ class BufferedResourceLoaderTest : public testing::Test {
void CheckBufferWindowBounds() {
// Corresponds to value defined in buffered_resource_loader.cc.
static const int kMinBufferCapacity = 2 * 1024 * 1024;
- EXPECT_GE(loader_->buffer_->forward_capacity(), kMinBufferCapacity);
- EXPECT_GE(loader_->buffer_->backward_capacity(), kMinBufferCapacity);
+ EXPECT_GE(loader_->buffer_.forward_capacity(), kMinBufferCapacity);
+ EXPECT_GE(loader_->buffer_.backward_capacity(), kMinBufferCapacity);
// Corresponds to value defined in buffered_resource_loader.cc.
static const int kMaxBufferCapacity = 20 * 1024 * 1024;
- EXPECT_LE(loader_->buffer_->forward_capacity(), kMaxBufferCapacity);
- EXPECT_LE(loader_->buffer_->backward_capacity(), kMaxBufferCapacity);
+ EXPECT_LE(loader_->buffer_.forward_capacity(), kMaxBufferCapacity);
+ EXPECT_LE(loader_->buffer_.backward_capacity(), kMaxBufferCapacity);
}
MOCK_METHOD1(StartCallback, void(BufferedResourceLoader::Status));
@@ -288,8 +289,8 @@ class BufferedResourceLoaderTest : public testing::Test {
MOCK_METHOD0(NetworkCallback, void());
// Accessors for private variables on |loader_|.
- int forward_bytes() { return loader_->buffer_->forward_bytes(); }
- int forward_capacity() { return loader_->buffer_->forward_capacity(); }
+ int forward_bytes() { return loader_->buffer_.forward_bytes(); }
+ int forward_capacity() { return loader_->buffer_.forward_capacity(); }
protected:
GURL gurl_;