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

Unified Diff: Source/core/animation/AnimationTest.cpp

Issue 183803017: Revert of Ensure DOMWrapperWorld always exists in all webkit_unit_tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/WorkerScriptController.cpp ('k') | Source/core/animation/AnimationTimingInputTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationTest.cpp
diff --git a/Source/core/animation/AnimationTest.cpp b/Source/core/animation/AnimationTest.cpp
index a281a20dc7237dcd9a0975e7452640538882d75f..beaae605149f07786aca0f6cc05fe5247f832345 100644
--- a/Source/core/animation/AnimationTest.cpp
+++ b/Source/core/animation/AnimationTest.cpp
@@ -36,10 +36,17 @@
class AnimationAnimationV8Test : public AnimationAnimationTest {
protected:
AnimationAnimationV8Test()
- : m_isolate(v8::Isolate::GetCurrent())
- , m_scope(V8BindingTestScope::create(m_isolate))
- {
- }
+ : isolate(v8::Isolate::GetCurrent())
+ , scope(isolate)
+ , context(v8::Context::New(isolate))
+ , contextScope(context)
+ {
+ }
+
+ v8::Isolate* isolate;
+ v8::HandleScope scope;
+ v8::Local<v8::Context> context;
+ v8::Context::Scope contextScope;
PassRefPtr<Animation> createAnimation(Element* element, Vector<Dictionary> keyframeDictionaryVector, Dictionary timingInput)
{
@@ -55,18 +62,13 @@
{
return Animation::createUnsafe(element, keyframeDictionaryVector);
}
-
- v8::Isolate* m_isolate;
-
-private:
- OwnPtr<V8BindingTestScope> m_scope;
};
TEST_F(AnimationAnimationV8Test, CanCreateAnAnimation)
{
Vector<Dictionary> jsKeyframes;
- v8::Handle<v8::Object> keyframe1 = v8::Object::New(m_isolate);
- v8::Handle<v8::Object> keyframe2 = v8::Object::New(m_isolate);
+ v8::Handle<v8::Object> keyframe1 = v8::Object::New(isolate);
+ v8::Handle<v8::Object> keyframe2 = v8::Object::New(isolate);
setV8ObjectPropertyAsString(keyframe1, "width", "100px");
setV8ObjectPropertyAsString(keyframe1, "offset", "0");
@@ -75,8 +77,8 @@
setV8ObjectPropertyAsString(keyframe2, "offset", "1");
setV8ObjectPropertyAsString(keyframe2, "easing", "cubic-bezier(1, 1, 0.3, 0.3)");
- jsKeyframes.append(Dictionary(keyframe1, m_isolate));
- jsKeyframes.append(Dictionary(keyframe2, m_isolate));
+ jsKeyframes.append(Dictionary(keyframe1, isolate));
+ jsKeyframes.append(Dictionary(keyframe2, isolate));
String value1;
ASSERT_TRUE(jsKeyframes[0].get("width", value1));
@@ -140,7 +142,7 @@
{
Vector<Dictionary, 0> jsKeyframes;
- v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate);
+ v8::Handle<v8::Object> timingInput = v8::Object::New(isolate);
setV8ObjectPropertyAsNumber(timingInput, "delay", 2);
setV8ObjectPropertyAsNumber(timingInput, "endDelay", 0.5);
setV8ObjectPropertyAsString(timingInput, "fill", "backwards");
@@ -149,7 +151,7 @@
setV8ObjectPropertyAsNumber(timingInput, "playbackRate", 2);
setV8ObjectPropertyAsString(timingInput, "direction", "reverse");
setV8ObjectPropertyAsString(timingInput, "easing", "step-start");
- Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate);
+ Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), isolate);
RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, timingInputDictionary);
@@ -168,9 +170,9 @@
{
Vector<Dictionary, 0> jsKeyframes;
- v8::Handle<v8::Object> timingInputWithDuration = v8::Object::New(m_isolate);
+ v8::Handle<v8::Object> timingInputWithDuration = v8::Object::New(isolate);
setV8ObjectPropertyAsNumber(timingInputWithDuration, "duration", 2.5);
- Dictionary timingInputDictionaryWithDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputWithDuration), m_isolate);
+ Dictionary timingInputDictionaryWithDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputWithDuration), isolate);
RefPtr<Animation> animationWithDuration = createAnimation(element.get(), jsKeyframes, timingInputDictionaryWithDuration);
@@ -186,8 +188,8 @@
EXPECT_EQ("", stringDuration);
- v8::Handle<v8::Object> timingInputNoDuration = v8::Object::New(m_isolate);
- Dictionary timingInputDictionaryNoDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputNoDuration), m_isolate);
+ v8::Handle<v8::Object> timingInputNoDuration = v8::Object::New(isolate);
+ Dictionary timingInputDictionaryNoDuration = Dictionary(v8::Handle<v8::Value>::Cast(timingInputNoDuration), isolate);
RefPtr<Animation> animationNoDuration = createAnimation(element.get(), jsKeyframes, timingInputDictionaryNoDuration);
@@ -206,8 +208,8 @@
TEST_F(AnimationAnimationV8Test, SpecifiedSetters)
{
Vector<Dictionary, 0> jsKeyframes;
- v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate);
- Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate);
+ v8::Handle<v8::Object> timingInput = v8::Object::New(isolate);
+ Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), isolate);
RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, timingInputDictionary);
RefPtr<TimedItemTiming> specified = animation->specified();
@@ -248,8 +250,8 @@
TEST_F(AnimationAnimationV8Test, SetSpecifiedDuration)
{
Vector<Dictionary, 0> jsKeyframes;
- v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate);
- Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), m_isolate);
+ v8::Handle<v8::Object> timingInput = v8::Object::New(isolate);
+ Dictionary timingInputDictionary = Dictionary(v8::Handle<v8::Value>::Cast(timingInput), isolate);
RefPtr<Animation> animation = createAnimation(element.get(), jsKeyframes, timingInputDictionary);
RefPtr<TimedItemTiming> specified = animation->specified();
« no previous file with comments | « Source/bindings/v8/WorkerScriptController.cpp ('k') | Source/core/animation/AnimationTimingInputTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698