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

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

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: (Hopefully) Builds with oilpan now Created 5 years, 6 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 23 matching lines...) Expand all
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 36
37 #include <gtest/gtest.h> 37 #include <gtest/gtest.h>
38 38
39 using namespace blink; 39 using namespace blink;
40 40
41 namespace { 41 namespace {
42 42
43 class AnimationAnimatableUnknownTest : public ::testing::Test { 43 class AnimationAnimatableUnknownTest : public ::testing::Test {
44 public:
45 AnimationAnimatableUnknownTest()
46 : cssValue(cssValuePool().createIdentifierValue(CSSValueYellow)),
47 otherCSSValue(cssValuePool().createIdentifierValue(CSSValueOrange)) { };
44 protected: 48 protected:
45 virtual void SetUp() 49 virtual void SetUp()
46 { 50 {
47 cssValue = cssValuePool().createIdentifierValue(CSSValueYellow); 51 cssValue = cssValuePool().createIdentifierValue(CSSValueYellow);
48 animatableUnknown = AnimatableUnknown::create(cssValue); 52 animatableUnknown = AnimatableUnknown::create(cssValue);
49 53
50 otherCSSValue = cssValuePool().createIdentifierValue(CSSValueOrange); 54 otherCSSValue = cssValuePool().createIdentifierValue(CSSValueOrange);
51 otherAnimatableUnknown = AnimatableUnknown::create(otherCSSValue); 55 otherAnimatableUnknown = AnimatableUnknown::create(otherCSSValue);
52 } 56 }
53 57
54 RefPtrWillBePersistent<CSSValue> cssValue; 58 CSSValue cssValue;
55 RefPtrWillBePersistent<AnimatableValue> animatableUnknown; 59 RefPtrWillBePersistent<AnimatableValue> animatableUnknown;
56 RefPtrWillBePersistent<CSSValue> otherCSSValue; 60 CSSValue otherCSSValue;
haraken 2015/06/11 02:48:53 This looks wrong. What you're doing here is: clas
haraken 2015/06/11 02:48:53 oilpan-reviews@: The GC plugin must detect this er
sashab 2015/06/11 23:05:34 In this case I could just remove the test fixture
sof 2015/06/12 05:10:04 This is an anonymous namespace, where the GC plugi
sof 2015/06/12 10:48:08 That quirk has now been removed, http://crbug.com/
57 RefPtrWillBePersistent<AnimatableValue> otherAnimatableUnknown; 61 RefPtrWillBePersistent<AnimatableValue> otherAnimatableUnknown;
58 }; 62 };
59 63
60 TEST_F(AnimationAnimatableUnknownTest, Create) 64 TEST_F(AnimationAnimatableUnknownTest, Create)
61 { 65 {
62 EXPECT_TRUE(animatableUnknown); 66 EXPECT_TRUE(animatableUnknown);
63 } 67 }
64 68
65 TEST_F(AnimationAnimatableUnknownTest, ToCSSValue) 69 TEST_F(AnimationAnimatableUnknownTest, ToCSSValue)
66 { 70 {
67 EXPECT_EQ(cssValue, toAnimatableUnknown(animatableUnknown.get())->toCSSValue ()); 71 EXPECT_EQ(cssValue, toAnimatableUnknown(animatableUnknown.get())->toCSSValue ());
68 } 72 }
69 73
70 TEST_F(AnimationAnimatableUnknownTest, Interpolate) 74 TEST_F(AnimationAnimatableUnknownTest, Interpolate)
71 { 75 {
72 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animata bleUnknown.get(), otherAnimatableUnknown.get(), 0).get())->toCSSValue()); 76 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animata bleUnknown.get(), otherAnimatableUnknown.get(), 0).get())->toCSSValue());
73 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animata bleUnknown.get(), otherAnimatableUnknown.get(), 0.4).get())->toCSSValue()); 77 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(animata bleUnknown.get(), otherAnimatableUnknown.get(), 0.4).get())->toCSSValue());
74 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 0.5).get())->toCSSValue()); 78 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 0.5).get())->toCSSValue());
75 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 0.6).get())->toCSSValue()); 79 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 0.6).get())->toCSSValue());
76 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 1).get())->toCSSValue()); 80 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(an imatableUnknown.get(), otherAnimatableUnknown.get(), 1).get())->toCSSValue());
77 81
78 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(ot herAnimatableUnknown.get(), animatableUnknown.get(), 0).get())->toCSSValue()); 82 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(ot herAnimatableUnknown.get(), animatableUnknown.get(), 0).get())->toCSSValue());
79 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(ot herAnimatableUnknown.get(), animatableUnknown.get(), 0.4).get())->toCSSValue()); 83 EXPECT_EQ(otherCSSValue, toAnimatableUnknown(AnimatableValue::interpolate(ot herAnimatableUnknown.get(), animatableUnknown.get(), 0.4).get())->toCSSValue());
80 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 0.5).get())->toCSSValue()); 84 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 0.5).get())->toCSSValue());
81 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 0.6).get())->toCSSValue()); 85 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 0.6).get())->toCSSValue());
82 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 1).get())->toCSSValue()); 86 EXPECT_EQ(cssValue, toAnimatableUnknown(AnimatableValue::interpolate(otherAn imatableUnknown.get(), animatableUnknown.get(), 1).get())->toCSSValue());
83 } 87 }
84 88
85 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698