OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "ash/magnifier/magnification_controller.h" | 7 #include "ash/magnifier/magnification_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 }; | 91 }; |
92 | 92 |
93 } // namespace | 93 } // namespace |
94 | 94 |
95 class MagnificationControllerTest : public InProcessBrowserTest { | 95 class MagnificationControllerTest : public InProcessBrowserTest { |
96 protected: | 96 protected: |
97 MagnificationControllerTest() {} | 97 MagnificationControllerTest() {} |
98 ~MagnificationControllerTest() override {} | 98 ~MagnificationControllerTest() override {} |
99 | 99 |
100 void SetUpCommandLine(base::CommandLine* command_line) override { | 100 void SetUpCommandLine(base::CommandLine* command_line) override { |
101 InProcessBrowserTest::SetUpCommandLine(command_line); | |
102 // Make screens sufficiently wide to host 2 browsers side by side. | 101 // Make screens sufficiently wide to host 2 browsers side by side. |
103 command_line->AppendSwitchASCII("ash-host-window-bounds", "1200x800"); | 102 command_line->AppendSwitchASCII("ash-host-window-bounds", "1200x800"); |
104 } | 103 } |
105 | 104 |
106 void SetUpOnMainThread() override { | 105 void SetUpOnMainThread() override { |
107 SetMagnifierEnabled(true); | 106 SetMagnifierEnabled(true); |
108 | 107 |
109 // Confirms that magnifier is enabled. | 108 // Confirms that magnifier is enabled. |
110 EXPECT_TRUE(IsMagnifierEnabled()); | 109 EXPECT_TRUE(IsMagnifierEnabled()); |
111 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 110 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // Set the focus on the button. | 219 // Set the focus on the button. |
221 SetFocusOnElement("test_button"); | 220 SetFocusOnElement("test_button"); |
222 | 221 |
223 // Verify the magnifier window is not moved and still contains the button. | 222 // Verify the magnifier window is not moved and still contains the button. |
224 const gfx::Rect view_port_after_focus = GetViewPort(); | 223 const gfx::Rect view_port_after_focus = GetViewPort(); |
225 EXPECT_TRUE(view_port_after_focus.Contains(button_bounds)); | 224 EXPECT_TRUE(view_port_after_focus.Contains(button_bounds)); |
226 EXPECT_EQ(view_port_before_focus, view_port_after_focus); | 225 EXPECT_EQ(view_port_before_focus, view_port_after_focus); |
227 } | 226 } |
228 | 227 |
229 } // namespace chromeos | 228 } // namespace chromeos |
OLD | NEW |