Chromium Code Reviews| 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> |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 // is equal to the given name. If not, sets up a notification waiter | 303 // is equal to the given name. If not, sets up a notification waiter |
| 304 // that listens for any accessibility event in any frame, and checks again | 304 // that listens for any accessibility event in any frame, and checks again |
| 305 // after each event. Keeps looping until the text is found (or the | 305 // after each event. Keeps looping until the text is found (or the |
| 306 // test times out). | 306 // test times out). |
| 307 void WaitForAccessibilityTreeToContainNodeWithName(WebContents* web_contents, | 307 void WaitForAccessibilityTreeToContainNodeWithName(WebContents* web_contents, |
| 308 const std::string& name); | 308 const std::string& name); |
| 309 | 309 |
| 310 // Get a snapshot of a web page's accessibility tree. | 310 // Get a snapshot of a web page's accessibility tree. |
| 311 ui::AXTreeUpdate GetAccessibilityTreeSnapshot(WebContents* web_contents); | 311 ui::AXTreeUpdate GetAccessibilityTreeSnapshot(WebContents* web_contents); |
| 312 | 312 |
| 313 // Find out if the BrowserPlugin for a guest WebContents is focused. Returns | |
| 314 // false if the WebContents isn't a guest with a BrowserPlugin. | |
| 315 bool IsWebContentsBrowserPluginFocused(content::WebContents* web_contents); | |
| 316 | |
| 317 #if defined(USE_AURA) | |
| 318 // The following two methods allow a test to send a touch tap sequence, and | |
| 319 // a corresponding gesture tap sequence, by sending it to the top-level | |
| 320 // WebContents for the page. | |
| 321 | |
| 322 // Send a TouchStart/End sequence routed via the main frame's | |
| 323 // RenderWidgetHostViewAura. | |
| 324 void SendRoutedTouchTapSequence(content::WebContents* web_contents, | |
| 325 gfx::Point point); | |
| 326 | |
| 327 // Send a GestureTapDown/GestureTap sequence routed via the main frame's | |
| 328 // RenderWidgetHostViewAura. | |
| 329 void SendRoutedGestureTapSequence(content::WebContents* web_contents, | |
| 330 gfx::Point point); | |
| 331 // | |
|
Charlie Reis
2016/07/07 17:22:09
nit: This should just be a blank line, no comment.
| |
| 332 // Waits until the cc::Surface associated with a guest/cross-process-iframe | |
| 333 // has been drawn for the first time. Once this method returns it should be | |
| 334 // safe to assume that events sent to the top-level RenderWidgetHostView can | |
| 335 // be expected to properly hit-test to this surface, if appropriate. | |
| 336 void WaitForGuestSurfaceReady(content::WebContents* web_contents); | |
| 337 | |
| 338 #endif | |
| 339 | |
| 313 // Watches title changes on a WebContents, blocking until an expected title is | 340 // Watches title changes on a WebContents, blocking until an expected title is |
| 314 // set. | 341 // set. |
| 315 class TitleWatcher : public WebContentsObserver { | 342 class TitleWatcher : public WebContentsObserver { |
| 316 public: | 343 public: |
| 317 // |web_contents| must be non-NULL and needs to stay alive for the | 344 // |web_contents| must be non-NULL and needs to stay alive for the |
| 318 // entire lifetime of |this|. |expected_title| is the title that |this| | 345 // entire lifetime of |this|. |expected_title| is the title that |this| |
| 319 // will wait for. | 346 // will wait for. |
| 320 TitleWatcher(WebContents* web_contents, | 347 TitleWatcher(WebContents* web_contents, |
| 321 const base::string16& expected_title); | 348 const base::string16& expected_title); |
| 322 ~TitleWatcher() override; | 349 ~TitleWatcher() override; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 522 blink::WebInputEvent::Type wait_for_type_; | 549 blink::WebInputEvent::Type wait_for_type_; |
| 523 uint32_t ack_result_; | 550 uint32_t ack_result_; |
| 524 base::Closure quit_; | 551 base::Closure quit_; |
| 525 | 552 |
| 526 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); | 553 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); |
| 527 }; | 554 }; |
| 528 | 555 |
| 529 } // namespace content | 556 } // namespace content |
| 530 | 557 |
| 531 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 558 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |