OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/dom/ScriptedAnimationController.h" | 5 #include "core/dom/ScriptedAnimationController.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
8 #include "core/dom/FrameRequestCallback.h" | 9 #include "core/dom/FrameRequestCallback.h" |
9 #include "core/events/Event.h" | 10 #include "core/events/Event.h" |
10 #include "core/events/EventListener.h" | 11 #include "core/events/EventListener.h" |
11 #include "core/events/EventTarget.h" | 12 #include "core/events/EventTarget.h" |
12 #include "core/testing/DummyPageHolder.h" | 13 #include "core/testing/DummyPageHolder.h" |
13 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "wtf/Functional.h" | 17 #include "wtf/Functional.h" |
17 #include <memory> | |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 class ScriptedAnimationControllerTest : public ::testing::Test { | 21 class ScriptedAnimationControllerTest : public ::testing::Test { |
22 protected: | 22 protected: |
23 void SetUp() override; | 23 void SetUp() override; |
24 | 24 |
25 Document& document() const { return m_dummyPageHolder->document(); } | 25 Document& document() const { return m_dummyPageHolder->document(); } |
26 ScriptedAnimationController& controller() { return *m_controller; } | 26 ScriptedAnimationController& controller() { return *m_controller; } |
27 | 27 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 controller().enqueueTask(observer.createTask(2)); | 176 controller().enqueueTask(observer.createTask(2)); |
177 EXPECT_EQ(0u, observer.order().size()); | 177 EXPECT_EQ(0u, observer.order().size()); |
178 | 178 |
179 controller().serviceScriptedAnimations(0); | 179 controller().serviceScriptedAnimations(0); |
180 EXPECT_EQ(2u, observer.order().size()); | 180 EXPECT_EQ(2u, observer.order().size()); |
181 EXPECT_EQ(2, observer.order()[0]); | 181 EXPECT_EQ(2, observer.order()[0]); |
182 EXPECT_EQ(1, observer.order()[1]); | 182 EXPECT_EQ(1, observer.order()[1]); |
183 } | 183 } |
184 | 184 |
185 } // namespace blink | 185 } // namespace blink |
OLD | NEW |