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

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/WorkletAnimationTest.cpp

Issue 2869183002: Initial implementation of WorkletAnimation (Closed)
Patch Set: Rebase Created 3 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "modules/compositorworker/WorkletAnimation.h"
6
7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/V8BindingForCore.h"
9 #include "bindings/core/v8/V8BindingForTesting.h"
10 #include "bindings/core/v8/V8ObjectBuilder.h"
11 #include "bindings/core/v8/serialization/SerializedScriptValue.h"
12 #include "core/animation/KeyframeEffectReadOnly.h"
13 #include "core/frame/Settings.h"
14 #include "core/testing/DummyPageHolder.h"
15 #include "testing/gtest/include/gtest/gtest.h"
16
17 namespace blink {
18
19 TEST(WorkletAnimationTest, CreateWorkletAnimation) {
alancutter (OOO until 2018) 2017/06/26 11:57:02 Please add tests like this under LayoutTests/virtu
20 V8TestingScope scope;
21 DummyExceptionStateForTesting exception_state;
22
23 const HeapVector<Member<KeyframeEffectReadOnly>> effects;
24 HeapVector<DocumentTimelineOrScrollTimeline> timelines;
25
26 V8ObjectBuilder builder(scope.GetScriptState());
27 builder.AddString("my_prop", "value");
28 v8::Local<v8::Object> worklet_options = builder.V8Value();
29
30 SerializedScriptValue::SerializeOptions serialize_options;
31 RefPtr<SerializedScriptValue> serialized_worklet_options =
32 SerializedScriptValue::Serialize(scope.GetIsolate(), worklet_options,
33 serialize_options, exception_state);
34 ASSERT_FALSE(exception_state.HadException());
35
36 WorkletAnimation* animation = WorkletAnimation::Create(
37 "Test", effects, timelines, std::move(serialized_worklet_options),
38 exception_state);
39 ASSERT_TRUE(animation);
40 }
41
42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698