| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "content/common/accessibility_mode_enums.h" | 10 #include "content/common/accessibility_mode.h" |
| 11 #include "ui/accessibility/ax_node_data.h" | 11 #include "ui/accessibility/ax_node_data.h" |
| 12 #include "ui/accessibility/ax_tree.h" | 12 #include "ui/accessibility/ax_tree.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 class MessageLoopRunner; | 16 class MessageLoopRunner; |
| 17 class RenderFrameHostImpl; | 17 class RenderFrameHostImpl; |
| 18 class WebContents; | 18 class WebContents; |
| 19 | 19 |
| 20 const AccessibilityMode kAccessibilityModeComplete( |
| 21 AccessibilityMode::kNativeAPIs | AccessibilityMode::kWebContents | |
| 22 AccessibilityMode::kInlineTextBoxes | |
| 23 AccessibilityMode::kScreenReader | |
| 24 AccessibilityMode::kHTML); |
| 25 |
| 26 const AccessibilityMode kAccessibilityModeWebContentsOnly( |
| 27 AccessibilityMode::kWebContents | AccessibilityMode::kInlineTextBoxes | |
| 28 AccessibilityMode::kScreenReader | |
| 29 AccessibilityMode::kHTML); |
| 30 |
| 20 // Create an instance of this class *before* doing any operation that | 31 // Create an instance of this class *before* doing any operation that |
| 21 // might generate an accessibility event (like a page navigation or | 32 // might generate an accessibility event (like a page navigation or |
| 22 // clicking on a button). Then call WaitForNotification | 33 // clicking on a button). Then call WaitForNotification |
| 23 // afterwards to block until the specified accessibility notification has been | 34 // afterwards to block until the specified accessibility notification has been |
| 24 // received. | 35 // received. |
| 25 class AccessibilityNotificationWaiter { | 36 class AccessibilityNotificationWaiter { |
| 26 public: | 37 public: |
| 27 explicit AccessibilityNotificationWaiter(WebContents* web_contents); | 38 explicit AccessibilityNotificationWaiter(WebContents* web_contents); |
| 28 AccessibilityNotificationWaiter( | 39 AccessibilityNotificationWaiter( |
| 29 WebContents* web_contents, | 40 WebContents* web_contents, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 RenderFrameHostImpl* event_render_frame_host_; | 83 RenderFrameHostImpl* event_render_frame_host_; |
| 73 | 84 |
| 74 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; | 85 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; |
| 75 | 86 |
| 76 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter); | 87 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter); |
| 77 }; | 88 }; |
| 78 | 89 |
| 79 } // namespace content | 90 } // namespace content |
| 80 | 91 |
| 81 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ | 92 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |