| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "core/animation/animatable/AnimatableValueTestHelper.h" | 33 #include "core/animation/animatable/AnimatableValueTestHelper.h" |
| 34 | 34 |
| 35 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 35 #include "core/layout/ClipPathOperation.h" | 36 #include "core/layout/ClipPathOperation.h" |
| 36 #include "core/layout/style/BasicShapes.h" | 37 #include "core/layout/style/BasicShapes.h" |
| 37 #include "core/svg/SVGLengthContext.h" | 38 #include "core/svg/SVGLengthContext.h" |
| 38 #include "platform/transforms/ScaleTransformOperation.h" | 39 #include "platform/transforms/ScaleTransformOperation.h" |
| 39 #include "platform/transforms/TranslateTransformOperation.h" | 40 #include "platform/transforms/TranslateTransformOperation.h" |
| 40 | 41 |
| 41 #include <gmock/gmock.h> | 42 #include <gmock/gmock.h> |
| 42 #include <gtest/gtest.h> | 43 #include <gtest/gtest.h> |
| 43 #include <sstream> | 44 #include <sstream> |
| 44 #include <string> | 45 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 length2cm->setValueAsString("2cm", ASSERT_NO_EXCEPTION); | 78 length2cm->setValueAsString("2cm", ASSERT_NO_EXCEPTION); |
| 78 | 79 |
| 79 EXPECT_EQ( | 80 EXPECT_EQ( |
| 80 ::std::string("AnimatableSVGLength(1cm)"), | 81 ::std::string("AnimatableSVGLength(1cm)"), |
| 81 PrintToString(AnimatableSVGLength::create(length1cm))); | 82 PrintToString(AnimatableSVGLength::create(length1cm))); |
| 82 | 83 |
| 83 EXPECT_THAT( | 84 EXPECT_THAT( |
| 84 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue(
BasicShapeCircle::create().get(), ContentBox).get())), | 85 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue(
BasicShapeCircle::create().get(), ContentBox).get())), |
| 85 testing::StartsWith("AnimatableShapeValue@")); | 86 testing::StartsWith("AnimatableShapeValue@")); |
| 86 | 87 |
| 87 RefPtrWillBeRawPtr<SVGLengthList> l2 = SVGLengthList::create(); | 88 RefPtr<SVGDashArray> l2 = SVGDashArray::create(); |
| 88 l2->append(length1cm); | 89 l2->append(Length(1, blink::Fixed)); |
| 89 l2->append(length2cm); | 90 l2->append(Length(2, blink::Percent)); |
| 90 EXPECT_EQ( | 91 EXPECT_EQ( |
| 91 ::std::string("AnimatableStrokeDasharrayList(1cm, 2cm)"), | 92 ::std::string("AnimatableStrokeDasharrayList(1+0%, 0+2%)"), |
| 92 PrintToString(AnimatableStrokeDasharrayList::create(l2))); | 93 PrintToString(AnimatableStrokeDasharrayList::create(l2, 1))); |
| 93 | 94 |
| 94 TransformOperations operations1; | 95 TransformOperations operations1; |
| 95 operations1.operations().append(TranslateTransformOperation::create(Length(2
, blink::Fixed), Length(0, blink::Fixed), TransformOperation::TranslateX)); | 96 operations1.operations().append(TranslateTransformOperation::create(Length(2
, blink::Fixed), Length(0, blink::Fixed), TransformOperation::TranslateX)); |
| 96 EXPECT_EQ( | 97 EXPECT_EQ( |
| 97 ::std::string("AnimatableTransform([1 0 0 1 2 0])"), | 98 ::std::string("AnimatableTransform([1 0 0 1 2 0])"), |
| 98 PrintToString(AnimatableTransform::create(operations1))); | 99 PrintToString(AnimatableTransform::create(operations1))); |
| 99 | 100 |
| 100 TransformOperations operations2; | 101 TransformOperations operations2; |
| 101 operations2.operations().append(ScaleTransformOperation::create(1, 1, 1, Tra
nsformOperation::Scale3D)); | 102 operations2.operations().append(ScaleTransformOperation::create(1, 1, 1, Tra
nsformOperation::Scale3D)); |
| 102 EXPECT_EQ( | 103 EXPECT_EQ( |
| 103 ::std::string("AnimatableTransform([1 0 0 1 0 0])"), | 104 ::std::string("AnimatableTransform([1 0 0 1 0 0])"), |
| 104 PrintToString(AnimatableTransform::create(operations2))); | 105 PrintToString(AnimatableTransform::create(operations2))); |
| 105 | 106 |
| 106 EXPECT_EQ( | 107 EXPECT_EQ( |
| 107 ::std::string("AnimatableUnknown(none)"), | 108 ::std::string("AnimatableUnknown(none)"), |
| 108 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif
ier(CSSValueNone).get()))); | 109 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif
ier(CSSValueNone).get()))); |
| 109 | 110 |
| 110 EXPECT_EQ( | 111 EXPECT_EQ( |
| 111 ::std::string("AnimatableVisibility(VISIBLE)"), | 112 ::std::string("AnimatableVisibility(VISIBLE)"), |
| 112 PrintToString(AnimatableVisibility::create(VISIBLE))); | 113 PrintToString(AnimatableVisibility::create(VISIBLE))); |
| 113 } | 114 } |
| 114 | 115 |
| 115 } // namespace | 116 } // namespace |
| OLD | NEW |