OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ash_root_window_transformer.h" | 5 #include "ash/display/root_window_transformers.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
11 #include "ash/magnifier/magnification_controller.h" | 11 #include "ash/magnifier/magnification_controller.h" |
12 #include "ash/screen_ash.h" | 12 #include "ash/screen_ash.h" |
13 #include "ash/shelf/shelf_widget.h" | 13 #include "ash/shelf/shelf_widget.h" |
14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
15 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 MagnificationController* magnifier = | 284 MagnificationController* magnifier = |
285 Shell::GetInstance()->magnification_controller(); | 285 Shell::GetInstance()->magnification_controller(); |
286 | 286 |
287 magnifier->SetEnabled(true); | 287 magnifier->SetEnabled(true); |
288 EXPECT_FLOAT_EQ(2.0f, magnifier->GetScale()); | 288 EXPECT_FLOAT_EQ(2.0f, magnifier->GetScale()); |
289 magnifier->SetScale(2.5f, false); | 289 magnifier->SetScale(2.5f, false); |
290 EXPECT_FLOAT_EQ(2.5f, magnifier->GetScale()); | 290 EXPECT_FLOAT_EQ(2.5f, magnifier->GetScale()); |
291 generator.PressMoveAndReleaseTouchTo(50, 50); | 291 generator.PressMoveAndReleaseTouchTo(50, 50); |
292 // Default test touches have radius_x/y = 1.0, with device scale | 292 // Default test touches have radius_x/y = 1.0, with device scale |
293 // factor = 2, the scaled radius_x/y should be 0.5. | 293 // factor = 2, the scaled radius_x/y should be 0.5. |
294 EXPECT_FLOAT_EQ(0.2, event_handler.touch_radius_x()); | 294 EXPECT_FLOAT_EQ(0.2f, event_handler.touch_radius_x()); |
295 EXPECT_FLOAT_EQ(0.2, event_handler.touch_radius_y()); | 295 EXPECT_FLOAT_EQ(0.2f, event_handler.touch_radius_y()); |
296 | 296 |
297 generator.ScrollSequence(gfx::Point(0,0), | 297 generator.ScrollSequence(gfx::Point(0,0), |
298 base::TimeDelta::FromMilliseconds(100), | 298 base::TimeDelta::FromMilliseconds(100), |
299 10.0, 1.0, 5, 1); | 299 10.0, 1.0, 5, 1); |
300 | 300 |
301 // With device scale factor = 2, ordinal_offset * 2 = offset. | 301 // With device scale factor = 2, ordinal_offset * 2 = offset. |
302 EXPECT_FLOAT_EQ(event_handler.scroll_x_offset(), | 302 EXPECT_FLOAT_EQ(event_handler.scroll_x_offset(), |
303 event_handler.scroll_x_offset_ordinal() * 2 * 2.5f); | 303 event_handler.scroll_x_offset_ordinal() * 2 * 2.5f); |
304 EXPECT_FLOAT_EQ(event_handler.scroll_y_offset(), | 304 EXPECT_FLOAT_EQ(event_handler.scroll_y_offset(), |
305 event_handler.scroll_y_offset_ordinal() * 2 * 2.5f); | 305 event_handler.scroll_y_offset_ordinal() * 2 * 2.5f); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 EXPECT_EQ("159,99", event_handler.GetLocationAndReset()); | 389 EXPECT_EQ("159,99", event_handler.GetLocationAndReset()); |
390 | 390 |
391 magnifier->SetEnabled(false); | 391 magnifier->SetEnabled(false); |
392 EXPECT_FLOAT_EQ(1.0f, magnifier->GetScale()); | 392 EXPECT_FLOAT_EQ(1.0f, magnifier->GetScale()); |
393 | 393 |
394 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); | 394 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); |
395 } | 395 } |
396 | 396 |
397 } // namespace test | 397 } // namespace test |
398 } // namespace ash | 398 } // namespace ash |
OLD | NEW |