OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/accessibility_delegate.h" |
5 #include "ash/drag_drop/drag_drop_controller.h" | 6 #include "ash/drag_drop/drag_drop_controller.h" |
6 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
7 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
8 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
9 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
10 #include "ash/shell.h" | 11 #include "ash/shell.h" |
11 #include "ash/shell_window_ids.h" | 12 #include "ash/shell_window_ids.h" |
12 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
13 #include "ash/test/shelf_test_api.h" | 14 #include "ash/test/shelf_test_api.h" |
14 #include "ash/test/shelf_view_test_api.h" | 15 #include "ash/test/shelf_view_test_api.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } | 246 } |
246 | 247 |
247 private: | 248 private: |
248 aura::test::TestWindowDelegate delegate_; | 249 aura::test::TestWindowDelegate delegate_; |
249 NonActivatableActivationDelegate non_activatable_activation_delegate_; | 250 NonActivatableActivationDelegate non_activatable_activation_delegate_; |
250 scoped_ptr<test::ShelfViewTestAPI> shelf_view_test_; | 251 scoped_ptr<test::ShelfViewTestAPI> shelf_view_test_; |
251 | 252 |
252 DISALLOW_COPY_AND_ASSIGN(WindowSelectorTest); | 253 DISALLOW_COPY_AND_ASSIGN(WindowSelectorTest); |
253 }; | 254 }; |
254 | 255 |
| 256 // Tests that an a11y alert is sent on entering overview mode. |
| 257 TEST_F(WindowSelectorTest, A11yAlertOnOverviewMode) { |
| 258 gfx::Rect bounds(0, 0, 400, 400); |
| 259 AccessibilityDelegate* delegate = |
| 260 ash::Shell::GetInstance()->accessibility_delegate(); |
| 261 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 262 EXPECT_NE(delegate->GetLastAccessibilityAlert(), |
| 263 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
| 264 ToggleOverview(); |
| 265 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), |
| 266 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
| 267 } |
| 268 |
255 // Tests entering overview mode with two windows and selecting one. | 269 // Tests entering overview mode with two windows and selecting one. |
256 TEST_F(WindowSelectorTest, Basic) { | 270 TEST_F(WindowSelectorTest, Basic) { |
257 gfx::Rect bounds(0, 0, 400, 400); | 271 gfx::Rect bounds(0, 0, 400, 400); |
258 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 272 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
259 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); | 273 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
260 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); | 274 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); |
261 scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); | 275 scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); |
262 scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); | 276 scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); |
263 EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get())); | 277 EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get())); |
264 EXPECT_TRUE(WindowsOverlapping(panel1.get(), panel2.get())); | 278 EXPECT_TRUE(WindowsOverlapping(panel1.get(), panel2.get())); |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 UpdateDisplay("600x200/r"); | 1185 UpdateDisplay("600x200/r"); |
1172 EXPECT_EQ("0,0 200x600", root_window->bounds().ToString()); | 1186 EXPECT_EQ("0,0 200x600", root_window->bounds().ToString()); |
1173 for (ScopedVector<aura::Window>::iterator iter = windows.begin(); | 1187 for (ScopedVector<aura::Window>::iterator iter = windows.begin(); |
1174 iter != windows.end(); ++iter) { | 1188 iter != windows.end(); ++iter) { |
1175 EXPECT_TRUE(root_window->bounds().Contains( | 1189 EXPECT_TRUE(root_window->bounds().Contains( |
1176 ToEnclosingRect(GetTransformedTargetBounds(*iter)))); | 1190 ToEnclosingRect(GetTransformedTargetBounds(*iter)))); |
1177 } | 1191 } |
1178 } | 1192 } |
1179 | 1193 |
1180 } // namespace ash | 1194 } // namespace ash |
OLD | NEW |