| 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" |
| 11 #include "ui/gfx/display.h" | |
| 12 | 11 |
| 13 namespace ash { | 12 namespace ash { |
| 14 | 13 |
| 15 namespace { | 14 namespace { |
| 16 | 15 |
| 17 DisplayInfo CreateDisplayInfo(int64_t id, | 16 DisplayInfo CreateDisplayInfo(int64_t id, |
| 18 unsigned int touch_device_id, | 17 unsigned int touch_device_id, |
| 19 const gfx::Rect& bounds) { | 18 const gfx::Rect& bounds) { |
| 20 DisplayInfo info(id, std::string(), false); | 19 DisplayInfo info(id, std::string(), false); |
| 21 info.SetBounds(bounds); | 20 info.SetBounds(bounds); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 CreateTouchscreenDevice(5, gfx::Size(1001, 1001)); | 343 CreateTouchscreenDevice(5, gfx::Size(1001, 1001)); |
| 345 | 344 |
| 346 TouchTransformerController* tt_controller = | 345 TouchTransformerController* tt_controller = |
| 347 Shell::GetInstance()->touch_transformer_controller(); | 346 Shell::GetInstance()->touch_transformer_controller(); |
| 348 // Default touchscreen position range is 1001x1001; | 347 // Default touchscreen position range is 1001x1001; |
| 349 EXPECT_EQ(sqrt((2560.0 * 1600.0) / (1001.0 * 1001.0)), | 348 EXPECT_EQ(sqrt((2560.0 * 1600.0) / (1001.0 * 1001.0)), |
| 350 tt_controller->GetTouchResolutionScale(display, touch_device)); | 349 tt_controller->GetTouchResolutionScale(display, touch_device)); |
| 351 } | 350 } |
| 352 | 351 |
| 353 } // namespace ash | 352 } // namespace ash |
| OLD | NEW |