Removed unused VideoCaptureCapability parameters.
[chromium-blink-merge.git] / content / test / accessibility_browser_test_utils.h
blob4802780c889d6fceb748e9324cb01281db80fdc3
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_
6 #define CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_
8 #include "base/memory/weak_ptr.h"
9 #include "content/common/accessibility_node_data.h"
10 #include "content/common/view_message_enums.h"
12 namespace content {
14 class MessageLoopRunner;
15 class RenderViewHostImpl;
16 class Shell;
18 // Create an instance of this class *before* doing any operation that
19 // might generate an accessibility event (like a page navigation or
20 // clicking on a button). Then call WaitForNotification
21 // afterwards to block until the specified accessibility notification has been
22 // received.
23 class AccessibilityNotificationWaiter {
24 public:
25 AccessibilityNotificationWaiter(
26 Shell* shell,
27 AccessibilityMode accessibility_mode,
28 WebKit::WebAXEvent event);
29 ~AccessibilityNotificationWaiter();
31 // Blocks until the specific accessibility notification registered in
32 // AccessibilityNotificationWaiter is received. Ignores notifications for
33 // "about:blank".
34 void WaitForNotification();
36 // After WaitForNotification has returned, this will retrieve
37 // the tree of accessibility nodes received from the renderer process.
38 const AccessibilityNodeDataTreeNode& GetAccessibilityNodeDataTree() const;
40 private:
41 // Callback from RenderViewHostImpl.
42 void OnAccessibilityEvent(WebKit::WebAXEvent event);
44 // Helper function to determine if the accessibility tree in
45 // GetAccessibilityNodeDataTree() is about the page with the url
46 // "about:blank".
47 bool IsAboutBlank();
49 Shell* shell_;
50 RenderViewHostImpl* view_host_;
51 WebKit::WebAXEvent event_to_wait_for_;
52 scoped_refptr<MessageLoopRunner> loop_runner_;
53 base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_;
55 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotificationWaiter);
58 } // namespace content
60 #endif // CONTENT_TEST_ACCESSIBILITY_BROWSER_TEST_UTILS_H_