| 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 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
| 10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 } | 354 } |
| 355 | 355 |
| 356 private: | 356 private: |
| 357 aura::test::TestWindowDelegate delegate_; | 357 aura::test::TestWindowDelegate delegate_; |
| 358 NonActivatableActivationDelegate non_activatable_activation_delegate_; | 358 NonActivatableActivationDelegate non_activatable_activation_delegate_; |
| 359 std::unique_ptr<test::ShelfViewTestAPI> shelf_view_test_; | 359 std::unique_ptr<test::ShelfViewTestAPI> shelf_view_test_; |
| 360 | 360 |
| 361 DISALLOW_COPY_AND_ASSIGN(WindowSelectorTest); | 361 DISALLOW_COPY_AND_ASSIGN(WindowSelectorTest); |
| 362 }; | 362 }; |
| 363 | 363 |
| 364 #if !defined(OS_WIN) || defined(USE_ASH) | |
| 365 // TODO(msw): Broken on Windows. http://crbug.com/584038 | |
| 366 // Tests that the text field in the overview menu is repositioned and resized | 364 // Tests that the text field in the overview menu is repositioned and resized |
| 367 // after a screen rotation. | 365 // after a screen rotation. |
| 368 TEST_F(WindowSelectorTest, OverviewScreenRotation) { | 366 TEST_F(WindowSelectorTest, OverviewScreenRotation) { |
| 369 gfx::Rect bounds(0, 0, 400, 300); | 367 gfx::Rect bounds(0, 0, 400, 300); |
| 370 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 368 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 371 std::unique_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); | 369 std::unique_ptr<aura::Window> panel1(CreatePanelWindow(bounds)); |
| 372 | 370 |
| 373 // In overview mode the windows should no longer overlap and the text filter | 371 // In overview mode the windows should no longer overlap and the text filter |
| 374 // widget should be focused. | 372 // widget should be focused. |
| 375 ToggleOverview(); | 373 ToggleOverview(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 389 | 387 |
| 390 // Rotates the display, which triggers the WindowSelector's | 388 // Rotates the display, which triggers the WindowSelector's |
| 391 // RepositionTextFilterOnDisplayMetricsChange method. | 389 // RepositionTextFilterOnDisplayMetricsChange method. |
| 392 UpdateDisplay("400x300/r"); | 390 UpdateDisplay("400x300/r"); |
| 393 | 391 |
| 394 // Uses the same formulas as above using width = 300, height = 400. | 392 // Uses the same formulas as above using width = 300, height = 400. |
| 395 expected_bounds = gfx::Rect(10, -40, 280, 40); | 393 expected_bounds = gfx::Rect(10, -40, 280, 40); |
| 396 EXPECT_EQ(expected_bounds.ToString(), | 394 EXPECT_EQ(expected_bounds.ToString(), |
| 397 text_filter->GetClientAreaBoundsInScreen().ToString()); | 395 text_filter->GetClientAreaBoundsInScreen().ToString()); |
| 398 } | 396 } |
| 399 #endif | |
| 400 | 397 |
| 401 // Tests that an a11y alert is sent on entering overview mode. | 398 // Tests that an a11y alert is sent on entering overview mode. |
| 402 TEST_F(WindowSelectorTest, A11yAlertOnOverviewMode) { | 399 TEST_F(WindowSelectorTest, A11yAlertOnOverviewMode) { |
| 403 gfx::Rect bounds(0, 0, 400, 400); | 400 gfx::Rect bounds(0, 0, 400, 400); |
| 404 AccessibilityDelegate* delegate = WmShell::Get()->accessibility_delegate(); | 401 AccessibilityDelegate* delegate = WmShell::Get()->accessibility_delegate(); |
| 405 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 402 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 406 EXPECT_NE(delegate->GetLastAccessibilityAlert(), | 403 EXPECT_NE(delegate->GetLastAccessibilityAlert(), |
| 407 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | 404 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
| 408 ToggleOverview(); | 405 ToggleOverview(); |
| 409 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), | 406 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), |
| (...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2128 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE)); | 2125 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE)); |
| 2129 ASSERT_TRUE(resizer.get()); | 2126 ASSERT_TRUE(resizer.get()); |
| 2130 gfx::Point location = resizer->GetInitialLocation(); | 2127 gfx::Point location = resizer->GetInitialLocation(); |
| 2131 location.Offset(20, 20); | 2128 location.Offset(20, 20); |
| 2132 resizer->Drag(location, 0); | 2129 resizer->Drag(location, 0); |
| 2133 ToggleOverview(); | 2130 ToggleOverview(); |
| 2134 resizer->RevertDrag(); | 2131 resizer->RevertDrag(); |
| 2135 } | 2132 } |
| 2136 | 2133 |
| 2137 } // namespace ash | 2134 } // namespace ash |
| OLD | NEW |