| Index: third_party/WebKit/Source/modules/compositorworker/WorkletAnimationTest.cpp
|
| diff --git a/third_party/WebKit/Source/modules/compositorworker/WorkletAnimationTest.cpp b/third_party/WebKit/Source/modules/compositorworker/WorkletAnimationTest.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..41b58b4c5cc598d08370b640c641b661637f119f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/compositorworker/WorkletAnimationTest.cpp
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2017 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 "modules/compositorworker/WorkletAnimation.h"
|
| +
|
| +#include "bindings/core/v8/ExceptionState.h"
|
| +#include "bindings/core/v8/V8BindingForCore.h"
|
| +#include "bindings/core/v8/V8BindingForTesting.h"
|
| +#include "bindings/core/v8/V8ObjectBuilder.h"
|
| +#include "bindings/core/v8/serialization/SerializedScriptValue.h"
|
| +#include "core/animation/KeyframeEffectReadOnly.h"
|
| +#include "core/frame/Settings.h"
|
| +#include "core/testing/DummyPageHolder.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace blink {
|
| +
|
| +TEST(WorkletAnimationTest, CreateWorkletAnimation) {
|
| + V8TestingScope scope;
|
| + DummyExceptionStateForTesting exception_state;
|
| +
|
| + const HeapVector<Member<KeyframeEffectReadOnly>> effects;
|
| + HeapVector<DocumentTimelineOrScrollTimeline> timelines;
|
| +
|
| + V8ObjectBuilder builder(scope.GetScriptState());
|
| + builder.AddString("my_prop", "value");
|
| + v8::Local<v8::Object> worklet_options = builder.V8Value();
|
| +
|
| + SerializedScriptValue::SerializeOptions serialize_options;
|
| + RefPtr<SerializedScriptValue> serialized_worklet_options =
|
| + SerializedScriptValue::Serialize(scope.GetIsolate(), worklet_options,
|
| + serialize_options, exception_state);
|
| + ASSERT_FALSE(exception_state.HadException());
|
| +
|
| + WorkletAnimation* animation = WorkletAnimation::Create(
|
| + "Test", effects, timelines, std::move(serialized_worklet_options),
|
| + exception_state);
|
| + ASSERT_TRUE(animation);
|
| +}
|
| +
|
| +} // namespace blink
|
|
|