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

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

Issue 209433004: Do not zero-initialize RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compilation on gcc and msvc Created 6 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
« no previous file with comments | « Source/bindings/v8/V8Binding.cpp ('k') | Source/core/animation/css/CSSAnimations.cpp » ('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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 RefPtrWillBeRawPtr<Keyframe> keyframe = Keyframe::create(); 143 RefPtrWillBeRawPtr<Keyframe> keyframe = Keyframe::create();
144 keyframe->setPropertyValue(id, value); 144 keyframe->setPropertyValue(id, value);
145 keyframe->setComposite(AnimationEffect::CompositeReplace); 145 keyframe->setComposite(AnimationEffect::CompositeReplace);
146 keyframe->setOffset(offset); 146 keyframe->setOffset(offset);
147 keyframe->setEasing(LinearTimingFunction::preset()); 147 keyframe->setEasing(LinearTimingFunction::preset());
148 return keyframe; 148 return keyframe;
149 } 149 }
150 150
151 PassRefPtrWillBeRawPtr<Keyframe> createDefaultKeyframe(CSSPropertyID id, Ani mationEffect::CompositeOperation op, double offset = 0) 151 PassRefPtrWillBeRawPtr<Keyframe> createDefaultKeyframe(CSSPropertyID id, Ani mationEffect::CompositeOperation op, double offset = 0)
152 { 152 {
153 RefPtrWillBeRawPtr<AnimatableValue> value; 153 RefPtrWillBeRawPtr<AnimatableValue> value = nullptr;
154 if (id == CSSPropertyWebkitTransform) 154 if (id == CSSPropertyWebkitTransform)
155 value = AnimatableTransform::create(TransformOperations()); 155 value = AnimatableTransform::create(TransformOperations());
156 else 156 else
157 value = AnimatableDouble::create(10.0); 157 value = AnimatableDouble::create(10.0);
158 158
159 RefPtrWillBeRawPtr<Keyframe> keyframe = createReplaceOpKeyframe(id, valu e.get(), offset); 159 RefPtrWillBeRawPtr<Keyframe> keyframe = createReplaceOpKeyframe(id, valu e.get(), offset);
160 keyframe->setComposite(op); 160 keyframe->setComposite(op);
161 return keyframe; 161 return keyframe;
162 } 162 }
163 163
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 if (d) { 200 if (d) {
201 frames.append(d); 201 frames.append(d);
202 EXPECT_LE(c->offset(), d->offset()); 202 EXPECT_LE(c->offset(), d->offset());
203 EXPECT_EQ(d->offset(), 1.0); 203 EXPECT_EQ(d->offset(), 1.0);
204 } else { 204 } else {
205 EXPECT_EQ(to->offset(), 1.0); 205 EXPECT_EQ(to->offset(), 1.0);
206 } 206 }
207 if (!HasFatalFailure()) { 207 if (!HasFatalFailure()) {
208 return KeyframeEffectModel::create(frames); 208 return KeyframeEffectModel::create(frames);
209 } 209 }
210 return PassRefPtrWillBeRawPtr<KeyframeEffectModel>(); 210 return nullptr;
211 } 211 }
212 212
213 }; 213 };
214 214
215 // ----------------------------------------------------------------------- 215 // -----------------------------------------------------------------------
216 // ----------------------------------------------------------------------- 216 // -----------------------------------------------------------------------
217 217
218 TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKey frameMultipleCSSProperties) 218 TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKey frameMultipleCSSProperties)
219 { 219 {
220 RefPtrWillBeRawPtr<Keyframe> keyframeGoodMultiple = createDefaultKeyframe(CS SPropertyOpacity, AnimationEffect::CompositeReplace); 220 RefPtrWillBeRawPtr<Keyframe> keyframeGoodMultiple = createDefaultKeyframe(CS SPropertyOpacity, AnimationEffect::CompositeReplace);
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 // Go! 900 // Go!
901 setCompositorForTesting(mockCompositor); 901 setCompositorForTesting(mockCompositor);
902 Vector<OwnPtr<blink::WebAnimation> > result; 902 Vector<OwnPtr<blink::WebAnimation> > result;
903 getAnimationOnCompositor(m_timing, *effect.get(), result); 903 getAnimationOnCompositor(m_timing, *effect.get(), result);
904 EXPECT_EQ(1U, result.size()); 904 EXPECT_EQ(1U, result.size());
905 result[0].clear(); 905 result[0].clear();
906 } 906 }
907 907
908 908
909 } // namespace WebCore 909 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Binding.cpp ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698