Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/view_message_enums.h" | 9 #include "content/common/view_message_enums.h" |
| 10 #include "ui/accessibility/ax_node_data.h" | 10 #include "ui/accessibility/ax_node_data.h" |
| 11 #include "ui/accessibility/ax_tree.h" | 11 #include "ui/accessibility/ax_tree.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class MessageLoopRunner; | 15 class MessageLoopRunner; |
| 16 class RenderViewHostImpl; | 16 class RenderViewHostImpl; |
| 17 class Shell; | 17 class Shell; |
| 18 | 18 |
| 19 // Create an instance of this class *before* doing any operation that | 19 // Create an instance of this class *before* doing any operation that |
| 20 // might generate an accessibility event (like a page navigation or | 20 // might generate an accessibility event (like a page navigation or |
| 21 // clicking on a button). Then call WaitForNotification | 21 // clicking on a button). Then call WaitForNotification |
| 22 // afterwards to block until the specified accessibility notification has been | 22 // afterwards to block until the specified accessibility notification has been |
| 23 // received. | 23 // received. |
| 24 class AccessibilityNotificationWaiter { | 24 class AccessibilityNotificationWaiter { |
| 25 public: | 25 public: |
| 26 explicit AccessibilityNotificationWaiter(Shell* shell); | |
| 27 | |
| 28 AccessibilityNotificationWaiter( | 26 AccessibilityNotificationWaiter( |
| 29 Shell* shell, | 27 Shell* shell, |
| 30 AccessibilityMode accessibility_mode, | 28 AccessibilityMode accessibility_mode = AccessibilityModeOff, |
| 31 ui::AXEvent event); | 29 ui::AXEvent event = ui::AX_EVENT_NONE, |
| 30 RenderViewHostImpl* render_view_host_impl = NULL); | |
|
ncarter (slow)
2014/05/02 19:10:02
For some reason, the style guide says you oughta h
| |
| 32 ~AccessibilityNotificationWaiter(); | 31 ~AccessibilityNotificationWaiter(); |
| 33 | 32 |
| 34 // Blocks until the specific accessibility notification registered in | 33 // Blocks until the specific accessibility notification registered in |
| 35 // AccessibilityNotificationWaiter is received. Ignores notifications for | 34 // AccessibilityNotificationWaiter is received. Ignores notifications for |
| 36 // "about:blank". | 35 // "about:blank". |
| 37 void WaitForNotification(); | 36 void WaitForNotification(); |
| 38 | 37 |
| 39 // After WaitForNotification has returned, this will retrieve | 38 // After WaitForNotification has returned, this will retrieve |
| 40 // the tree of accessibility nodes received from the renderer process. | 39 // the tree of accessibility nodes received from the renderer process. |
| 41 const ui::AXTree& GetAXTree() const; | 40 const ui::AXTree& GetAXTree() const; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 53 ui::AXEvent event_to_wait_for_; | 52 ui::AXEvent event_to_wait_for_; |
| 54 scoped_refptr<MessageLoopRunner> loop_runner_; | 53 scoped_refptr<MessageLoopRunner> loop_runner_; |
| 55 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; | 54 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; |
| 56 | 55 |
| 57 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter); | 56 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 } // namespace content | 59 } // namespace content |
| 61 | 60 |
| 62 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ | 61 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |