diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp b/chromium/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp new file mode 100644 index 00000000000..12f4e378527 --- /dev/null +++ b/chromium/third_party/WebKit/Source/core/animation/AnimationTestHelper.cpp @@ -0,0 +1,32 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "config.h" +#include "core/animation/AnimationTestHelper.h" + +#include "bindings/v8/V8Binding.h" + +namespace WebCore { + +v8::Handle<v8::Value> stringToV8Value(String string) +{ + return v8::Handle<v8::Value>::Cast(v8String(v8::Isolate::GetCurrent(), string)); +} + +v8::Handle<v8::Value> doubleToV8Value(double number) +{ + return v8::Handle<v8::Value>::Cast(v8::Number::New(v8::Isolate::GetCurrent(), number)); +} + +void setV8ObjectPropertyAsString(v8::Handle<v8::Object> object, String name, String value) +{ + object->Set(stringToV8Value(name), stringToV8Value(value)); +} + +void setV8ObjectPropertyAsNumber(v8::Handle<v8::Object> object, String name, double value) +{ + object->Set(stringToV8Value(name), doubleToV8Value(value)); +} + +} // namespace WebCore |