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

Side by Side Diff: content/test/accessibility_browser_test_utils.h

Issue 116293005: Refactor content/ to use ui::AXNodeData instead of blink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update content/DEPS instead of subdirs Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ 5 #ifndef CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_
6 #define CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ 6 #define CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "content/common/accessibility_node_data.h"
10 #include "content/common/view_message_enums.h" 9 #include "content/common/view_message_enums.h"
10 #include "ui/accessibility/ax_node_data.h"
11 #include "ui/accessibility/ax_tree.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 class MessageLoopRunner; 15 class MessageLoopRunner;
15 class RenderViewHostImpl; 16 class RenderViewHostImpl;
16 class Shell; 17 class Shell;
17 18
18 // Create an instance of this class *before* doing any operation that 19 // Create an instance of this class *before* doing any operation that
19 // might generate an accessibility event (like a page navigation or 20 // might generate an accessibility event (like a page navigation or
20 // clicking on a button). Then call WaitForNotification 21 // clicking on a button). Then call WaitForNotification
21 // afterwards to block until the specified accessibility notification has been 22 // afterwards to block until the specified accessibility notification has been
22 // received. 23 // received.
23 class AccessibilityNotificationWaiter { 24 class AccessibilityNotificationWaiter {
24 public: 25 public:
25 AccessibilityNotificationWaiter( 26 AccessibilityNotificationWaiter(
26 Shell* shell, 27 Shell* shell,
27 AccessibilityMode accessibility_mode, 28 AccessibilityMode accessibility_mode,
28 blink::WebAXEvent event); 29 ui::AXEvent event);
29 ~AccessibilityNotificationWaiter(); 30 ~AccessibilityNotificationWaiter();
30 31
31 // Blocks until the specific accessibility notification registered in 32 // Blocks until the specific accessibility notification registered in
32 // AccessibilityNotificationWaiter is received. Ignores notifications for 33 // AccessibilityNotificationWaiter is received. Ignores notifications for
33 // "about:blank". 34 // "about:blank".
34 void WaitForNotification(); 35 void WaitForNotification();
35 36
36 // After WaitForNotification has returned, this will retrieve 37 // After WaitForNotification has returned, this will retrieve
37 // the tree of accessibility nodes received from the renderer process. 38 // the tree of accessibility nodes received from the renderer process.
38 const AccessibilityNodeDataTreeNode& GetAccessibilityNodeDataTree() const; 39 const ui::AXTree& GetAXTree() const;
39 40
40 private: 41 private:
41 // Callback from RenderViewHostImpl. 42 // Callback from RenderViewHostImpl.
42 void OnAccessibilityEvent(blink::WebAXEvent event); 43 void OnAccessibilityEvent(ui::AXEvent event);
43 44
44 // Helper function to determine if the accessibility tree in 45 // Helper function to determine if the accessibility tree in
45 // GetAccessibilityNodeDataTree() is about the page with the url 46 // GetAXTree() is about the page with the url "about:blank".
46 // "about:blank".
47 bool IsAboutBlank(); 47 bool IsAboutBlank();
48 48
49 Shell* shell_; 49 Shell* shell_;
50 RenderViewHostImpl* view_host_; 50 RenderViewHostImpl* view_host_;
51 blink::WebAXEvent event_to_wait_for_; 51 ui::AXEvent event_to_wait_for_;
52 scoped_refptr<MessageLoopRunner> loop_runner_; 52 scoped_refptr<MessageLoopRunner> loop_runner_;
53 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; 53 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter); 55 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter);
56 }; 56 };
57 57
58 } // namespace content 58 } // namespace content
59 59
60 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ 60 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/renderer/accessibility/renderer_accessibility_focus_only.cc ('k') | content/test/accessibility_browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698