| OLD | NEW |
| 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/common/accessibility_delegate.h" | 5 #include "ash/common/accessibility_delegate.h" |
| 6 #include "ash/common/wm/window_state.h" | 6 #include "ash/common/wm/window_state.h" |
| 7 #include "ash/common/wm/wm_event.h" | 7 #include "ash/common/wm/wm_event.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/common/wm_window.h" | 9 #include "ash/common/wm_window.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| 11 #include "ash/wm/window_state_aura.h" | 11 #include "ash/wm/window_state_aura.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "components/exo/buffer.h" | 14 #include "components/exo/buffer.h" |
| 15 #include "components/exo/display.h" | 15 #include "components/exo/display.h" |
| 16 #include "components/exo/shell_surface.h" | 16 #include "components/exo/shell_surface.h" |
| 17 #include "components/exo/sub_surface.h" | 17 #include "components/exo/sub_surface.h" |
| 18 #include "components/exo/surface.h" | 18 #include "components/exo/surface.h" |
| 19 #include "components/exo/test/exo_test_base.h" | 19 #include "components/exo/test/exo_test_base.h" |
| 20 #include "components/exo/test/exo_test_helper.h" | 20 #include "components/exo/test/exo_test_helper.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "ui/accessibility/ax_enums.h" |
| 23 #include "ui/accessibility/ax_node_data.h" |
| 22 #include "ui/aura/client/aura_constants.h" | 24 #include "ui/aura/client/aura_constants.h" |
| 23 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_targeter.h" | 26 #include "ui/aura/window_targeter.h" |
| 25 #include "ui/base/hit_test.h" | 27 #include "ui/base/hit_test.h" |
| 26 #include "ui/display/display.h" | 28 #include "ui/display/display.h" |
| 27 #include "ui/display/screen.h" | 29 #include "ui/display/screen.h" |
| 28 #include "ui/events/base_event_utils.h" | 30 #include "ui/events/base_event_utils.h" |
| 29 #include "ui/views/widget/widget.h" | 31 #include "ui/views/widget/widget.h" |
| 30 #include "ui/wm/core/shadow.h" | 32 #include "ui/wm/core/shadow.h" |
| 31 #include "ui/wm/core/shadow_controller.h" | 33 #include "ui/wm/core/shadow_controller.h" |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( | 824 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( |
| 823 ash::A11Y_NOTIFICATION_NONE); | 825 ash::A11Y_NOTIFICATION_NONE); |
| 824 shell_surface.OnAccessibilityModeChanged(); | 826 shell_surface.OnAccessibilityModeChanged(); |
| 825 shell_surface2.OnAccessibilityModeChanged(); | 827 shell_surface2.OnAccessibilityModeChanged(); |
| 826 | 828 |
| 827 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 829 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
| 828 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 830 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
| 829 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); | 831 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); |
| 830 } | 832 } |
| 831 | 833 |
| 834 TEST_F(ShellSurfaceTest, AccessibilityNodeData) { |
| 835 gfx::Size buffer_size(256, 256); |
| 836 Buffer buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)); |
| 837 Surface surface; |
| 838 ShellSurface shell_surface(&surface, nullptr, gfx::Rect(640, 480), true, |
| 839 false, ash::kShellWindowId_DefaultContainer); |
| 840 |
| 841 surface.Attach(&buffer); |
| 842 |
| 843 ui::AXNodeData data; |
| 844 surface.UpdateAXTreeID(1); |
| 845 shell_surface.GetAccessibleNodeData(&data); |
| 846 ASSERT_EQ(1, data.GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); |
| 847 |
| 848 ui::AXNodeData data2; |
| 849 surface.UpdateAXTreeID(2); |
| 850 shell_surface.GetAccessibleNodeData(&data2); |
| 851 ASSERT_EQ(2, data2.GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); |
| 852 |
| 853 ui::AXNodeData data3; |
| 854 surface.UpdateAXTreeID(0); |
| 855 shell_surface.GetAccessibleNodeData(&data3); |
| 856 ASSERT_EQ(0, data3.GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); |
| 857 } |
| 858 |
| 832 } // namespace | 859 } // namespace |
| 833 } // namespace exo | 860 } // namespace exo |
| OLD | NEW |