| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "ash/test/ash_test_base.h" | 6 #include "ash/test/ash_test_base.h" |
| 7 #include "chrome/browser/chromeos/accessibility/accessibility_highlight_manager.
h" | 7 #include "chrome/browser/chromeos/accessibility/accessibility_highlight_manager.
h" |
| 8 #include "chrome/browser/chromeos/ui/accessibility_cursor_ring_layer.h" | 8 #include "chrome/browser/chromeos/ui/accessibility_cursor_ring_layer.h" |
| 9 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" | 9 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 EXPECT_EQ(gfx::Point(0, 400), points[29]); | 127 EXPECT_EQ(gfx::Point(0, 400), points[29]); |
| 128 EXPECT_EQ(gfx::Point(0, 390), points[30]); | 128 EXPECT_EQ(gfx::Point(0, 390), points[30]); |
| 129 EXPECT_EQ(gfx::Point(0, 110), points[31]); | 129 EXPECT_EQ(gfx::Point(0, 110), points[31]); |
| 130 EXPECT_EQ(gfx::Point(0, 100), points[32]); | 130 EXPECT_EQ(gfx::Point(0, 100), points[32]); |
| 131 EXPECT_EQ(gfx::Point(0, 100), points[33]); | 131 EXPECT_EQ(gfx::Point(0, 100), points[33]); |
| 132 EXPECT_EQ(gfx::Point(0, 100), points[34]); | 132 EXPECT_EQ(gfx::Point(0, 100), points[34]); |
| 133 EXPECT_EQ(gfx::Point(0, 100), points[35]); | 133 EXPECT_EQ(gfx::Point(0, 100), points[35]); |
| 134 } | 134 } |
| 135 | 135 |
| 136 TEST_F(AccessibilityFocusRingControllerTest, CursorWorksOnMultipleDisplays) { | 136 TEST_F(AccessibilityFocusRingControllerTest, CursorWorksOnMultipleDisplays) { |
| 137 if (!SupportsMultipleDisplays()) | |
| 138 return; | |
| 139 UpdateDisplay("400x400,500x500"); | 137 UpdateDisplay("400x400,500x500"); |
| 140 aura::Window::Windows root_windows = | 138 aura::Window::Windows root_windows = |
| 141 ash::Shell::GetInstance()->GetAllRootWindows(); | 139 ash::Shell::GetInstance()->GetAllRootWindows(); |
| 142 ASSERT_EQ(2u, root_windows.size()); | 140 ASSERT_EQ(2u, root_windows.size()); |
| 143 | 141 |
| 144 AccessibilityHighlightManager highlight_manager; | 142 AccessibilityHighlightManager highlight_manager; |
| 145 highlight_manager.HighlightCursor(true); | 143 highlight_manager.HighlightCursor(true); |
| 146 gfx::Point location(90, 90); | 144 gfx::Point location(90, 90); |
| 147 ui::MouseEvent event0(ui::ET_MOUSE_MOVED, location, location, | 145 ui::MouseEvent event0(ui::ET_MOUSE_MOVED, location, location, |
| 148 ui::EventTimeForNow(), 0, 0); | 146 ui::EventTimeForNow(), 0, 0); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 167 | 165 |
| 168 cursor_layer = controller->cursor_layer_.get(); | 166 cursor_layer = controller->cursor_layer_.get(); |
| 169 EXPECT_EQ(root_windows[1], cursor_layer->root_window()); | 167 EXPECT_EQ(root_windows[1], cursor_layer->root_window()); |
| 170 EXPECT_LT(abs(cursor_layer->layer()->GetTargetBounds().x() - location.x()), | 168 EXPECT_LT(abs(cursor_layer->layer()->GetTargetBounds().x() - location.x()), |
| 171 50); | 169 50); |
| 172 EXPECT_LT(abs(cursor_layer->layer()->GetTargetBounds().y() - location.y()), | 170 EXPECT_LT(abs(cursor_layer->layer()->GetTargetBounds().y() - location.y()), |
| 173 50); | 171 50); |
| 174 } | 172 } |
| 175 | 173 |
| 176 } // namespace chromeos | 174 } // namespace chromeos |
| OLD | NEW |