| 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 "ash/touch/touch_transformer_controller.h" | 5 #include "ash/touch/touch_transformer_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ui/aura/window_tree_host.h" | 9 #include "ui/aura/window_tree_host.h" |
| 10 #include "ui/events/devices/device_data_manager.h" | 10 #include "ui/events/devices/device_data_manager.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 std::vector<DisplayMode> default_modes( | 26 std::vector<DisplayMode> default_modes( |
| 27 1, DisplayMode(bounds.size(), 60, false, true)); | 27 1, DisplayMode(bounds.size(), 60, false, true)); |
| 28 info.SetDisplayModes(default_modes); | 28 info.SetDisplayModes(default_modes); |
| 29 | 29 |
| 30 return info; | 30 return info; |
| 31 } | 31 } |
| 32 | 32 |
| 33 ui::TouchscreenDevice CreateTouchscreenDevice(unsigned int id, | 33 ui::TouchscreenDevice CreateTouchscreenDevice(unsigned int id, |
| 34 const gfx::Size& size) { | 34 const gfx::Size& size) { |
| 35 return ui::TouchscreenDevice(id, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, | 35 return ui::TouchscreenDevice(id, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, |
| 36 std::string(), size, 0); | 36 size, 0); |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 typedef test::AshTestBase TouchTransformerControllerTest; | 41 typedef test::AshTestBase TouchTransformerControllerTest; |
| 42 | 42 |
| 43 TEST_F(TouchTransformerControllerTest, TouchTransformerMirrorModeLetterboxing) { | 43 TEST_F(TouchTransformerControllerTest, TouchTransformerMirrorModeLetterboxing) { |
| 44 // The internal display has native resolution of 2560x1700, and in | 44 // The internal display has native resolution of 2560x1700, and in |
| 45 // mirror mode it is configured as 1920x1200. This is in letterboxing | 45 // mirror mode it is configured as 1920x1200. This is in letterboxing |
| 46 // mode. | 46 // mode. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 CreateTouchscreenDevice(5, gfx::Size(1001, 1001)); | 270 CreateTouchscreenDevice(5, gfx::Size(1001, 1001)); |
| 271 | 271 |
| 272 TouchTransformerController* tt_controller = | 272 TouchTransformerController* tt_controller = |
| 273 Shell::GetInstance()->touch_transformer_controller(); | 273 Shell::GetInstance()->touch_transformer_controller(); |
| 274 // Default touchscreen position range is 1001x1001; | 274 // Default touchscreen position range is 1001x1001; |
| 275 EXPECT_EQ(sqrt((2560.0 * 1600.0) / (1001.0 * 1001.0)), | 275 EXPECT_EQ(sqrt((2560.0 * 1600.0) / (1001.0 * 1001.0)), |
| 276 tt_controller->GetTouchResolutionScale(display, touch_device)); | 276 tt_controller->GetTouchResolutionScale(display, touch_device)); |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace ash | 279 } // namespace ash |
| OLD | NEW |