| 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 19 matching lines...) Expand all Loading... |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 namespace gfx { | 32 namespace gfx { |
| 33 class Point; | 33 class Point; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace net { | 36 namespace net { |
| 37 namespace test_server { | 37 namespace test_server { |
| 38 class EmbeddedTestServer; | 38 class EmbeddedTestServer; |
| 39 } | 39 } |
| 40 // TODO(svaldez): Remove typedef once EmbeddedTestServer has been migrated |
| 41 // out of net::test_server. |
| 42 using test_server::EmbeddedTestServer; |
| 40 } | 43 } |
| 41 | 44 |
| 42 // A collections of functions designed for use with content_browsertests and | 45 // A collections of functions designed for use with content_browsertests and |
| 43 // browser_tests. | 46 // browser_tests. |
| 44 // TO BE CLEAR: any function here must work against both binaries. If it only | 47 // TO BE CLEAR: any function here must work against both binaries. If it only |
| 45 // works with browser_tests, it should be in chrome\test\base\ui_test_utils.h. | 48 // works with browser_tests, it should be in chrome\test\base\ui_test_utils.h. |
| 46 // If it only works with content_browsertests, it should be in | 49 // If it only works with content_browsertests, it should be in |
| 47 // content\test\content_browser_test_utils.h. | 50 // content\test\content_browser_test_utils.h. |
| 48 | 51 |
| 49 namespace content { | 52 namespace content { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 244 |
| 242 // Fetch the histograms data from other processes. This should be called after | 245 // Fetch the histograms data from other processes. This should be called after |
| 243 // the test code has been executed but before performing assertions. | 246 // the test code has been executed but before performing assertions. |
| 244 void FetchHistogramsFromChildProcesses(); | 247 void FetchHistogramsFromChildProcesses(); |
| 245 | 248 |
| 246 // Registers a request handler which redirects to a different host, based | 249 // Registers a request handler which redirects to a different host, based |
| 247 // on the request path. The format of the path should be | 250 // on the request path. The format of the path should be |
| 248 // "/cross-site/hostname/rest/of/path" to redirect the request to | 251 // "/cross-site/hostname/rest/of/path" to redirect the request to |
| 249 // "<scheme>://hostname:<port>/rest/of/path", where <scheme> and <port> | 252 // "<scheme>://hostname:<port>/rest/of/path", where <scheme> and <port> |
| 250 // are the values for the instance of EmbeddedTestServer. | 253 // are the values for the instance of EmbeddedTestServer. |
| 251 void SetupCrossSiteRedirector( | 254 void SetupCrossSiteRedirector(net::EmbeddedTestServer* embedded_test_server); |
| 252 net::test_server::EmbeddedTestServer* embedded_test_server); | |
| 253 | 255 |
| 254 // Waits for an interstitial page to attach to given web contents. | 256 // Waits for an interstitial page to attach to given web contents. |
| 255 void WaitForInterstitialAttach(content::WebContents* web_contents); | 257 void WaitForInterstitialAttach(content::WebContents* web_contents); |
| 256 | 258 |
| 257 // Waits for an interstitial page to detach from given web contents. | 259 // Waits for an interstitial page to detach from given web contents. |
| 258 void WaitForInterstitialDetach(content::WebContents* web_contents); | 260 void WaitForInterstitialDetach(content::WebContents* web_contents); |
| 259 | 261 |
| 260 // Runs task and waits for an interstitial page to detach from given web | 262 // Runs task and waits for an interstitial page to detach from given web |
| 261 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be | 263 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be |
| 262 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting | 264 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 430 |
| 429 int frames_to_wait_; | 431 int frames_to_wait_; |
| 430 base::Closure quit_; | 432 base::Closure quit_; |
| 431 | 433 |
| 432 DISALLOW_COPY_AND_ASSIGN(FrameWatcher); | 434 DISALLOW_COPY_AND_ASSIGN(FrameWatcher); |
| 433 }; | 435 }; |
| 434 | 436 |
| 435 } // namespace content | 437 } // namespace content |
| 436 | 438 |
| 437 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 439 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |