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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 expected_bounds = gfx::Rect(112, -32, 75, 32); | 395 expected_bounds = gfx::Rect(112, -32, 75, 32); |
396 expected_bounds_MD = gfx::Rect(10, -40, 280, 40); | 396 expected_bounds_MD = gfx::Rect(10, -40, 280, 40); |
397 EXPECT_EQ((material ? expected_bounds_MD : expected_bounds).ToString(), | 397 EXPECT_EQ((material ? expected_bounds_MD : expected_bounds).ToString(), |
398 text_filter->GetClientAreaBoundsInScreen().ToString()); | 398 text_filter->GetClientAreaBoundsInScreen().ToString()); |
399 } | 399 } |
400 #endif | 400 #endif |
401 | 401 |
402 // Tests that an a11y alert is sent on entering overview mode. | 402 // Tests that an a11y alert is sent on entering overview mode. |
403 TEST_P(WindowSelectorTest, A11yAlertOnOverviewMode) { | 403 TEST_P(WindowSelectorTest, A11yAlertOnOverviewMode) { |
404 gfx::Rect bounds(0, 0, 400, 400); | 404 gfx::Rect bounds(0, 0, 400, 400); |
405 AccessibilityDelegate* delegate = WmShell::Get()->GetAccessibilityDelegate(); | 405 AccessibilityDelegate* delegate = WmShell::Get()->accessibility_delegate(); |
406 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 406 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
407 EXPECT_NE(delegate->GetLastAccessibilityAlert(), | 407 EXPECT_NE(delegate->GetLastAccessibilityAlert(), |
408 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | 408 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
409 ToggleOverview(); | 409 ToggleOverview(); |
410 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), | 410 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), |
411 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); | 411 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); |
412 } | 412 } |
413 | 413 |
414 // Tests that there are no crashes when there is not enough screen space | 414 // Tests that there are no crashes when there is not enough screen space |
415 // available to show all of the windows. | 415 // available to show all of the windows. |
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1845 bounds.y()); | 1845 bounds.y()); |
1846 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); | 1846 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); |
1847 EXPECT_NEAR(transformed_rect.x() - bounds.x(), | 1847 EXPECT_NEAR(transformed_rect.x() - bounds.x(), |
1848 bounds.right() - transformed_rect.right(), 1); | 1848 bounds.right() - transformed_rect.right(), 1); |
1849 EXPECT_NEAR( | 1849 EXPECT_NEAR( |
1850 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), | 1850 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), |
1851 bounds.bottom() - transformed_rect.bottom(), 1); | 1851 bounds.bottom() - transformed_rect.bottom(), 1); |
1852 } | 1852 } |
1853 | 1853 |
1854 } // namespace ash | 1854 } // namespace ash |
OLD | NEW |