OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "cc/animation/animation_curve.h" | 9 #include "cc/animation/animation_curve.h" |
8 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
9 #include "cc/animation/scroll_offset_animation_curve.h" | 11 #include "cc/animation/scroll_offset_animation_curve.h" |
10 #include "cc/animation/timing_function.h" | 12 #include "cc/animation/timing_function.h" |
11 #include "cc/animation/transform_operations.h" | 13 #include "cc/animation/transform_operations.h" |
12 #include "cc/base/completion_event.h" | 14 #include "cc/base/completion_event.h" |
13 #include "cc/base/time_util.h" | 15 #include "cc/base/time_util.h" |
14 #include "cc/layers/layer.h" | 16 #include "cc/layers/layer.h" |
15 #include "cc/layers/layer_impl.h" | 17 #include "cc/layers/layer_impl.h" |
16 #include "cc/test/animation_test_common.h" | 18 #include "cc/test/animation_test_common.h" |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 } | 1297 } |
1296 | 1298 |
1297 void BeginTest() override { | 1299 void BeginTest() override { |
1298 PostAddLongAnimationToMainThread(picture_.get()); | 1300 PostAddLongAnimationToMainThread(picture_.get()); |
1299 } | 1301 } |
1300 | 1302 |
1301 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 1303 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
1302 Animation::TargetProperty target_property, | 1304 Animation::TargetProperty target_property, |
1303 int group) override { | 1305 int group) override { |
1304 called_animation_started_ = true; | 1306 called_animation_started_ = true; |
1305 layer_tree_host()->AnimateLayers( | 1307 layer_tree_host()->AnimateLayers(base::TimeTicks::FromInternalValue( |
1306 base::TimeTicks::FromInternalValue(std::numeric_limits<int64>::max())); | 1308 std::numeric_limits<int64_t>::max())); |
1307 PostSetNeedsCommitToMainThread(); | 1309 PostSetNeedsCommitToMainThread(); |
1308 } | 1310 } |
1309 | 1311 |
1310 void NotifyAnimationFinished(base::TimeTicks monotonic_time, | 1312 void NotifyAnimationFinished(base::TimeTicks monotonic_time, |
1311 Animation::TargetProperty target_property, | 1313 Animation::TargetProperty target_property, |
1312 int group) override { | 1314 int group) override { |
1313 called_animation_finished_ = true; | 1315 called_animation_finished_ = true; |
1314 EndTest(); | 1316 EndTest(); |
1315 } | 1317 } |
1316 | 1318 |
1317 void AfterTest() override { | 1319 void AfterTest() override { |
1318 EXPECT_TRUE(called_animation_started_); | 1320 EXPECT_TRUE(called_animation_started_); |
1319 EXPECT_TRUE(called_animation_finished_); | 1321 EXPECT_TRUE(called_animation_finished_); |
1320 } | 1322 } |
1321 | 1323 |
1322 private: | 1324 private: |
1323 bool called_animation_started_; | 1325 bool called_animation_started_; |
1324 bool called_animation_finished_; | 1326 bool called_animation_finished_; |
1325 FakeContentLayerClient client_; | 1327 FakeContentLayerClient client_; |
1326 scoped_refptr<FakePictureLayer> picture_; | 1328 scoped_refptr<FakePictureLayer> picture_; |
1327 }; | 1329 }; |
1328 | 1330 |
1329 SINGLE_AND_MULTI_THREAD_TEST_F( | 1331 SINGLE_AND_MULTI_THREAD_TEST_F( |
1330 LayerTreeHostAnimationTestNotifyAnimationFinished); | 1332 LayerTreeHostAnimationTestNotifyAnimationFinished); |
1331 | 1333 |
1332 } // namespace | 1334 } // namespace |
1333 } // namespace cc | 1335 } // namespace cc |
OLD | NEW |