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

Unified Diff: Source/core/animation/AnimatableStrokeDasharrayListTest.cpp

Issue 27572003: Fix assert failure in AnimatableStrokeDasharrayList::equalTo() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/AnimatableStrokeDasharrayListTest.cpp
diff --git a/Source/core/animation/AnimatableNeutralTest.cpp b/Source/core/animation/AnimatableStrokeDasharrayListTest.cpp
similarity index 67%
copy from Source/core/animation/AnimatableNeutralTest.cpp
copy to Source/core/animation/AnimatableStrokeDasharrayListTest.cpp
index 07469620675c55dfbf4e852b1f3ec9e611f8fd1a..b688075c1bf8eabbe178f20c61153db5c5b6ff0e 100644
--- a/Source/core/animation/AnimatableNeutralTest.cpp
+++ b/Source/core/animation/AnimatableStrokeDasharrayListTest.cpp
@@ -29,10 +29,9 @@
*/
#include "config.h"
-#include "core/animation/AnimatableNeutral.h"
+#include "core/animation/AnimatableStrokeDasharrayList.h"
-#include "core/animation/AnimatableUnknown.h"
-#include "core/css/CSSArrayFunctionValue.h"
+#include "core/svg/SVGLength.h"
#include <gtest/gtest.h>
@@ -40,18 +39,22 @@ using namespace WebCore;
namespace {
-TEST(AnimatableNeutral, Create)
+TEST(CoreAnimationAnimatableStrokeDasharrayListTest, EqualTo)
alancutter (OOO until 2018) 2013/10/18 00:11:47 Using the new naming scheme https://codereview.chr
{
- EXPECT_TRUE(AnimatableValue::neutralValue());
+ Vector<SVGLength> vectorA(4);
+ Vector<SVGLength> vectorB(4);
+ RefPtr<AnimatableStrokeDasharrayList> listA = AnimatableStrokeDasharrayList::create(vectorA);
+ RefPtr<AnimatableStrokeDasharrayList> listB = AnimatableStrokeDasharrayList::create(vectorB);
+ EXPECT_TRUE(listA->equals(listB.get()));
+
+ TrackExceptionState es;
+ vectorB[3].newValueSpecifiedUnits(LengthTypePX, 50, es);
+ listB = AnimatableStrokeDasharrayList::create(vectorB);
+ EXPECT_FALSE(listA->equals(listB.get()));
+
+ vectorB = Vector<SVGLength>(5);
+ listB = AnimatableStrokeDasharrayList::create(vectorB);
+ EXPECT_FALSE(listA->equals(listB.get()));
}
-TEST(AnimatableNeutral, Add)
-{
- RefPtr<CSSValue> cssValue = CSSArrayFunctionValue::create();
- RefPtr<AnimatableValue> animatableUnknown = AnimatableUnknown::create(cssValue);
-
- EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::add(animatableUnknown.get(), AnimatableValue::neutralValue()).get())->toCSSValue());
- EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::add(AnimatableValue::neutralValue(), animatableUnknown.get()).get())->toCSSValue());
-}
-
-}
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698