diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 02:10:46 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-15 02:10:46 +0000 |
commit | e93e25629859d7d7f08428abd5bdad8a403515d4 (patch) | |
tree | 7226891aaed52aeed48922e8293ab05df72e42e1 /webkit/glue/media/buffered_data_source_unittest.cc | |
parent | 86809eba59ca96feb557e98bbc5bdcf03c0c149b (diff) | |
download | chromium_src-e93e25629859d7d7f08428abd5bdad8a403515d4.zip chromium_src-e93e25629859d7d7f08428abd5bdad8a403515d4.tar.gz chromium_src-e93e25629859d7d7f08428abd5bdad8a403515d4.tar.bz2 |
Replace MockFilterCallback with MockCallback and simplify unit tests.
We had a ton of unnecessarily duplicated code, most of which could be solved by introducing NewExpectedCallback().
BUG=none
TEST=media_unittests
Review URL: http://codereview.chromium.org/6350001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71537 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/media/buffered_data_source_unittest.cc')
-rw-r--r-- | webkit/glue/media/buffered_data_source_unittest.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/webkit/glue/media/buffered_data_source_unittest.cc b/webkit/glue/media/buffered_data_source_unittest.cc index dcb11ec..df79485 100644 --- a/webkit/glue/media/buffered_data_source_unittest.cc +++ b/webkit/glue/media/buffered_data_source_unittest.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <algorithm> #include "base/test/test_timeouts.h" +#include "media/base/mock_callback.h" #include "media/base/mock_filter_host.h" #include "media/base/mock_filters.h" #include "net/base/net_errors.h" @@ -167,7 +168,6 @@ class BufferedDataSourceTest : public testing::Test { ON_CALL(*loader_, Read(_, _, _ , _)) .WillByDefault(DeleteArg<3>()); - StrictMock<media::MockFilterCallback> callback; ON_CALL(*loader_, instance_size()) .WillByDefault(Return(instance_size)); ON_CALL(*loader_, partial_response()) @@ -188,18 +188,13 @@ class BufferedDataSourceTest : public testing::Test { } else { EXPECT_CALL(host_, SetStreaming(true)); } - - EXPECT_CALL(callback, OnFilterCallback()); - EXPECT_CALL(callback, OnCallbackDestroyed()); } else { EXPECT_CALL(host_, SetError(media::PIPELINE_ERROR_NETWORK)); EXPECT_CALL(*loader_, Stop()); - EXPECT_CALL(callback, OnFilterCallback()); - EXPECT_CALL(callback, OnCallbackDestroyed()); } // Actual initialization of the data source. - data_source_->Initialize(url, callback.NewCallback()); + data_source_->Initialize(url, media::NewExpectedCallback()); message_loop_->RunAllPending(); if (initialized_ok) { @@ -220,10 +215,7 @@ class BufferedDataSourceTest : public testing::Test { EXPECT_CALL(*loader_, Stop()); } - StrictMock<media::MockFilterCallback> callback; - EXPECT_CALL(callback, OnFilterCallback()); - EXPECT_CALL(callback, OnCallbackDestroyed()); - data_source_->Stop(callback.NewCallback()); + data_source_->Stop(media::NewExpectedCallback()); message_loop_->RunAllPending(); } |