| 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/display/display_manager.h" | 7 #include "ash/display/display_manager.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 class MagnificationControllerTest: public test::AshTestBase { | 61 class MagnificationControllerTest: public test::AshTestBase { |
| 62 public: | 62 public: |
| 63 MagnificationControllerTest() : text_input_view_(NULL) {} | 63 MagnificationControllerTest() : text_input_view_(NULL) {} |
| 64 ~MagnificationControllerTest() override {} | 64 ~MagnificationControllerTest() override {} |
| 65 | 65 |
| 66 void SetUp() override { | 66 void SetUp() override { |
| 67 AshTestBase::SetUp(); | 67 AshTestBase::SetUp(); |
| 68 UpdateDisplay(base::StringPrintf("%dx%d", kRootWidth, kRootHeight)); | 68 UpdateDisplay(base::StringPrintf("%dx%d", kRootWidth, kRootHeight)); |
| 69 | 69 |
| 70 aura::Window* root = GetRootWindow(); | |
| 71 gfx::Rect root_bounds(root->bounds()); | |
| 72 | |
| 73 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
| 74 // RootWindow and Display can't resize on Windows Ash. | 71 // RootWindow and Display can't resize on Windows Ash. |
| 75 // http://crbug.com/165962 | 72 // http://crbug.com/165962 |
| 73 aura::Window* root = GetRootWindow(); |
| 74 gfx::Rect root_bounds(root->bounds()); |
| 76 EXPECT_EQ(kRootHeight, root_bounds.height()); | 75 EXPECT_EQ(kRootHeight, root_bounds.height()); |
| 77 EXPECT_EQ(kRootWidth, root_bounds.width()); | 76 EXPECT_EQ(kRootWidth, root_bounds.width()); |
| 78 #endif | 77 #endif |
| 79 | 78 |
| 80 GetMagnificationController()->DisableMoveMagnifierDelayForTesting(); | 79 GetMagnificationController()->DisableMoveMagnifierDelayForTesting(); |
| 81 } | 80 } |
| 82 | 81 |
| 83 void TearDown() override { AshTestBase::TearDown(); } | 82 void TearDown() override { AshTestBase::TearDown(); } |
| 84 | 83 |
| 85 protected: | 84 protected: |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 UpdateDisplay("500x500"); | 710 UpdateDisplay("500x500"); |
| 712 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 711 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
| 713 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 712 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
| 714 | 713 |
| 715 GetMagnificationController()->SetEnabled(false); | 714 GetMagnificationController()->SetEnabled(false); |
| 716 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 715 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
| 717 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 716 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
| 718 } | 717 } |
| 719 | 718 |
| 720 } // namespace ash | 719 } // namespace ash |
| OLD | NEW |