| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 ); | 64 ); |
| 65 | 65 |
| 66 EXPECT_EQ( | 66 EXPECT_EQ( |
| 67 ::std::string("AnimatableColor(rgba(0, 0, 0, 0), #ff0000)"), | 67 ::std::string("AnimatableColor(rgba(0, 0, 0, 0), #ff0000)"), |
| 68 PrintToString(AnimatableColor::create(Color(0x000000FF), Color(0xFFFF000
0)))); | 68 PrintToString(AnimatableColor::create(Color(0x000000FF), Color(0xFFFF000
0)))); |
| 69 | 69 |
| 70 EXPECT_THAT( | 70 EXPECT_THAT( |
| 71 PrintToString(const_cast<AnimatableValue*>(AnimatableValue::neutralValue
())), | 71 PrintToString(const_cast<AnimatableValue*>(AnimatableValue::neutralValue
())), |
| 72 testing::StartsWith("AnimatableNeutral@")); | 72 testing::StartsWith("AnimatableNeutral@")); |
| 73 | 73 |
| 74 RefPtr<SVGLength> length1cm = SVGLength::create(LengthModeOther); | 74 RefPtrWillBeRawPtr<SVGLength> length1cm = SVGLength::create(LengthModeOther)
; |
| 75 RefPtr<SVGLength> length2cm = SVGLength::create(LengthModeOther); | 75 RefPtrWillBeRawPtr<SVGLength> length2cm = SVGLength::create(LengthModeOther)
; |
| 76 length1cm->setValueAsString("1cm", ASSERT_NO_EXCEPTION); | 76 length1cm->setValueAsString("1cm", ASSERT_NO_EXCEPTION); |
| 77 length2cm->setValueAsString("2cm", ASSERT_NO_EXCEPTION); | 77 length2cm->setValueAsString("2cm", ASSERT_NO_EXCEPTION); |
| 78 | 78 |
| 79 EXPECT_EQ( | 79 EXPECT_EQ( |
| 80 ::std::string("AnimatableSVGLength(1cm)"), | 80 ::std::string("AnimatableSVGLength(1cm)"), |
| 81 PrintToString(AnimatableSVGLength::create(length1cm))); | 81 PrintToString(AnimatableSVGLength::create(length1cm))); |
| 82 | 82 |
| 83 EXPECT_THAT( | 83 EXPECT_THAT( |
| 84 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue(
BasicShapeCircle::create().get(), ContentBox).get())), | 84 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue(
BasicShapeCircle::create().get(), ContentBox).get())), |
| 85 testing::StartsWith("AnimatableShapeValue@")); | 85 testing::StartsWith("AnimatableShapeValue@")); |
| 86 | 86 |
| 87 RefPtr<SVGLengthList> l2 = SVGLengthList::create(); | 87 RefPtrWillBeRawPtr<SVGLengthList> l2 = SVGLengthList::create(); |
| 88 l2->append(length1cm); | 88 l2->append(length1cm); |
| 89 l2->append(length2cm); | 89 l2->append(length2cm); |
| 90 EXPECT_EQ( | 90 EXPECT_EQ( |
| 91 ::std::string("AnimatableStrokeDasharrayList(1cm, 2cm)"), | 91 ::std::string("AnimatableStrokeDasharrayList(1cm, 2cm)"), |
| 92 PrintToString(AnimatableStrokeDasharrayList::create(l2))); | 92 PrintToString(AnimatableStrokeDasharrayList::create(l2))); |
| 93 | 93 |
| 94 TransformOperations operations1; | 94 TransformOperations operations1; |
| 95 operations1.operations().append(TranslateTransformOperation::create(Length(2
, blink::Fixed), Length(0, blink::Fixed), TransformOperation::TranslateX)); | 95 operations1.operations().append(TranslateTransformOperation::create(Length(2
, blink::Fixed), Length(0, blink::Fixed), TransformOperation::TranslateX)); |
| 96 EXPECT_EQ( | 96 EXPECT_EQ( |
| 97 ::std::string("AnimatableTransform([1 0 0 1 2 0])"), | 97 ::std::string("AnimatableTransform([1 0 0 1 2 0])"), |
| 98 PrintToString(AnimatableTransform::create(operations1))); | 98 PrintToString(AnimatableTransform::create(operations1))); |
| 99 | 99 |
| 100 TransformOperations operations2; | 100 TransformOperations operations2; |
| 101 operations2.operations().append(ScaleTransformOperation::create(1, 1, 1, Tra
nsformOperation::Scale3D)); | 101 operations2.operations().append(ScaleTransformOperation::create(1, 1, 1, Tra
nsformOperation::Scale3D)); |
| 102 EXPECT_EQ( | 102 EXPECT_EQ( |
| 103 ::std::string("AnimatableTransform([1 0 0 1 0 0])"), | 103 ::std::string("AnimatableTransform([1 0 0 1 0 0])"), |
| 104 PrintToString(AnimatableTransform::create(operations2))); | 104 PrintToString(AnimatableTransform::create(operations2))); |
| 105 | 105 |
| 106 EXPECT_EQ( | 106 EXPECT_EQ( |
| 107 ::std::string("AnimatableUnknown(none)"), | 107 ::std::string("AnimatableUnknown(none)"), |
| 108 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif
ier(CSSValueNone).get()))); | 108 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif
ier(CSSValueNone).get()))); |
| 109 | 109 |
| 110 EXPECT_EQ( | 110 EXPECT_EQ( |
| 111 ::std::string("AnimatableVisibility(VISIBLE)"), | 111 ::std::string("AnimatableVisibility(VISIBLE)"), |
| 112 PrintToString(AnimatableVisibility::create(VISIBLE))); | 112 PrintToString(AnimatableVisibility::create(VISIBLE))); |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace | 115 } // namespace |
| OLD | NEW |