Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(916)

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2078393005: mash: Move accessibility_types.h from ui namespace to ash namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a11y
Patch Set: fix chromevox code generated from js Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ash_switches.h" 11 #include "ash/common/ash_switches.h"
11 #include "ash/common/material_design/material_design_controller.h" 12 #include "ash/common/material_design/material_design_controller.h"
12 #include "ash/common/shell_window_ids.h" 13 #include "ash/common/shell_window_ids.h"
13 #include "ash/common/wm/mru_window_tracker.h" 14 #include "ash/common/wm/mru_window_tracker.h"
14 #include "ash/common/wm/panels/panel_layout_manager.h" 15 #include "ash/common/wm/panels/panel_layout_manager.h"
15 #include "ash/common/wm/window_state.h" 16 #include "ash/common/wm/window_state.h"
16 #include "ash/common/wm/wm_event.h" 17 #include "ash/common/wm/wm_event.h"
17 #include "ash/drag_drop/drag_drop_controller.h" 18 #include "ash/drag_drop/drag_drop_controller.h"
18 #include "ash/root_window_controller.h" 19 #include "ash/root_window_controller.h"
19 #include "ash/screen_util.h" 20 #include "ash/screen_util.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 } 393 }
393 #endif 394 #endif
394 395
395 // Tests that an a11y alert is sent on entering overview mode. 396 // Tests that an a11y alert is sent on entering overview mode.
396 TEST_P(WindowSelectorTest, A11yAlertOnOverviewMode) { 397 TEST_P(WindowSelectorTest, A11yAlertOnOverviewMode) {
397 gfx::Rect bounds(0, 0, 400, 400); 398 gfx::Rect bounds(0, 0, 400, 400);
398 AccessibilityDelegate* delegate = 399 AccessibilityDelegate* delegate =
399 ash::Shell::GetInstance()->accessibility_delegate(); 400 ash::Shell::GetInstance()->accessibility_delegate();
400 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); 401 std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
401 EXPECT_NE(delegate->GetLastAccessibilityAlert(), 402 EXPECT_NE(delegate->GetLastAccessibilityAlert(),
402 ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); 403 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED);
403 ToggleOverview(); 404 ToggleOverview();
404 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), 405 EXPECT_EQ(delegate->GetLastAccessibilityAlert(),
405 ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED); 406 A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED);
406 } 407 }
407 408
408 // Tests that there are no crashes when there is not enough screen space 409 // Tests that there are no crashes when there is not enough screen space
409 // available to show all of the windows. 410 // available to show all of the windows.
410 TEST_P(WindowSelectorTest, SmallDisplay) { 411 TEST_P(WindowSelectorTest, SmallDisplay) {
411 UpdateDisplay("3x1"); 412 UpdateDisplay("3x1");
412 gfx::Rect bounds(0, 0, 1, 1); 413 gfx::Rect bounds(0, 0, 1, 1);
413 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); 414 std::unique_ptr<aura::Window> window1(CreateWindow(bounds));
414 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); 415 std::unique_ptr<aura::Window> window2(CreateWindow(bounds));
415 std::unique_ptr<aura::Window> window3(CreateWindow(bounds)); 416 std::unique_ptr<aura::Window> window3(CreateWindow(bounds));
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 bounds.y()); 1830 bounds.y());
1830 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); 1831 EXPECT_LE(transformed_rect.bottom(), bounds.bottom());
1831 EXPECT_NEAR(transformed_rect.x() - bounds.x(), 1832 EXPECT_NEAR(transformed_rect.x() - bounds.x(),
1832 bounds.right() - transformed_rect.right(), 1); 1833 bounds.right() - transformed_rect.right(), 1);
1833 EXPECT_NEAR( 1834 EXPECT_NEAR(
1834 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), 1835 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(),
1835 bounds.bottom() - transformed_rect.bottom(), 1); 1836 bounds.bottom() - transformed_rect.bottom(), 1);
1836 } 1837 }
1837 1838
1838 } // namespace ash 1839 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector.cc ('k') | chrome/browser/apps/guest_view/web_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698