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

Side by Side Diff: ash/touch/touch_transformer_controller_unittest.cc

Issue 904733002: Remove useless InputDevice::name field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « ash/test/virtual_keyboard_test_helper.cc ('k') | ash/touch/touchscreen_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/test/virtual_keyboard_test_helper.cc ('k') | ash/touch/touchscreen_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698