OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/accessibility/accessibility_test_utils.h" | 5 #include "content/browser/accessibility/accessibility_test_utils.h" |
6 | 6 |
7 #include "content/browser/accessibility/browser_accessibility.h" | 7 #include "content/browser/accessibility/browser_accessibility.h" |
8 #include "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/render_frame_host_impl.h" | 10 #include "content/browser/frame_host/render_frame_host_impl.h" |
11 #include "content/browser/web_contents/web_contents_impl.h" | 11 #include "content/browser/web_contents/web_contents_impl.h" |
12 #include "content/test/accessibility_browser_test_utils.h" | 12 #include "content/test/accessibility_browser_test_utils.h" |
| 13 #include "ui/accessibility/ax_enums.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 bool AccessibilityTreeContainsNodeWithName(BrowserAccessibility* node, | 17 bool AccessibilityTreeContainsNodeWithName(BrowserAccessibility* node, |
17 const std::string& name) { | 18 const std::string& name) { |
18 if (node->GetStringAttribute(ui::AX_ATTR_NAME) == name) | 19 if (node->GetStringAttribute(ui::AX_ATTR_NAME) == name) |
19 return true; | 20 return true; |
20 for (unsigned i = 0; i < node->PlatformChildCount(); i++) { | 21 for (unsigned i = 0; i < node->PlatformChildCount(); i++) { |
21 if (AccessibilityTreeContainsNodeWithName(node->PlatformGetChild(i), name)) | 22 if (AccessibilityTreeContainsNodeWithName(node->PlatformGetChild(i), name)) |
22 return true; | 23 return true; |
(...skipping 16 matching lines...) Expand all Loading... |
39 ui::AX_EVENT_NONE); | 40 ui::AX_EVENT_NONE); |
40 for (FrameTreeNode* node : frame_tree->Nodes()) | 41 for (FrameTreeNode* node : frame_tree->Nodes()) |
41 accessibility_waiter.ListenToAdditionalFrame( | 42 accessibility_waiter.ListenToAdditionalFrame( |
42 node->current_frame_host()); | 43 node->current_frame_host()); |
43 | 44 |
44 accessibility_waiter.WaitForNotification(); | 45 accessibility_waiter.WaitForNotification(); |
45 } | 46 } |
46 } | 47 } |
47 | 48 |
48 } // namespace | 49 } // namespace |
OLD | NEW |