OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_layout_store.h" | 9 #include "ash/display/display_layout_store.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1141 generator.PressMoveAndReleaseTouchTo(50, 50); | 1141 generator.PressMoveAndReleaseTouchTo(50, 50); |
1142 // Default test touches have radius_x/y = 1.0, with device scale | 1142 // Default test touches have radius_x/y = 1.0, with device scale |
1143 // factor = 2, the scaled radius_x/y should be 0.5. | 1143 // factor = 2, the scaled radius_x/y should be 0.5. |
1144 EXPECT_EQ(0.5, event_handler.touch_radius_x()); | 1144 EXPECT_EQ(0.5, event_handler.touch_radius_x()); |
1145 EXPECT_EQ(0.5, event_handler.touch_radius_y()); | 1145 EXPECT_EQ(0.5, event_handler.touch_radius_y()); |
1146 | 1146 |
1147 generator.ScrollSequence(gfx::Point(0,0), | 1147 generator.ScrollSequence(gfx::Point(0,0), |
1148 base::TimeDelta::FromMilliseconds(100), | 1148 base::TimeDelta::FromMilliseconds(100), |
1149 10.0, 1.0, 5, 1); | 1149 10.0, 1.0, 5, 1); |
1150 | 1150 |
1151 // With device scale factor = 2, ordinal_offset * 2 = offset. | 1151 // With device scale factor = 2, ordinal_offset * 2 = offset. |
oshima
2013/10/03 09:23:43
can you update the comment?
Shecky Lin
2013/10/03 09:47:11
Done.
| |
1152 EXPECT_EQ(event_handler.scroll_x_offset(), | 1152 EXPECT_EQ(event_handler.scroll_x_offset(), |
1153 event_handler.scroll_x_offset_ordinal() * 2); | 1153 event_handler.scroll_x_offset_ordinal()); |
1154 EXPECT_EQ(event_handler.scroll_y_offset(), | 1154 EXPECT_EQ(event_handler.scroll_y_offset(), |
1155 event_handler.scroll_y_offset_ordinal() * 2); | 1155 event_handler.scroll_y_offset_ordinal()); |
1156 | 1156 |
1157 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); | 1157 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); |
1158 } | 1158 } |
1159 | 1159 |
1160 TEST_F(DisplayControllerTest, ConvertHostToRootCoords) { | 1160 TEST_F(DisplayControllerTest, ConvertHostToRootCoords) { |
1161 if (!SupportsMultipleDisplays()) | 1161 if (!SupportsMultipleDisplays()) |
1162 return; | 1162 return; |
1163 | 1163 |
1164 TestEventHandler event_handler; | 1164 TestEventHandler event_handler; |
1165 Shell::GetInstance()->AddPreTargetHandler(&event_handler); | 1165 Shell::GetInstance()->AddPreTargetHandler(&event_handler); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1235 EXPECT_EQ("aura_root_0", GetXWindowName(primary)); | 1235 EXPECT_EQ("aura_root_0", GetXWindowName(primary)); |
1236 EXPECT_EQ("aura_root_x", GetXWindowName(secondary)); | 1236 EXPECT_EQ("aura_root_x", GetXWindowName(secondary)); |
1237 | 1237 |
1238 // Switching back to single display. | 1238 // Switching back to single display. |
1239 UpdateDisplay("300x400"); | 1239 UpdateDisplay("300x400"); |
1240 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow())); | 1240 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow())); |
1241 } | 1241 } |
1242 #endif | 1242 #endif |
1243 | 1243 |
1244 } // namespace ash | 1244 } // namespace ash |
OLD | NEW |