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

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

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert aggressive svgAttributeChanged, add NeedsRebaseline Created 6 years, 11 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
« no previous file with comments | « Source/core/animation/AnimatableValueTestHelper.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 PrintToString(AnimatableValue::neutralValue()), 107 PrintToString(AnimatableValue::neutralValue()),
108 testing::StartsWith("AnimatableNeutral@")); 108 testing::StartsWith("AnimatableNeutral@"));
109 109
110 Vector<RefPtr<AnimatableValue> > v1; 110 Vector<RefPtr<AnimatableValue> > v1;
111 v1.append(AnimatableLength::create(CSSPrimitiveValue::create(3, CSSPrimitive Value::CSS_REMS).get())); 111 v1.append(AnimatableLength::create(CSSPrimitiveValue::create(3, CSSPrimitive Value::CSS_REMS).get()));
112 v1.append(AnimatableLength::create(CSSPrimitiveValue::create(4, CSSPrimitive Value::CSS_PT).get())); 112 v1.append(AnimatableLength::create(CSSPrimitiveValue::create(4, CSSPrimitive Value::CSS_PT).get()));
113 EXPECT_EQ( 113 EXPECT_EQ(
114 ::std::string("AnimatableRepeatable(AnimatableLength(3rem), AnimatableLe ngth(4pt))"), 114 ::std::string("AnimatableRepeatable(AnimatableLength(3rem), AnimatableLe ngth(4pt))"),
115 PrintToString(AnimatableRepeatable::create(v1))); 115 PrintToString(AnimatableRepeatable::create(v1)));
116 116
117 RefPtr<SVGLength> length1cm = SVGLength::create(LengthModeOther);
118 RefPtr<SVGLength> length2cm = SVGLength::create(LengthModeOther);
119 length1cm->setValueAsString("1cm", ASSERT_NO_EXCEPTION);
120 length2cm->setValueAsString("2cm", ASSERT_NO_EXCEPTION);
121
117 EXPECT_EQ( 122 EXPECT_EQ(
118 ::std::string("AnimatableSVGLength(1cm)"), 123 ::std::string("AnimatableSVGLength(1cm)"),
119 PrintToString(AnimatableSVGLength::create(SVGLength(LengthModeOther, "1c m")))); 124 PrintToString(AnimatableSVGLength::create(length1cm)));
120 125
121 EXPECT_EQ( 126 EXPECT_EQ(
122 ::std::string("AnimatableSVGPaint(#ff0000)"), 127 ::std::string("AnimatableSVGPaint(#ff0000)"),
123 PrintToString(AnimatableSVGPaint::create(SVGPaint::SVG_PAINTTYPE_RGBCOLO R, Color(0xFFFF0000), ""))); 128 PrintToString(AnimatableSVGPaint::create(SVGPaint::SVG_PAINTTYPE_RGBCOLO R, Color(0xFFFF0000), "")));
124 129
125 EXPECT_EQ( 130 EXPECT_EQ(
126 ::std::string("AnimatableSVGPaint(url(abc))"), 131 ::std::string("AnimatableSVGPaint(url(abc))"),
127 PrintToString(AnimatableSVGPaint::create(SVGPaint::SVG_PAINTTYPE_URI, Co lor(0xFFFF0000), "abc"))); 132 PrintToString(AnimatableSVGPaint::create(SVGPaint::SVG_PAINTTYPE_URI, Co lor(0xFFFF0000), "abc")));
128 133
129 EXPECT_THAT( 134 EXPECT_THAT(
130 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue( BasicShapeCircle::create().get()).get())), 135 PrintToString(AnimatableShapeValue::create(ShapeValue::createShapeValue( BasicShapeCircle::create().get()).get())),
131 testing::StartsWith("AnimatableShapeValue@")); 136 testing::StartsWith("AnimatableShapeValue@"));
132 137
133 Vector<SVGLength> v2; 138 RefPtr<SVGLengthList> l2 = SVGLengthList::create();
134 v2.append(SVGLength(LengthModeOther, "1cm")); 139 l2->append(length1cm);
135 v2.append(SVGLength(LengthModeOther, "2cm")); 140 l2->append(length2cm);
136 EXPECT_EQ( 141 EXPECT_EQ(
137 ::std::string("AnimatableStrokeDasharrayList(1cm, 2cm)"), 142 ::std::string("AnimatableStrokeDasharrayList(1cm, 2cm)"),
138 PrintToString(AnimatableStrokeDasharrayList::create(v2))); 143 PrintToString(AnimatableStrokeDasharrayList::create(l2)));
139 144
140 TransformOperations operations1; 145 TransformOperations operations1;
141 operations1.operations().append(TranslateTransformOperation::create(Length(2 , WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TranslateX)); 146 operations1.operations().append(TranslateTransformOperation::create(Length(2 , WebCore::Fixed), Length(0, WebCore::Fixed), TransformOperation::TranslateX));
142 EXPECT_EQ( 147 EXPECT_EQ(
143 ::std::string("AnimatableTransform([1 0 0 1 2 0])"), 148 ::std::string("AnimatableTransform([1 0 0 1 2 0])"),
144 PrintToString(AnimatableTransform::create(operations1))); 149 PrintToString(AnimatableTransform::create(operations1)));
145 150
146 TransformOperations operations2; 151 TransformOperations operations2;
147 operations2.operations().append(ScaleTransformOperation::create(1, 1, 1, Tra nsformOperation::Scale3D)); 152 operations2.operations().append(ScaleTransformOperation::create(1, 1, 1, Tra nsformOperation::Scale3D));
148 EXPECT_EQ( 153 EXPECT_EQ(
149 ::std::string("AnimatableTransform([1 0 0 1 0 0])"), 154 ::std::string("AnimatableTransform([1 0 0 1 0 0])"),
150 PrintToString(AnimatableTransform::create(operations2))); 155 PrintToString(AnimatableTransform::create(operations2)));
151 156
152 EXPECT_EQ( 157 EXPECT_EQ(
153 ::std::string("AnimatableUnknown(none)"), 158 ::std::string("AnimatableUnknown(none)"),
154 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif ier(CSSValueNone).get()))); 159 PrintToString(AnimatableUnknown::create(CSSPrimitiveValue::createIdentif ier(CSSValueNone).get())));
155 160
156 EXPECT_EQ( 161 EXPECT_EQ(
157 ::std::string("AnimatableVisibility(VISIBLE)"), 162 ::std::string("AnimatableVisibility(VISIBLE)"),
158 PrintToString(AnimatableVisibility::create(VISIBLE))); 163 PrintToString(AnimatableVisibility::create(VISIBLE)));
159 } 164 }
160 165
161 } // namespace 166 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/AnimatableValueTestHelper.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698