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

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

Issue 15405006: Modify AnimationEffect::sample() to return a CompositableValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix rebase Created 7 years, 7 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/AnimationEffect.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 25 matching lines...) Expand all
36 #include "core/dom/Element.h" 36 #include "core/dom/Element.h"
37 #include "core/dom/QualifiedName.h" 37 #include "core/dom/QualifiedName.h"
38 #include "core/platform/KURL.h" 38 #include "core/platform/KURL.h"
39 39
40 #include <gtest/gtest.h> 40 #include <gtest/gtest.h>
41 41
42 using namespace WebCore; 42 using namespace WebCore;
43 43
44 namespace { 44 namespace {
45 45
46 class EmptyAnimationEffect : public AnimationEffect {
47 public:
48 static PassRefPtr<EmptyAnimationEffect> create()
49 {
50 return adoptRef(new EmptyAnimationEffect);
51 }
52 virtual PassOwnPtr<CompositableValueMap> sample(int iteration, double fracti on) const
53 {
54 return adoptPtr(new CompositableValueMap);
55 }
56 private:
57 EmptyAnimationEffect() { }
58 };
59
46 TEST(DocumentTimeline, AddAnAnimation) 60 TEST(DocumentTimeline, AddAnAnimation)
47 { 61 {
48 RefPtr<Document> d = Document::create(0, KURL()); 62 RefPtr<Document> d = Document::create(0, KURL());
49 RefPtr<Element> e = Element::create(nullQName() , d.get()); 63 RefPtr<Element> e = Element::create(nullQName() , d.get());
50 RefPtr<DocumentTimeline> timeline = DocumentTimeline::create(d.get()); 64 RefPtr<DocumentTimeline> timeline = DocumentTimeline::create(d.get());
51 Timing timing; 65 Timing timing;
52 RefPtr<Animation> anim = Animation::create(e.get(), AnimationEffect::create( ), timing); 66 RefPtr<Animation> anim = Animation::create(e.get(), EmptyAnimationEffect::cr eate(), timing);
53 timeline->play(anim); 67 timeline->play(anim);
54 timeline->serviceAnimations(0); 68 timeline->serviceAnimations(0);
55 StylePropertySet* styleSet = anim->cachedStyle(); 69 ASSERT_TRUE(anim->compositableValues()->isEmpty());
56 ASSERT_EQ(0u, styleSet->propertyCount());
57 } 70 }
58 71
59 } 72 }
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationEffect.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698