Index: content/common/cc_messages_unittest.cc |
diff --git a/content/common/cc_messages_unittest.cc b/content/common/cc_messages_unittest.cc |
index 0537a5ad0a7e486de29fd1c307ee617f07f4aeba..bd089308fd14d9fd67ae6bd2a9d07c16449a5948 100644 |
--- a/content/common/cc_messages_unittest.cc |
+++ b/content/common/cc_messages_unittest.cc |
@@ -6,9 +6,12 @@ |
#include <string.h> |
+#include "base/command_line.h" |
#include "cc/output/compositor_frame.h" |
+#include "content/public/common/content_switches.h" |
#include "ipc/ipc_message.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+#include "third_party/skia/include/effects/SkBlurImageFilter.h" |
using cc::CheckerboardDrawQuad; |
using cc::DelegatedFrameData; |
@@ -134,7 +137,10 @@ class CCMessagesTest : public testing::Test { |
b->contents_changed_since_last_frame); |
EXPECT_EQ(a->mask_uv_rect.ToString(), b->mask_uv_rect.ToString()); |
EXPECT_EQ(a->filters, b->filters); |
- EXPECT_EQ(a->filter, b->filter); |
+ if (!a->filter || !b->filter) |
+ EXPECT_EQ(a->filter, b->filter); |
+ else |
+ EXPECT_EQ(a->filter->countInputs(), b->filter->countInputs()); |
EXPECT_EQ(a->background_filters, b->background_filters); |
} |
@@ -188,6 +194,10 @@ class CCMessagesTest : public testing::Test { |
}; |
TEST_F(CCMessagesTest, AllQuads) { |
+ CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ if (!command_line.HasSwitch(switches::kAllowFiltersOverIPC)) |
+ command_line.AppendSwitch(switches::kAllowFiltersOverIPC); |
+ |
IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
Transform arbitrary_matrix; |
@@ -220,6 +230,7 @@ TEST_F(CCMessagesTest, AllQuads) { |
ResourceProvider::ResourceId arbitrary_resourceid2 = 47; |
ResourceProvider::ResourceId arbitrary_resourceid3 = 23; |
ResourceProvider::ResourceId arbitrary_resourceid4 = 16; |
+ SkScalar arbitrary_sigma = SkFloatToScalar(2.0f); |
FilterOperations arbitrary_filters1; |
arbitrary_filters1.Append(FilterOperation::CreateGrayscaleFilter( |
@@ -229,8 +240,8 @@ TEST_F(CCMessagesTest, AllQuads) { |
arbitrary_filters2.Append(FilterOperation::CreateBrightnessFilter( |
arbitrary_float2)); |
- // TODO(danakj): filter is not serialized. |
- skia::RefPtr<SkImageFilter> arbitrary_filter; |
+ skia::RefPtr<SkImageFilter> arbitrary_filter = skia::AdoptRef( |
+ new SkBlurImageFilter(arbitrary_sigma, arbitrary_sigma)); |
scoped_ptr<SharedQuadState> shared_state1_in = SharedQuadState::Create(); |
shared_state1_in->SetAll(arbitrary_matrix, |
@@ -290,7 +301,7 @@ TEST_F(CCMessagesTest, AllQuads) { |
arbitrary_rect1, |
arbitrary_rectf1, |
arbitrary_filters1, |
- arbitrary_filter, // TODO(piman): not serialized. |
+ arbitrary_filter, |
arbitrary_filters2); |
scoped_ptr<RenderPassDrawQuad> renderpass_cmp = renderpass_in->Copy( |
renderpass_in->shared_quad_state, renderpass_in->render_pass_id); |