| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "platform/graphics/filters/FilterOperations.h" | 27 #include "platform/graphics/filters/FilterOperations.h" |
| 28 | 28 |
| 29 #include <gtest/gtest.h> | 29 #include <gtest/gtest.h> |
| 30 | 30 |
| 31 using namespace blink; | 31 using namespace blink; |
| 32 using namespace blink; | |
| 33 | 32 |
| 34 namespace { | 33 namespace { |
| 35 | 34 |
| 36 TEST(FilterOperationsTest, getOutsetsBlur) | 35 TEST(FilterOperationsTest, getOutsetsBlur) |
| 37 { | 36 { |
| 38 FilterOperations ops; | 37 FilterOperations ops; |
| 39 ops.operations().append(BlurFilterOperation::create(Length(20.0, blink::Fixe
d))); | 38 ops.operations().append(BlurFilterOperation::create(Length(20.0, Fixed))); |
| 40 EXPECT_TRUE(ops.hasOutsets()); | 39 EXPECT_TRUE(ops.hasOutsets()); |
| 41 FilterOutsets outsets = ops.outsets(); | 40 FilterOutsets outsets = ops.outsets(); |
| 42 EXPECT_EQ(57, outsets.top()); | 41 EXPECT_EQ(57, outsets.top()); |
| 43 EXPECT_EQ(57, outsets.right()); | 42 EXPECT_EQ(57, outsets.right()); |
| 44 EXPECT_EQ(57, outsets.bottom()); | 43 EXPECT_EQ(57, outsets.bottom()); |
| 45 EXPECT_EQ(57, outsets.left()); | 44 EXPECT_EQ(57, outsets.left()); |
| 46 } | 45 } |
| 47 | 46 |
| 48 TEST(FilterOperationsTest, getOutsetsDropShadow) | 47 TEST(FilterOperationsTest, getOutsetsDropShadow) |
| 49 { | 48 { |
| 50 FilterOperations ops; | 49 FilterOperations ops; |
| 51 ops.operations().append(DropShadowFilterOperation::create(IntPoint(3, 8), 20
, Color(1, 2, 3))); | 50 ops.operations().append(DropShadowFilterOperation::create(IntPoint(3, 8), 20
, Color(1, 2, 3))); |
| 52 EXPECT_TRUE(ops.hasOutsets()); | 51 EXPECT_TRUE(ops.hasOutsets()); |
| 53 FilterOutsets outsets = ops.outsets(); | 52 FilterOutsets outsets = ops.outsets(); |
| 54 EXPECT_EQ(49, outsets.top()); | 53 EXPECT_EQ(49, outsets.top()); |
| 55 EXPECT_EQ(60, outsets.right()); | 54 EXPECT_EQ(60, outsets.right()); |
| 56 EXPECT_EQ(65, outsets.bottom()); | 55 EXPECT_EQ(65, outsets.bottom()); |
| 57 EXPECT_EQ(54, outsets.left()); | 56 EXPECT_EQ(54, outsets.left()); |
| 58 } | 57 } |
| 59 | 58 |
| 60 } | 59 } |
| 61 | 60 |
| OLD | NEW |