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) { |