| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| 18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "cc/output/compositor_frame.h" | 20 #include "cc/output/compositor_frame.h" |
| 21 #include "content/public/browser/browser_message_filter.h" | 21 #include "content/public/browser/browser_message_filter.h" |
| 22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 24 #include "content/public/browser/render_process_host_observer.h" | 24 #include "content/public/browser/render_process_host_observer.h" |
| 25 #include "content/public/browser/web_contents_observer.h" | 25 #include "content/public/browser/web_contents_observer.h" |
| 26 #include "content/public/common/page_type.h" | 26 #include "content/public/common/page_type.h" |
| 27 #include "ipc/message_filter.h" | 27 #include "ipc/message_filter.h" |
| 28 #include "third_party/WebKit/public/web/WebInputEvent.h" | 28 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 29 #include "ui/accessibility/ax_node_data.h" |
| 29 #include "ui/events/keycodes/keyboard_codes.h" | 30 #include "ui/events/keycodes/keyboard_codes.h" |
| 30 #include "url/gurl.h" | 31 #include "url/gurl.h" |
| 31 | 32 |
| 32 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 33 #include "base/win/scoped_handle.h" | 34 #include "base/win/scoped_handle.h" |
| 34 #endif | 35 #endif |
| 35 | 36 |
| 36 namespace gfx { | 37 namespace gfx { |
| 37 class Point; | 38 class Point; |
| 38 } | 39 } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // for an interstitial detach after closing a tab). | 273 // for an interstitial detach after closing a tab). |
| 273 void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents, | 274 void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents, |
| 274 const base::Closure& task); | 275 const base::Closure& task); |
| 275 | 276 |
| 276 // Waits until all resources have loaded in the given RenderFrameHost. | 277 // Waits until all resources have loaded in the given RenderFrameHost. |
| 277 // When the load completes, this function sends a "pageLoadComplete" message | 278 // When the load completes, this function sends a "pageLoadComplete" message |
| 278 // via domAutomationController. The caller should make sure this extra | 279 // via domAutomationController. The caller should make sure this extra |
| 279 // message is handled properly. | 280 // message is handled properly. |
| 280 bool WaitForRenderFrameReady(RenderFrameHost* rfh) WARN_UNUSED_RESULT; | 281 bool WaitForRenderFrameReady(RenderFrameHost* rfh) WARN_UNUSED_RESULT; |
| 281 | 282 |
| 283 // Enable accessibility support for all of the frames in this WebContents |
| 284 void EnableAccessibilityForWebContents(WebContents* web_contents); |
| 285 |
| 286 // Wait until the focused accessible node changes in any WebContents. |
| 287 void WaitForAccessibilityFocusChange(); |
| 288 |
| 289 // Retrieve information about the node that's focused in the accessibility tree. |
| 290 ui::AXNodeData GetFocusedAccessibilityNodeInfo(WebContents* web_contents); |
| 291 |
| 282 // Watches title changes on a WebContents, blocking until an expected title is | 292 // Watches title changes on a WebContents, blocking until an expected title is |
| 283 // set. | 293 // set. |
| 284 class TitleWatcher : public WebContentsObserver { | 294 class TitleWatcher : public WebContentsObserver { |
| 285 public: | 295 public: |
| 286 // |web_contents| must be non-NULL and needs to stay alive for the | 296 // |web_contents| must be non-NULL and needs to stay alive for the |
| 287 // entire lifetime of |this|. |expected_title| is the title that |this| | 297 // entire lifetime of |this|. |expected_title| is the title that |this| |
| 288 // will wait for. | 298 // will wait for. |
| 289 TitleWatcher(WebContents* web_contents, | 299 TitleWatcher(WebContents* web_contents, |
| 290 const base::string16& expected_title); | 300 const base::string16& expected_title); |
| 291 ~TitleWatcher() override; | 301 ~TitleWatcher() override; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 blink::WebInputEvent::Type wait_for_type_; | 501 blink::WebInputEvent::Type wait_for_type_; |
| 492 uint32_t ack_result_; | 502 uint32_t ack_result_; |
| 493 base::Closure quit_; | 503 base::Closure quit_; |
| 494 | 504 |
| 495 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); | 505 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); |
| 496 }; | 506 }; |
| 497 | 507 |
| 498 } // namespace content | 508 } // namespace content |
| 499 | 509 |
| 500 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 510 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |