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

Side by Side Diff: chrome/browser/android/vr_shell/ui_scene_unittest.cc

Issue 2929483003: VR: Further split common code from Android-specific code. (Closed)
Patch Set: Created 3 years, 6 months 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 unified diff | Download patch
OLDNEW
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_scene.h" 5 #include "chrome/browser/android/vr_shell/ui_scene.h"
6 6
7 #define _USE_MATH_DEFINES // For M_PI in MSVC. 7 #define _USE_MATH_DEFINES // For M_PI in MSVC.
8 #include <cmath> 8 #include <cmath>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 30 matching lines...) Expand all
41 auto element = base::MakeUnique<UiElement>(); 41 auto element = base::MakeUnique<UiElement>();
42 element->set_id(id); 42 element->set_id(id);
43 scene->AddUiElement(std::move(element)); 43 scene->AddUiElement(std::move(element));
44 } 44 }
45 45
46 void addAnimation(UiScene* scene, 46 void addAnimation(UiScene* scene,
47 int element_id, 47 int element_id,
48 int animation_id, 48 int animation_id,
49 Animation::Property property) { 49 Animation::Property property) {
50 std::unique_ptr<easing::Easing> easing = base::MakeUnique<easing::Linear>(); 50 std::unique_ptr<easing::Easing> easing = base::MakeUnique<easing::Linear>();
51 std::vector<float> from = {}; 51 std::vector<float> from;
52 std::vector<float> to = {1, 1, 1, 1}; 52 std::vector<float> to = {1, 1, 1, 1};
53 auto animation = 53 auto animation =
54 base::MakeUnique<Animation>(animation_id, property, std::move(easing), 54 base::MakeUnique<Animation>(animation_id, property, std::move(easing),
55 from, to, usToTicks(0), usToDelta(1)); 55 from, to, usToTicks(0), usToDelta(1));
56 scene->AddAnimation(element_id, std::move(animation)); 56 scene->AddAnimation(element_id, std::move(animation));
57 } 57 }
58 58
59 } // namespace 59 } // namespace
60 60
61 TEST(UiScene, AddRemoveElements) { 61 TEST(UiScene, AddRemoveElements) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 {XAnchoring::XNONE, YAnchoring::YTOP, 0, 2}, 222 {XAnchoring::XNONE, YAnchoring::YTOP, 0, 2},
223 {XAnchoring::XNONE, YAnchoring::YBOTTOM, 0, -2}, 223 {XAnchoring::XNONE, YAnchoring::YBOTTOM, 0, -2},
224 {XAnchoring::XLEFT, YAnchoring::YTOP, -2, 2}, 224 {XAnchoring::XLEFT, YAnchoring::YTOP, -2, 2},
225 }; 225 };
226 226
227 INSTANTIATE_TEST_CASE_P(AnchoringTestCases, 227 INSTANTIATE_TEST_CASE_P(AnchoringTestCases,
228 AnchoringTest, 228 AnchoringTest,
229 ::testing::ValuesIn(anchoring_test_cases)); 229 ::testing::ValuesIn(anchoring_test_cases));
230 230
231 } // namespace vr_shell 231 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc ('k') | chrome/browser/android/vr_shell/vr_browser_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698