| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/drag_drop/drag_drop_controller.h" | 8 #include "ash/drag_drop/drag_drop_controller.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 DISALLOW_COPY_AND_ASSIGN(WindowSelectorTest); | 263 DISALLOW_COPY_AND_ASSIGN(WindowSelectorTest); |
| 264 }; | 264 }; |
| 265 | 265 |
| 266 // Tests that an a11y alert is sent on entering overview mode. | 266 // Tests that an a11y alert is sent on entering overview mode. |
| 267 TEST_F(WindowSelectorTest, A11yAlertOnOverviewMode) { | 267 TEST_F(WindowSelectorTest, A11yAlertOnOverviewMode) { |
| 268 gfx::Rect bounds(0, 0, 400, 400); | 268 gfx::Rect bounds(0, 0, 400, 400); |
| 269 AccessibilityDelegate* delegate = | 269 AccessibilityDelegate* delegate = |
| 270 ash::Shell::GetInstance()->accessibility_delegate(); | 270 ash::Shell::GetInstance()->accessibility_delegate(); |
| 271 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); | 271 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 272 EXPECT_NE(delegate->GetLastAccessibilityAlert(), | 272 EXPECT_NE(delegate->GetLastAccessibilityAlert(), |
| 273 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | 273 ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
| 274 ToggleOverview(); | 274 ToggleOverview(); |
| 275 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), | 275 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), |
| 276 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | 276 ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
| 277 } | 277 } |
| 278 | 278 |
| 279 // Tests entering overview mode with two windows and selecting one by clicking. | 279 // Tests entering overview mode with two windows and selecting one by clicking. |
| 280 TEST_F(WindowSelectorTest, Basic) { | 280 TEST_F(WindowSelectorTest, Basic) { |
| 281 gfx::Rect bounds(0, 0, 400, 400); | 281 gfx::Rect bounds(0, 0, 400, 400); |
| 282 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 282 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
| 283 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); | 283 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 284 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); | 284 scoped_ptr<aura::Window> window2(CreateWindow(bounds)); |
| 285 scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); | 285 scoped_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); |
| 286 scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); | 286 scoped_ptr<aura::Window> panel2(CreatePanelWindow(bounds)); |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 // Switch to overview mode. | 1263 // Switch to overview mode. |
| 1264 ToggleOverview(); | 1264 ToggleOverview(); |
| 1265 ASSERT_TRUE(IsSelecting()); | 1265 ASSERT_TRUE(IsSelecting()); |
| 1266 | 1266 |
| 1267 // Tap should now exit overview mode. | 1267 // Tap should now exit overview mode. |
| 1268 generator.GestureTapAt(point_in_background_page); | 1268 generator.GestureTapAt(point_in_background_page); |
| 1269 EXPECT_FALSE(IsSelecting()); | 1269 EXPECT_FALSE(IsSelecting()); |
| 1270 } | 1270 } |
| 1271 | 1271 |
| 1272 } // namespace ash | 1272 } // namespace ash |
| OLD | NEW |