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)); | |
tdanderson
2014/04/28 21:59:55
Perhaps add an EXPECT_NE here to check that the al
Nina
2014/04/29 13:12:17
Done.
| |
262 ToggleOverview(); | |
263 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), | |
264 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | |
265 } | |
266 | |
255 // Tests entering overview mode with two windows and selecting one. | 267 // Tests entering overview mode with two windows and selecting one. |
256 TEST_F(WindowSelectorTest, Basic) { | 268 TEST_F(WindowSelectorTest, Basic) { |
257 gfx::Rect bounds(0, 0, 400, 400); | 269 gfx::Rect bounds(0, 0, 400, 400); |
258 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 270 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
259 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); | 271 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
260 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); | 272 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); |
261 scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); | 273 scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); |
262 scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); | 274 scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); |
263 EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get())); | 275 EXPECT_TRUE(WindowsOverlapping(window1.get(), window2.get())); |
264 EXPECT_TRUE(WindowsOverlapping(panel1.get(), panel2.get())); | 276 EXPECT_TRUE(WindowsOverlapping(panel1.get(), panel2.get())); |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1171 UpdateDisplay("600x200/r"); | 1183 UpdateDisplay("600x200/r"); |
1172 EXPECT_EQ("0,0 200x600", root_window->bounds().ToString()); | 1184 EXPECT_EQ("0,0 200x600", root_window->bounds().ToString()); |
1173 for (ScopedVector<aura::Window>::iterator iter = windows.begin(); | 1185 for (ScopedVector<aura::Window>::iterator iter = windows.begin(); |
1174 iter != windows.end(); ++iter) { | 1186 iter != windows.end(); ++iter) { |
1175 EXPECT_TRUE(root_window->bounds().Contains( | 1187 EXPECT_TRUE(root_window->bounds().Contains( |
1176 ToEnclosingRect(GetTransformedTargetBounds(*iter)))); | 1188 ToEnclosingRect(GetTransformedTargetBounds(*iter)))); |
1177 } | 1189 } |
1178 } | 1190 } |
1179 | 1191 |
1180 } // namespace ash | 1192 } // namespace ash |
OLD | NEW |