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

Unified Diff: media/base/composite_filter_unittest.cc

Issue 8922010: <video> decode in hardware! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | « media/base/composite_filter.cc ('k') | media/base/filter_collection.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 23b7f569bcd07a7c99bb5fef54f901fb7e7d10e1..6b7f219555871378c52394a5f76192148823b6c4 100644
--- a/media/base/composite_filter_unittest.cc
+++ b/media/base/composite_filter_unittest.cc
@@ -379,8 +379,8 @@ TEST_F(CompositeFilterTest, TestAddFilterFailCases) {
EXPECT_FALSE(composite_->AddFilter(filter));
}
-// Test successful AddFilter() cases.
-TEST_F(CompositeFilterTest, TestAddFilter) {
+// Test successful {Add,Remove}Filter() cases.
+TEST_F(CompositeFilterTest, TestAddRemoveFilter) {
composite_->set_host(mock_filter_host_.get());
// Add a filter.
@@ -388,8 +388,19 @@ TEST_F(CompositeFilterTest, TestAddFilter) {
EXPECT_EQ(NULL, filter->host());
EXPECT_TRUE(composite_->AddFilter(filter));
-
EXPECT_TRUE(filter->host() != NULL);
+ composite_->RemoveFilter(filter);
+ EXPECT_TRUE(filter->host() == NULL);
+}
+
+class CompositeFilterDeathTest : public CompositeFilterTest {};
+
+// Test failure of RemoveFilter() on an unknown filter.
+TEST_F(CompositeFilterDeathTest, TestRemoveUnknownFilter) {
+ composite_->set_host(mock_filter_host_.get());
+ // Remove unknown filter.
+ scoped_refptr<StrictMock<MockFilter> > filter = new StrictMock<MockFilter>();
+ EXPECT_DEATH(composite_->RemoveFilter(filter), "");
}
TEST_F(CompositeFilterTest, TestPlay) {
« no previous file with comments | « media/base/composite_filter.cc ('k') | media/base/filter_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698