OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/android/vr_shell/ui_elements.h" | 5 #include "chrome/browser/android/vr_shell/ui_elements.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/stringprintf.h" | |
9 #include "chrome/browser/android/vr_shell/animation.h" | 8 #include "chrome/browser/android/vr_shell/animation.h" |
10 #include "chrome/browser/android/vr_shell/easing.h" | 9 #include "chrome/browser/android/vr_shell/easing.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
12 | 11 |
13 #define EXPECT_VEC3F_EQ(a, b) \ | 12 #define EXPECT_VEC3F_EQ(a, b) \ |
14 EXPECT_FLOAT_EQ(a.x, b.x); \ | 13 EXPECT_FLOAT_EQ(a.x, b.x); \ |
15 EXPECT_FLOAT_EQ(a.y, b.y); \ | 14 EXPECT_FLOAT_EQ(a.y, b.y); \ |
16 EXPECT_FLOAT_EQ(a.z, b.z); | 15 EXPECT_FLOAT_EQ(a.z, b.z); |
17 | 16 |
18 #define EXPECT_RECTF_EQ(a, b) \ | 17 #define EXPECT_RECTF_EQ(a, b) \ |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 rect.animations.emplace_back(std::move(animation2)); | 153 rect.animations.emplace_back(std::move(animation2)); |
155 rect.Animate(55000); | 154 rect.Animate(55000); |
156 EXPECT_VEC3F_EQ(rect.translation, gvr::Vec3f({10, 100, 1000})); | 155 EXPECT_VEC3F_EQ(rect.translation, gvr::Vec3f({10, 100, 1000})); |
157 rect.Animate(60000); | 156 rect.Animate(60000); |
158 EXPECT_VEC3F_EQ(rect.translation, gvr::Vec3f({30, 300, 3000})); | 157 EXPECT_VEC3F_EQ(rect.translation, gvr::Vec3f({30, 300, 3000})); |
159 rect.Animate(65000); | 158 rect.Animate(65000); |
160 EXPECT_VEC3F_EQ(rect.translation, gvr::Vec3f({50, 500, 5000})); | 159 EXPECT_VEC3F_EQ(rect.translation, gvr::Vec3f({50, 500, 5000})); |
161 } | 160 } |
162 | 161 |
163 } // namespace vr_shell | 162 } // namespace vr_shell |
OLD | NEW |