Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Side by Side Diff: Source/core/animation/animatable/AnimatableValueTestHelperTest.cpp

Issue 983103003: Use Length for the stroke-width property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adjust transitions/svg-transitions.html Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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"
36 #include "core/layout/ClipPathOperation.h" 35 #include "core/layout/ClipPathOperation.h"
37 #include "core/layout/style/BasicShapes.h" 36 #include "core/layout/style/BasicShapes.h"
38 #include "core/svg/SVGLengthContext.h"
39 #include "platform/transforms/ScaleTransformOperation.h" 37 #include "platform/transforms/ScaleTransformOperation.h"
40 #include "platform/transforms/TranslateTransformOperation.h" 38 #include "platform/transforms/TranslateTransformOperation.h"
41 39
42 #include <gmock/gmock.h> 40 #include <gmock/gmock.h>
43 #include <gtest/gtest.h> 41 #include <gtest/gtest.h>
44 #include <sstream> 42 #include <sstream>
45 #include <string> 43 #include <string>
46 44
47 45
48 using namespace blink; 46 using namespace blink;
(...skipping 16 matching lines...) Expand all
65 ); 63 );
66 64
67 EXPECT_EQ( 65 EXPECT_EQ(
68 ::std::string("AnimatableColor(rgba(0, 0, 0, 0), #ff0000)"), 66 ::std::string("AnimatableColor(rgba(0, 0, 0, 0), #ff0000)"),
69 PrintToString(AnimatableColor::create(Color(0x000000FF), Color(0xFFFF000 0)))); 67 PrintToString(AnimatableColor::create(Color(0x000000FF), Color(0xFFFF000 0))));
70 68
71 EXPECT_THAT( 69 EXPECT_THAT(
72 PrintToString(const_cast<AnimatableValue*>(AnimatableValue::neutralValue ())), 70 PrintToString(const_cast<AnimatableValue*>(AnimatableValue::neutralValue ())),
73 testing::StartsWith("AnimatableNeutral@")); 71 testing::StartsWith("AnimatableNeutral@"));
74 72
75 RefPtrWillBeRawPtr<SVGLength> length1cm = SVGLength::create();
76 RefPtrWillBeRawPtr<SVGLength> length2cm = SVGLength::create();
77 length1cm->setValueAsString("1cm", ASSERT_NO_EXCEPTION);
78 length2cm->setValueAsString("2cm", ASSERT_NO_EXCEPTION);
79
80 EXPECT_EQ(
81 ::std::string("AnimatableSVGLength(1cm)"),
82 PrintToString(AnimatableSVGLength::create(length1cm)));
83
84 EXPECT_THAT( 73 EXPECT_THAT(
85 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue( BasicShapeCircle::create().get(), ContentBox).get())), 74 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue( BasicShapeCircle::create().get(), ContentBox).get())),
86 testing::StartsWith("AnimatableShapeValue@")); 75 testing::StartsWith("AnimatableShapeValue@"));
87 76
88 RefPtr<SVGDashArray> l2 = SVGDashArray::create(); 77 RefPtr<SVGDashArray> l2 = SVGDashArray::create();
89 l2->append(Length(1, blink::Fixed)); 78 l2->append(Length(1, blink::Fixed));
90 l2->append(Length(2, blink::Percent)); 79 l2->append(Length(2, blink::Percent));
91 EXPECT_EQ( 80 EXPECT_EQ(
92 ::std::string("AnimatableStrokeDasharrayList(1+0%, 0+2%)"), 81 ::std::string("AnimatableStrokeDasharrayList(1+0%, 0+2%)"),
93 PrintToString(AnimatableStrokeDasharrayList::create(l2, 1))); 82 PrintToString(AnimatableStrokeDasharrayList::create(l2, 1)));
(...skipping 13 matching lines...) Expand all
107 EXPECT_EQ( 96 EXPECT_EQ(
108 ::std::string("AnimatableUnknown(none)"), 97 ::std::string("AnimatableUnknown(none)"),
109 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif ier(CSSValueNone).get()))); 98 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif ier(CSSValueNone).get())));
110 99
111 EXPECT_EQ( 100 EXPECT_EQ(
112 ::std::string("AnimatableVisibility(VISIBLE)"), 101 ::std::string("AnimatableVisibility(VISIBLE)"),
113 PrintToString(AnimatableVisibility::create(VISIBLE))); 102 PrintToString(AnimatableVisibility::create(VISIBLE)));
114 } 103 }
115 104
116 } // namespace 105 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698