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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 const int kRootHeight = 600; | 22 const int kRootHeight = 600; |
23 const int kRootWidth = 800; | 23 const int kRootWidth = 800; |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 class MagnificationControllerTest: public test::AshTestBase { | 27 class MagnificationControllerTest: public test::AshTestBase { |
28 public: | 28 public: |
29 MagnificationControllerTest() {} | 29 MagnificationControllerTest() {} |
30 virtual ~MagnificationControllerTest() {} | 30 virtual ~MagnificationControllerTest() {} |
31 | 31 |
32 virtual void SetUp() OVERRIDE { | 32 virtual void SetUp() override { |
33 AshTestBase::SetUp(); | 33 AshTestBase::SetUp(); |
34 UpdateDisplay(base::StringPrintf("%dx%d", kRootWidth, kRootHeight)); | 34 UpdateDisplay(base::StringPrintf("%dx%d", kRootWidth, kRootHeight)); |
35 | 35 |
36 aura::Window* root = GetRootWindow(); | 36 aura::Window* root = GetRootWindow(); |
37 gfx::Rect root_bounds(root->bounds()); | 37 gfx::Rect root_bounds(root->bounds()); |
38 | 38 |
39 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
40 // RootWindow and Display can't resize on Windows Ash. | 40 // RootWindow and Display can't resize on Windows Ash. |
41 // http://crbug.com/165962 | 41 // http://crbug.com/165962 |
42 EXPECT_EQ(kRootHeight, root_bounds.height()); | 42 EXPECT_EQ(kRootHeight, root_bounds.height()); |
43 EXPECT_EQ(kRootWidth, root_bounds.width()); | 43 EXPECT_EQ(kRootWidth, root_bounds.width()); |
44 #endif | 44 #endif |
45 } | 45 } |
46 | 46 |
47 virtual void TearDown() OVERRIDE { | 47 virtual void TearDown() override { |
48 AshTestBase::TearDown(); | 48 AshTestBase::TearDown(); |
49 } | 49 } |
50 | 50 |
51 protected: | 51 protected: |
52 aura::Window* GetRootWindow() const { | 52 aura::Window* GetRootWindow() const { |
53 return Shell::GetPrimaryRootWindow(); | 53 return Shell::GetPrimaryRootWindow(); |
54 } | 54 } |
55 | 55 |
56 std::string GetHostMouseLocation() { | 56 std::string GetHostMouseLocation() { |
57 const gfx::Point& location = | 57 const gfx::Point& location = |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 | 434 |
435 scale *= kMagnificationScaleFactor; | 435 scale *= kMagnificationScaleFactor; |
436 GetMagnificationController()->SetScale(scale, false); | 436 GetMagnificationController()->SetScale(scale, false); |
437 EXPECT_FLOAT_EQ(4.f, GetMagnificationController()->GetScale()); | 437 EXPECT_FLOAT_EQ(4.f, GetMagnificationController()->GetScale()); |
438 generator.MoveMouseToInHost(gfx::Point(0, 300)); | 438 generator.MoveMouseToInHost(gfx::Point(0, 300)); |
439 EXPECT_EQ("139,298", env->last_mouse_location().ToString()); | 439 EXPECT_EQ("139,298", env->last_mouse_location().ToString()); |
440 EXPECT_EQ("100,300", GetHostMouseLocation()); | 440 EXPECT_EQ("100,300", GetHostMouseLocation()); |
441 } | 441 } |
442 | 442 |
443 } // namespace ash | 443 } // namespace ash |
OLD | NEW |