| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // Waits for an interstitial page to detach from given web contents. | 236 // Waits for an interstitial page to detach from given web contents. |
| 237 void WaitForInterstitialDetach(content::WebContents* web_contents); | 237 void WaitForInterstitialDetach(content::WebContents* web_contents); |
| 238 | 238 |
| 239 // Runs task and waits for an interstitial page to detach from given web | 239 // Runs task and waits for an interstitial page to detach from given web |
| 240 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be | 240 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be |
| 241 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting | 241 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting |
| 242 // for an interstitial detach after closing a tab). | 242 // for an interstitial detach after closing a tab). |
| 243 void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents, | 243 void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents, |
| 244 const base::Closure& task); | 244 const base::Closure& task); |
| 245 | 245 |
| 246 // Waits until all resources have loaded in the given RenderFrameHost. |
| 247 // When the load completes, this function sends a "pageLoadComplete" message |
| 248 // via domAutomationController. The caller should make sure this extra |
| 249 // message is handled properly. |
| 250 bool WaitForRenderFrameReady(RenderFrameHost* rfh) WARN_UNUSED_RESULT; |
| 251 |
| 246 // Watches title changes on a WebContents, blocking until an expected title is | 252 // Watches title changes on a WebContents, blocking until an expected title is |
| 247 // set. | 253 // set. |
| 248 class TitleWatcher : public WebContentsObserver { | 254 class TitleWatcher : public WebContentsObserver { |
| 249 public: | 255 public: |
| 250 // |web_contents| must be non-NULL and needs to stay alive for the | 256 // |web_contents| must be non-NULL and needs to stay alive for the |
| 251 // entire lifetime of |this|. |expected_title| is the title that |this| | 257 // entire lifetime of |this|. |expected_title| is the title that |this| |
| 252 // will wait for. | 258 // will wait for. |
| 253 TitleWatcher(WebContents* web_contents, | 259 TitleWatcher(WebContents* web_contents, |
| 254 const base::string16& expected_title); | 260 const base::string16& expected_title); |
| 255 ~TitleWatcher() override; | 261 ~TitleWatcher() override; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 WebContents* web_contents_; | 389 WebContents* web_contents_; |
| 384 scoped_ptr<RenderViewCreatedObserver> child_observer_; | 390 scoped_ptr<RenderViewCreatedObserver> child_observer_; |
| 385 scoped_refptr<MessageLoopRunner> runner_; | 391 scoped_refptr<MessageLoopRunner> runner_; |
| 386 | 392 |
| 387 DISALLOW_COPY_AND_ASSIGN(WebContentsAddedObserver); | 393 DISALLOW_COPY_AND_ASSIGN(WebContentsAddedObserver); |
| 388 }; | 394 }; |
| 389 | 395 |
| 390 } // namespace content | 396 } // namespace content |
| 391 | 397 |
| 392 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 398 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |