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/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
6 | 6 |
7 #include "ash/magnifier/magnifier_constants.h" | 7 #include "ash/magnifier/magnifier_constants.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
13 #include "ui/aura/test/event_generator.h" | 13 #include "ui/aura/test/event_generator.h" |
14 #include "ui/aura/window_tree_host.h" | 14 #include "ui/aura/window_tree_host.h" |
15 #include "ui/gfx/rect_conversions.h" | 15 #include "ui/gfx/rect_conversions.h" |
16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace internal { | |
20 namespace { | 19 namespace { |
21 | 20 |
22 const int kRootHeight = 600; | 21 const int kRootHeight = 600; |
23 const int kRootWidth = 800; | 22 const int kRootWidth = 800; |
24 | 23 |
25 } // namespace | 24 } // namespace |
26 | 25 |
27 class MagnificationControllerTest: public test::AshTestBase { | 26 class MagnificationControllerTest: public test::AshTestBase { |
28 public: | 27 public: |
29 MagnificationControllerTest() {} | 28 MagnificationControllerTest() {} |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 EXPECT_EQ("98,300", GetHostMouseLocation()); | 431 EXPECT_EQ("98,300", GetHostMouseLocation()); |
433 | 432 |
434 scale *= kMagnificationScaleFactor; | 433 scale *= kMagnificationScaleFactor; |
435 GetMagnificationController()->SetScale(scale, false); | 434 GetMagnificationController()->SetScale(scale, false); |
436 EXPECT_FLOAT_EQ(4.f, GetMagnificationController()->GetScale()); | 435 EXPECT_FLOAT_EQ(4.f, GetMagnificationController()->GetScale()); |
437 generator.MoveMouseToInHost(gfx::Point(0, 300)); | 436 generator.MoveMouseToInHost(gfx::Point(0, 300)); |
438 EXPECT_EQ("139,298", env->last_mouse_location().ToString()); | 437 EXPECT_EQ("139,298", env->last_mouse_location().ToString()); |
439 EXPECT_EQ("100,300", GetHostMouseLocation()); | 438 EXPECT_EQ("100,300", GetHostMouseLocation()); |
440 } | 439 } |
441 | 440 |
442 } // namespace internal | |
443 } // namespace ash | 441 } // namespace ash |
OLD | NEW |