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

Side by Side Diff: content/browser/accessibility/android_granularity_movement_browsertest.cc

Issue 2426193003: Re-land: Create AXAction and AXActionData as a way to simplify accessibility actions (Closed)
Patch Set: Rebase 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // Also calls PreviousAtGranularity from the end back to the beginning 65 // Also calls PreviousAtGranularity from the end back to the beginning
66 // and fails (by logging an error and returning the empty string) if 66 // and fails (by logging an error and returning the empty string) if
67 // the result when traversing backwards is not the same 67 // the result when traversing backwards is not the same
68 // (but in reverse order). 68 // (but in reverse order).
69 base::string16 TraverseNodeAtGranularity( 69 base::string16 TraverseNodeAtGranularity(
70 BrowserAccessibility* node, 70 BrowserAccessibility* node,
71 int granularity) { 71 int granularity) {
72 AccessibilityNotificationWaiter waiter( 72 AccessibilityNotificationWaiter waiter(
73 shell()->web_contents(), AccessibilityModeComplete, 73 shell()->web_contents(), AccessibilityModeComplete,
74 ui::AX_EVENT_TREE_CHANGED); 74 ui::AX_EVENT_TREE_CHANGED);
75 node->manager()->delegate()->AccessibilitySetAccessibilityFocus( 75 node->manager()->SetAccessibilityFocus(*node);
76 node->GetId());
77 waiter.WaitForNotification(); 76 waiter.WaitForNotification();
78 77
79 int start_index = -1; 78 int start_index = -1;
80 int end_index = -1; 79 int end_index = -1;
81 BrowserAccessibilityAndroid* android_node = 80 BrowserAccessibilityAndroid* android_node =
82 static_cast<BrowserAccessibilityAndroid*>(node); 81 static_cast<BrowserAccessibilityAndroid*>(node);
83 BrowserAccessibilityManagerAndroid* manager = 82 BrowserAccessibilityManagerAndroid* manager =
84 static_cast<BrowserAccessibilityManagerAndroid*>(node->manager()); 83 static_cast<BrowserAccessibilityManagerAndroid*>(node->manager());
85 base::string16 text = android_node->GetText(); 84 base::string16 text = android_node->GetText();
86 base::string16 concatenated; 85 base::string16 concatenated;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 BrowserAccessibility* root = LoadUrlAndGetAccessibilityRoot(url); 201 BrowserAccessibility* root = LoadUrlAndGetAccessibilityRoot(url);
203 ASSERT_EQ(1U, root->PlatformChildCount()); 202 ASSERT_EQ(1U, root->PlatformChildCount());
204 BrowserAccessibility* pre = root->PlatformGetChild(0); 203 BrowserAccessibility* pre = root->PlatformGetChild(0);
205 ASSERT_EQ(0U, pre->PlatformChildCount()); 204 ASSERT_EQ(0U, pre->PlatformChildCount());
206 205
207 ASSERT_EQ(base::ASCIIToUTF16("'One,', 'two,', 'three!'"), 206 ASSERT_EQ(base::ASCIIToUTF16("'One,', 'two,', 'three!'"),
208 TraverseNodeAtGranularity(pre, GRANULARITY_LINE)); 207 TraverseNodeAtGranularity(pre, GRANULARITY_LINE));
209 } 208 }
210 209
211 } // namespace content 210 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/automation_internal.idl ('k') | content/browser/accessibility/browser_accessibility_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698