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