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