| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/view_manager/animation_runner.h" | 5 #include "services/view_manager/animation_runner.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "mojo/converters/geometry/geometry_type_converters.h" | 8 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 9 #include "mojo/services/view_manager/interfaces/view_manager_constants.mojom.h" | 9 #include "mojo/services/view_manager/interfaces/view_manager_constants.mojom.h" |
| 10 #include "services/view_manager/animation_runner_observer.h" | 10 #include "services/view_manager/animation_runner_observer.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 std::vector<uint32_t> change_ids_; | 61 std::vector<uint32_t> change_ids_; |
| 62 std::vector<std::string> changes_; | 62 std::vector<std::string> changes_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(TestAnimationRunnerObserver); | 64 DISALLOW_COPY_AND_ASSIGN(TestAnimationRunnerObserver); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 // Creates an AnimationValuePtr from the specified float value. | 67 // Creates an AnimationValuePtr from the specified float value. |
| 68 AnimationValuePtr FloatAnimationValue(float float_value) { | 68 AnimationValuePtr FloatAnimationValue(float float_value) { |
| 69 AnimationValuePtr value(AnimationValue::New()); | 69 AnimationValuePtr value(AnimationValue::New()); |
| 70 value->float_value = float_value; | 70 value->float_value = float_value; |
| 71 return value.Pass(); | 71 return value; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Creates an AnimationValuePtr from the specified transform. | 74 // Creates an AnimationValuePtr from the specified transform. |
| 75 AnimationValuePtr TransformAnimationValue(const gfx::Transform& transform) { | 75 AnimationValuePtr TransformAnimationValue(const gfx::Transform& transform) { |
| 76 AnimationValuePtr value(AnimationValue::New()); | 76 AnimationValuePtr value(AnimationValue::New()); |
| 77 value->transform = Transform::From(transform); | 77 value->transform = Transform::From(transform); |
| 78 return value.Pass(); | 78 return value; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // Adds an AnimationElement to |group|s last sequence with the specified value. | 81 // Adds an AnimationElement to |group|s last sequence with the specified value. |
| 82 void AddElement(AnimationGroup* group, | 82 void AddElement(AnimationGroup* group, |
| 83 TimeDelta time, | 83 TimeDelta time, |
| 84 AnimationValuePtr start_value, | 84 AnimationValuePtr start_value, |
| 85 AnimationValuePtr target_value, | 85 AnimationValuePtr target_value, |
| 86 AnimationProperty property, | 86 AnimationProperty property, |
| 87 AnimationTweenType tween_type) { | 87 AnimationTweenType tween_type) { |
| 88 AnimationSequence& sequence = | 88 AnimationSequence& sequence = |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 ASSERT_EQ(0u, runner_observer_.changes()->size()); | 627 ASSERT_EQ(0u, runner_observer_.changes()->size()); |
| 628 | 628 |
| 629 // Animate to end. | 629 // Animate to end. |
| 630 runner_.Tick(initial_time_ + TimeDelta::FromMicroseconds(2000)); | 630 runner_.Tick(initial_time_ + TimeDelta::FromMicroseconds(2000)); |
| 631 ASSERT_EQ(1u, runner_observer_.changes()->size()); | 631 ASSERT_EQ(1u, runner_observer_.changes()->size()); |
| 632 EXPECT_EQ("done", runner_observer_.changes()->at(0)); | 632 EXPECT_EQ("done", runner_observer_.changes()->at(0)); |
| 633 EXPECT_EQ(animation_id2, runner_observer_.change_ids()->at(0)); | 633 EXPECT_EQ(animation_id2, runner_observer_.change_ids()->at(0)); |
| 634 } | 634 } |
| 635 | 635 |
| 636 } // namespace view_manager | 636 } // namespace view_manager |
| OLD | NEW |