| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/test/display_manager_test_api.h" | 9 #include "ash/test/display_manager_test_api.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 void FocusOnTextInputView() { | 141 void FocusOnTextInputView() { |
| 142 DCHECK(text_input_view_); | 142 DCHECK(text_input_view_); |
| 143 text_input_view_->FocusOnTextInput(); | 143 text_input_view_->FocusOnTextInput(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 TextInputView* text_input_view_; | 147 TextInputView* text_input_view_; |
| 148 | 148 |
| 149 ui::InputMethod* GetInputMethod() { | 149 ui::InputMethod* GetInputMethod() { |
| 150 DCHECK(text_input_view_); | 150 DCHECK(text_input_view_); |
| 151 return text_input_view_->GetWidget()->GetHostInputMethod(); | 151 return text_input_view_->GetWidget()->GetInputMethod(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 DISALLOW_COPY_AND_ASSIGN(MagnificationControllerTest); | 154 DISALLOW_COPY_AND_ASSIGN(MagnificationControllerTest); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 TEST_F(MagnificationControllerTest, EnableAndDisable) { | 157 TEST_F(MagnificationControllerTest, EnableAndDisable) { |
| 158 // Confirms the magnifier is disabled. | 158 // Confirms the magnifier is disabled. |
| 159 EXPECT_TRUE(GetRootWindow()->layer()->transform().IsIdentity()); | 159 EXPECT_TRUE(GetRootWindow()->layer()->transform().IsIdentity()); |
| 160 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 160 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
| 161 EXPECT_EQ("0,0 800x600", GetViewport().ToString()); | 161 EXPECT_EQ("0,0 800x600", GetViewport().ToString()); |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 UpdateDisplay("500x500"); | 693 UpdateDisplay("500x500"); |
| 694 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 694 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
| 695 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 695 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
| 696 | 696 |
| 697 GetMagnificationController()->SetEnabled(false); | 697 GetMagnificationController()->SetEnabled(false); |
| 698 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 698 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
| 699 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 699 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
| 700 } | 700 } |
| 701 | 701 |
| 702 } // namespace ash | 702 } // namespace ash |
| OLD | NEW |