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

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

Issue 1225553002: CSSValue Immediates: Make CSSPrimitiveValue a container (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 years, 4 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
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 21 matching lines...) Expand all
32 #include "core/animation/animatable/AnimatableUnknown.h" 32 #include "core/animation/animatable/AnimatableUnknown.h"
33 33
34 #include "core/animation/animatable/AnimatableNeutral.h" 34 #include "core/animation/animatable/AnimatableNeutral.h"
35 #include "core/css/CSSValuePool.h" 35 #include "core/css/CSSValuePool.h"
36 #include <gtest/gtest.h> 36 #include <gtest/gtest.h>
37 37
38 namespace blink { 38 namespace blink {
39 39
40 TEST(AnimationAnimatableUnknownTest, Create) 40 TEST(AnimationAnimatableUnknownTest, Create)
41 { 41 {
42 CSSValue cssValue = cssValuePool().createIdentifierValue(CSSValueYellow); 42 CSSPrimitiveValue cssValue = cssValuePool().createIdentifierValue(CSSValueYe llow);
43 EXPECT_TRUE(AnimatableUnknown::create(cssValue)); 43 EXPECT_TRUE(AnimatableUnknown::create(cssValue));
44 } 44 }
45 45
46 TEST(AnimationAnimatableUnknownTest, ToCSSValue) 46 TEST(AnimationAnimatableUnknownTest, ToCSSValue)
47 { 47 {
48 CSSValue cssValue = cssValuePool().createIdentifierValue(CSSValueYellow); 48 CSSPrimitiveValue cssValue = cssValuePool().createIdentifierValue(CSSValueYe llow);
49 EXPECT_EQ(cssValue, AnimatableUnknown::create(cssValue)->toCSSValue()); 49 EXPECT_EQ(CSSValue(cssValue), CSSValue(AnimatableUnknown::create(cssValue)-> toCSSValue()));
50 } 50 }
51 51
52 TEST(AnimationAnimatableUnknownTest, Interpolate) 52 TEST(AnimationAnimatableUnknownTest, Interpolate)
53 { 53 {
54 CSSValue cssValue = cssValuePool().createIdentifierValue(CSSValueYellow); 54 CSSPrimitiveValue cssValue = cssValuePool().createIdentifierValue(CSSValueYe llow);
55 CSSValue otherCSSValue = cssValuePool().createIdentifierValue(CSSValueOrange ); 55 CSSPrimitiveValue otherCSSValue = cssValuePool().createIdentifierValue(CSSVa lueOrange);
56 RefPtrWillBePersistent<AnimatableValue> animatableUnknown = AnimatableUnknow n::create(cssValue); 56 RefPtrWillBePersistent<AnimatableValue> animatableUnknown = AnimatableUnknow n::create(cssValue);
57 RefPtrWillBePersistent<AnimatableValue> otherAnimatableUnknown = AnimatableU nknown::create(otherCSSValue); 57 RefPtrWillBePersistent<AnimatableValue> otherAnimatableUnknown = AnimatableU nknown::create(otherCSSValue);
58 58
59 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animata bleUnknown.get(), otherAnimatableUnknown.get(), 0).get())->toCSSValue()); 59 EXPECT_EQ(CSSValue(cssValue), CSSValue(toAnimatableUnknown(AnimatableValue:: interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0).get())->to CSSValue()));
60 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animata bleUnknown.get(), otherAnimatableUnknown.get(), 0.4).get())->toCSSValue()); 60 EXPECT_EQ(CSSValue(cssValue), CSSValue(toAnimatableUnknown(AnimatableValue:: interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0.4).get())-> toCSSValue()));
61 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 0.5).get())->toCSSValue()); 61 EXPECT_EQ(CSSValue(otherCSSValue), CSSValue(toAnimatableUnknown(AnimatableVa lue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0.5).get ())->toCSSValue()));
62 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 0.6).get())->toCSSValue()); 62 EXPECT_EQ(CSSValue(otherCSSValue), CSSValue(toAnimatableUnknown(AnimatableVa lue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 0.6).get ())->toCSSValue()));
63 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 1).get())->toCSSValue()); 63 EXPECT_EQ(CSSValue(otherCSSValue), CSSValue(toAnimatableUnknown(AnimatableVa lue::interpolate(animatableUnknown.get(), otherAnimatableUnknown.get(), 1).get() )->toCSSValue()));
64 64
65 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(ot herAnimatableUnknown.get(), animatableUnknown.get(), 0).get())->toCSSValue()); 65 EXPECT_EQ(CSSValue(otherCSSValue), CSSValue(toAnimatableUnknown(AnimatableVa lue::interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0).get() )->toCSSValue()));
66 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(ot herAnimatableUnknown.get(), animatableUnknown.get(), 0.4).get())->toCSSValue()); 66 EXPECT_EQ(CSSValue(otherCSSValue), CSSValue(toAnimatableUnknown(AnimatableVa lue::interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0.4).get ())->toCSSValue()));
67 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 0.5).get())->toCSSValue()); 67 EXPECT_EQ(CSSValue(cssValue), CSSValue(toAnimatableUnknown(AnimatableValue:: interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0.5).get())-> toCSSValue()));
68 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 0.6).get())->toCSSValue()); 68 EXPECT_EQ(CSSValue(cssValue), CSSValue(toAnimatableUnknown(AnimatableValue:: interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 0.6).get())-> toCSSValue()));
69 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 1).get())->toCSSValue()); 69 EXPECT_EQ(CSSValue(cssValue), CSSValue(toAnimatableUnknown(AnimatableValue:: interpolate(otherAnimatableUnknown.get(), animatableUnknown.get(), 1).get())->to CSSValue()));
70 } 70 }
71 71
72 } // namespace blink 72 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/animatable/AnimatableUnknown.h ('k') | Source/core/css/BasicShapeFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698