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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Revert comment. Created 3 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <tuple> 8 #include <tuple>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 BrowserAccessibilityManager::SetFocusChangeCallbackForTesting( 1112 BrowserAccessibilityManager::SetFocusChangeCallbackForTesting(
1113 loop_runner->QuitClosure()); 1113 loop_runner->QuitClosure());
1114 loop_runner->Run(); 1114 loop_runner->Run();
1115 } 1115 }
1116 1116
1117 ui::AXNodeData GetFocusedAccessibilityNodeInfo(WebContents* web_contents) { 1117 ui::AXNodeData GetFocusedAccessibilityNodeInfo(WebContents* web_contents) {
1118 WebContentsImpl* web_contents_impl = 1118 WebContentsImpl* web_contents_impl =
1119 static_cast<WebContentsImpl*>(web_contents); 1119 static_cast<WebContentsImpl*>(web_contents);
1120 BrowserAccessibilityManager* manager = 1120 BrowserAccessibilityManager* manager =
1121 web_contents_impl->GetRootBrowserAccessibilityManager(); 1121 web_contents_impl->GetRootBrowserAccessibilityManager();
1122 if (!manager) 1122 if (!manager) {
1123 return ui::AXNodeData(); 1123 ui::AXNodeData data = ui::AXNodeData();
tapted 2017/05/05 05:53:36 nit: = `ui::AXNodeData();` not required
Patti Lor 2017/05/08 00:28:08 Oops, thanks.
1124 data.ClearBitfields();
1125 return data;
1126 }
1124 BrowserAccessibility* focused_node = manager->GetFocus(); 1127 BrowserAccessibility* focused_node = manager->GetFocus();
1125 return focused_node->GetData(); 1128 return focused_node->GetData();
1126 } 1129 }
1127 1130
1128 bool AccessibilityTreeContainsNodeWithName(BrowserAccessibility* node, 1131 bool AccessibilityTreeContainsNodeWithName(BrowserAccessibility* node,
1129 const std::string& name) { 1132 const std::string& name) {
1130 if (node->GetStringAttribute(ui::AX_ATTR_NAME) == name) 1133 if (node->GetStringAttribute(ui::AX_ATTR_NAME) == name)
1131 return true; 1134 return true;
1132 for (unsigned i = 0; i < node->PlatformChildCount(); i++) { 1135 for (unsigned i = 0; i < node->PlatformChildCount(); i++) {
1133 if (AccessibilityTreeContainsNodeWithName(node->PlatformGetChild(i), name)) 1136 if (AccessibilityTreeContainsNodeWithName(node->PlatformGetChild(i), name))
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 bool user_gesture, 2034 bool user_gesture,
2032 bool last_unlocked_by_target, 2035 bool last_unlocked_by_target,
2033 bool privileged) { 2036 bool privileged) {
2034 IPC::IpcSecurityTestUtil::PwnMessageReceived( 2037 IPC::IpcSecurityTestUtil::PwnMessageReceived(
2035 process->GetChannel(), 2038 process->GetChannel(),
2036 ViewHostMsg_LockMouse(routing_id, user_gesture, last_unlocked_by_target, 2039 ViewHostMsg_LockMouse(routing_id, user_gesture, last_unlocked_by_target,
2037 privileged)); 2040 privileged));
2038 } 2041 }
2039 2042
2040 } // namespace content 2043 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698