| 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_enums.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // AccessibilityNotificationWaiter is received. Ignores notifications for | 40 // AccessibilityNotificationWaiter is received. Ignores notifications for |
| 41 // "about:blank". | 41 // "about:blank". |
| 42 void WaitForNotification(); | 42 void WaitForNotification(); |
| 43 | 43 |
| 44 // After WaitForNotification has returned, this will retrieve | 44 // After WaitForNotification has returned, this will retrieve |
| 45 // the tree of accessibility nodes received from the renderer process. | 45 // the tree of accessibility nodes received from the renderer process. |
| 46 const ui::AXTree& GetAXTree() const; | 46 const ui::AXTree& GetAXTree() const; |
| 47 | 47 |
| 48 // After WaitForNotification returns, use this to retrieve the id of the | 48 // After WaitForNotification returns, use this to retrieve the id of the |
| 49 // node that was the target of the event. | 49 // node that was the target of the event. |
| 50 int event_target_id() { return event_target_id_; } | 50 int event_target_id() const { return event_target_id_; } |
| 51 |
| 52 // After WaitForNotification returns, use this to retrieve the |
| 53 // RenderFrameHostImpl that was the target of the event. |
| 54 RenderFrameHostImpl* event_render_frame_host() const { |
| 55 return event_render_frame_host_; |
| 56 } |
| 51 | 57 |
| 52 private: | 58 private: |
| 53 // Callback from RenderViewHostImpl. | 59 // Callback from RenderViewHostImpl. |
| 54 void OnAccessibilityEvent(ui::AXEvent event, int event_target_id); | 60 void OnAccessibilityEvent(content::RenderFrameHostImpl* rfhi, |
| 61 ui::AXEvent event, |
| 62 int event_target_id); |
| 55 | 63 |
| 56 // Helper function to determine if the accessibility tree in | 64 // Helper function to determine if the accessibility tree in |
| 57 // GetAXTree() is about the page with the url "about:blank". | 65 // GetAXTree() is about the page with the url "about:blank". |
| 58 bool IsAboutBlank(); | 66 bool IsAboutBlank(); |
| 59 | 67 |
| 60 RenderFrameHostImpl* frame_host_; | 68 RenderFrameHostImpl* frame_host_; |
| 61 ui::AXEvent event_to_wait_for_; | 69 ui::AXEvent event_to_wait_for_; |
| 62 scoped_refptr<MessageLoopRunner> loop_runner_; | 70 scoped_refptr<MessageLoopRunner> loop_runner_; |
| 63 int event_target_id_; | 71 int event_target_id_; |
| 72 RenderFrameHostImpl* event_render_frame_host_; |
| 64 | 73 |
| 65 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; | 74 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; |
| 66 | 75 |
| 67 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter); | 76 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter); |
| 68 }; | 77 }; |
| 69 | 78 |
| 70 } // namespace content | 79 } // namespace content |
| 71 | 80 |
| 72 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ | 81 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |