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

Side by Side Diff: components/exo/shell_surface_unittest.cc

Issue 2407303003: exo: Use WMHelper to access ash accessibility related features. (Closed)
Patch Set: Fix compile errors. Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/aura/wm_window_aura.h" 5 #include "ash/aura/wm_window_aura.h"
6 #include "ash/common/accessibility_delegate.h" 6 #include "ash/common/accessibility_delegate.h"
7 #include "ash/common/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/common/wm/wm_event.h" 9 #include "ash/common/wm/wm_event.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 719 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
720 gfx::Point pt2(250, 250); 720 gfx::Point pt2(250, 250);
721 ui::MouseEvent ev_in(ui::ET_MOUSE_PRESSED, pt2, pt2, ui::EventTimeForNow(), 721 ui::MouseEvent ev_in(ui::ET_MOUSE_PRESSED, pt2, pt2, ui::EventTimeForNow(),
722 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 722 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
723 723
724 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out)); 724 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out));
725 725
726 // Enable spoken feedback. 726 // Enable spoken feedback.
727 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( 727 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback(
728 ash::A11Y_NOTIFICATION_NONE); 728 ash::A11Y_NOTIFICATION_NONE);
729 shell_surface.OnAccessibilityModeChanged(ash::A11Y_NOTIFICATION_NONE); 729 shell_surface.OnAccessibilityModeChanged();
730 730
731 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), 731 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(),
732 shell_surface.shadow_underlay()->bounds()); 732 shell_surface.shadow_underlay()->bounds());
733 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 733 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
734 EXPECT_NE(shell_surface.GetWidget()->GetWindowBoundsInScreen(), 734 EXPECT_NE(shell_surface.GetWidget()->GetWindowBoundsInScreen(),
735 shell_surface.shadow_underlay()->bounds()); 735 shell_surface.shadow_underlay()->bounds());
736 736
737 // Test event capture 737 // Test event capture
738 EXPECT_TRUE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out)); 738 EXPECT_TRUE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out));
739 EXPECT_EQ(shell_surface.shadow_underlay(), 739 EXPECT_EQ(shell_surface.shadow_underlay(),
(...skipping 15 matching lines...) Expand all
755 // spoken-feedback was already on, so underlay should fill screen 755 // spoken-feedback was already on, so underlay should fill screen
756 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), 756 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(),
757 shell_surface2.shadow_underlay()->bounds()); 757 shell_surface2.shadow_underlay()->bounds());
758 758
759 // De-activated shell-surface should NOT have fullscreen underlay 759 // De-activated shell-surface should NOT have fullscreen underlay
760 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 760 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
761 761
762 // Disable spoken feedback. Shadow underlay is restored. 762 // Disable spoken feedback. Shadow underlay is restored.
763 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( 763 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback(
764 ash::A11Y_NOTIFICATION_NONE); 764 ash::A11Y_NOTIFICATION_NONE);
765 shell_surface.OnAccessibilityModeChanged(ash::A11Y_NOTIFICATION_NONE); 765 shell_surface.OnAccessibilityModeChanged();
766 shell_surface2.OnAccessibilityModeChanged(ash::A11Y_NOTIFICATION_NONE); 766 shell_surface2.OnAccessibilityModeChanged();
767 767
768 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 768 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
769 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 769 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
770 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 770 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
771 } 771 }
772 772
773 } // namespace 773 } // namespace
774 } // namespace exo 774 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698