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

Unified Diff: media/base/composite_filter_unittest.cc

Issue 6171009: Remove MessageLoop methods from Filter interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied more CR suggestions & removed message_loop() methods where possible. Created 9 years, 11 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 | « media/base/composite_filter.cc ('k') | media/base/filters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/composite_filter_unittest.cc
diff --git a/media/base/composite_filter_unittest.cc b/media/base/composite_filter_unittest.cc
index fe757c3638811261fa58db4a9d059e9aa6a1ab77..f56a278f8f96f5c8667cfddc48ba973644aa9db5 100644
--- a/media/base/composite_filter_unittest.cc
+++ b/media/base/composite_filter_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/message_loop.h"
#include "media/base/composite_filter.h"
#include "media/base/mock_filter_host.h"
#include "media/base/mock_filters.h"
@@ -303,56 +304,29 @@ void CompositeFilterTest::RunFilter2Callback() {
delete callback;
}
-static base::Thread* NullThreadFactory(const char* thread_name) {
- return NULL;
-}
-
// Test AddFilter() failure cases.
TEST_F(CompositeFilterTest, TestAddFilterFailCases) {
// Test adding a null pointer.
EXPECT_FALSE(composite_->AddFilter(NULL));
- scoped_refptr<StrictMock<MockFilter> > filter =
- new StrictMock<MockFilter>(true);
+ scoped_refptr<StrictMock<MockFilter> > filter = new StrictMock<MockFilter>();
EXPECT_EQ(NULL, filter->host());
- EXPECT_EQ(NULL, filter->message_loop());
// Test failing because set_host() hasn't been called yet.
EXPECT_FALSE(composite_->AddFilter(filter));
-
- // Test thread creation failure.
- composite_ = new CompositeFilter(&message_loop_, &NullThreadFactory);
- composite_->set_host(mock_filter_host_.get());
- EXPECT_FALSE(composite_->AddFilter(filter));
- EXPECT_EQ(NULL, filter->host());
- EXPECT_EQ(NULL, filter->message_loop());
}
// Test successful AddFilter() cases.
TEST_F(CompositeFilterTest, TestAddFilter) {
composite_->set_host(mock_filter_host_.get());
- // Add a filter that doesn't require a message loop.
+ // Add a filter.
scoped_refptr<StrictMock<MockFilter> > filter = new StrictMock<MockFilter>();
EXPECT_EQ(NULL, filter->host());
- EXPECT_EQ(NULL, filter->message_loop());
EXPECT_TRUE(composite_->AddFilter(filter));
EXPECT_TRUE(filter->host() != NULL);
- EXPECT_EQ(NULL, filter->message_loop());
-
- // Add a filter that requires a message loop.
- scoped_refptr<StrictMock<MockFilter> > filter_2 =
- new StrictMock<MockFilter>(true);
-
- EXPECT_EQ(NULL, filter_2->host());
- EXPECT_EQ(NULL, filter_2->message_loop());
-
- EXPECT_TRUE(composite_->AddFilter(filter_2));
-
- EXPECT_TRUE(filter_2->host() != NULL);
- EXPECT_TRUE(filter_2->message_loop() != NULL);
}
TEST_F(CompositeFilterTest, TestPlay) {
« no previous file with comments | « media/base/composite_filter.cc ('k') | media/base/filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698