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

Side by Side Diff: third_party/WebKit/Source/core/animation/EffectInputTest.cpp

Issue 1720403002: Alternative syntax for element.animate list of keyframes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@animations-keyframeeffect-api
Patch Set: Additional (mismatched-length-list) test; ensure offset is initialized Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/animation/EffectInput.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/animation/EffectInput.h" 5 #include "core/animation/EffectInput.h"
6 6
7 #include "bindings/core/v8/Dictionary.h" 7 #include "bindings/core/v8/Dictionary.h"
8 #include "bindings/core/v8/V8BindingForTesting.h" 8 #include "bindings/core/v8/V8BindingForTesting.h"
9 #include "core/animation/AnimationTestHelper.h" 9 #include "core/animation/AnimationTestHelper.h"
10 #include "core/animation/KeyframeEffectModel.h" 10 #include "core/animation/KeyframeEffectModel.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 setV8ObjectPropertyAsString(m_isolate, keyframe1, "width", "0px"); 66 setV8ObjectPropertyAsString(m_isolate, keyframe1, "width", "0px");
67 setV8ObjectPropertyAsString(m_isolate, keyframe1, "offset", "1"); 67 setV8ObjectPropertyAsString(m_isolate, keyframe1, "offset", "1");
68 setV8ObjectPropertyAsString(m_isolate, keyframe2, "width", "100px"); 68 setV8ObjectPropertyAsString(m_isolate, keyframe2, "width", "100px");
69 setV8ObjectPropertyAsString(m_isolate, keyframe2, "offset", "0"); 69 setV8ObjectPropertyAsString(m_isolate, keyframe2, "offset", "0");
70 70
71 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); 71 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState));
72 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); 72 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState));
73 73
74 EffectInput::convert(element.get(), EffectModelOrDictionarySequenceOrDiction ary::fromDictionarySequence(jsKeyframes), exceptionState); 74 EffectInput::convert(element.get(), EffectModelOrDictionarySequenceOrDiction ary::fromDictionarySequence(jsKeyframes), exceptionState);
75 EXPECT_TRUE(exceptionState.hadException()); 75 EXPECT_TRUE(exceptionState.hadException());
76 EXPECT_EQ(InvalidModificationError, exceptionState.code()); 76 EXPECT_EQ(V8TypeError, exceptionState.code());
77 } 77 }
78 78
79 TEST_F(AnimationEffectInputTest, LooslySorted) 79 TEST_F(AnimationEffectInputTest, LooslySorted)
80 { 80 {
81 Vector<Dictionary> jsKeyframes; 81 Vector<Dictionary> jsKeyframes;
82 v8::Local<v8::Object> keyframe1 = v8::Object::New(m_isolate); 82 v8::Local<v8::Object> keyframe1 = v8::Object::New(m_isolate);
83 v8::Local<v8::Object> keyframe2 = v8::Object::New(m_isolate); 83 v8::Local<v8::Object> keyframe2 = v8::Object::New(m_isolate);
84 v8::Local<v8::Object> keyframe3 = v8::Object::New(m_isolate); 84 v8::Local<v8::Object> keyframe3 = v8::Object::New(m_isolate);
85 85
86 setV8ObjectPropertyAsString(m_isolate, keyframe1, "width", "100px"); 86 setV8ObjectPropertyAsString(m_isolate, keyframe1, "width", "100px");
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 setV8ObjectPropertyAsString(m_isolate, keyframe2, "width", "200px"); 137 setV8ObjectPropertyAsString(m_isolate, keyframe2, "width", "200px");
138 setV8ObjectPropertyAsString(m_isolate, keyframe3, "width", "100px"); 138 setV8ObjectPropertyAsString(m_isolate, keyframe3, "width", "100px");
139 setV8ObjectPropertyAsString(m_isolate, keyframe3, "offset", "0"); 139 setV8ObjectPropertyAsString(m_isolate, keyframe3, "offset", "0");
140 140
141 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); 141 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState));
142 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); 142 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState));
143 jsKeyframes.append(Dictionary(keyframe3, m_isolate, exceptionState)); 143 jsKeyframes.append(Dictionary(keyframe3, m_isolate, exceptionState));
144 144
145 EffectInput::convert(element.get(), EffectModelOrDictionarySequenceOrDiction ary::fromDictionarySequence(jsKeyframes), exceptionState); 145 EffectInput::convert(element.get(), EffectModelOrDictionarySequenceOrDiction ary::fromDictionarySequence(jsKeyframes), exceptionState);
146 EXPECT_TRUE(exceptionState.hadException()); 146 EXPECT_TRUE(exceptionState.hadException());
147 EXPECT_EQ(InvalidModificationError, exceptionState.code()); 147 EXPECT_EQ(V8TypeError, exceptionState.code());
148 } 148 }
149 149
150 } // namespace blink 150 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/EffectInput.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698