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

Unified Diff: ui/compositor/transform_animation_curve_adapter_unittest.cc

Issue 719453007: Make Keyframe use TimeTicks/TimeDelta to represent time instead of double. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/compositor/transform_animation_curve_adapter_unittest.cc
diff --git a/ui/compositor/transform_animation_curve_adapter_unittest.cc b/ui/compositor/transform_animation_curve_adapter_unittest.cc
index b68e862689143a6a2bd5e435295682b9b5b3ca2a..10ee66811f318b9a5585849c5065c7316ef447cc 100644
--- a/ui/compositor/transform_animation_curve_adapter_unittest.cc
+++ b/ui/compositor/transform_animation_curve_adapter_unittest.cc
@@ -7,6 +7,7 @@
#include <sstream>
#include "base/time/time.h"
+#include "cc/base/time_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/compositor/test/test_utils.h"
@@ -41,13 +42,12 @@ TEST(InverseTransformCurveAdapterTest, InversesTransform) {
static const int kSteps = 1000;
double step = 1.0 / kSteps;
for (int i = 0; i <= kSteps ; ++i) {
+ base::TimeDelta time_step = cc::TimeUtil::Scale(duration, i * step);
std::ostringstream message;
message << "Step " << i << " of " << kSteps;
SCOPED_TRACE(message.str());
- gfx::Transform progress_parent_transform =
- parent_curve.GetValue(i*step);
- gfx::Transform progress_child_transform =
- child_curve.GetValue(i*step);
+ gfx::Transform progress_parent_transform = parent_curve.GetValue(time_step);
+ gfx::Transform progress_child_transform = child_curve.GetValue(time_step);
CheckApproximatelyEqual(effective_child_transform,
progress_parent_transform *
progress_child_transform);

Powered by Google App Engine
This is Rietveld 408576698