| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 // Fetch the histograms data from other processes. This should be called after | 258 // Fetch the histograms data from other processes. This should be called after |
| 259 // the test code has been executed but before performing assertions. | 259 // the test code has been executed but before performing assertions. |
| 260 void FetchHistogramsFromChildProcesses(); | 260 void FetchHistogramsFromChildProcesses(); |
| 261 | 261 |
| 262 // Registers a request handler which redirects to a different host, based | 262 // Registers a request handler which redirects to a different host, based |
| 263 // on the request path. The format of the path should be | 263 // on the request path. The format of the path should be |
| 264 // "/cross-site/hostname/rest/of/path" to redirect the request to | 264 // "/cross-site/hostname/rest/of/path" to redirect the request to |
| 265 // "<scheme>://hostname:<port>/rest/of/path", where <scheme> and <port> | 265 // "<scheme>://hostname:<port>/rest/of/path", where <scheme> and <port> |
| 266 // are the values for the instance of EmbeddedTestServer. | 266 // are the values for the instance of EmbeddedTestServer. |
| 267 // |
| 268 // By default, redirection will be done using HTTP 302 response, but in some |
| 269 // cases (e.g. to preserve HTTP method and POST body across redirects as |
| 270 // prescribed by https://tools.ietf.org/html/rfc7231#section-6.4.7) a test might |
| 271 // want to use HTTP 307 response instead. This can be accomplished by replacing |
| 272 // "/cross-site/" URL substring above with "/cross-site-307/". |
| 267 void SetupCrossSiteRedirector(net::EmbeddedTestServer* embedded_test_server); | 273 void SetupCrossSiteRedirector(net::EmbeddedTestServer* embedded_test_server); |
| 268 | 274 |
| 269 // Waits for an interstitial page to attach to given web contents. | 275 // Waits for an interstitial page to attach to given web contents. |
| 270 void WaitForInterstitialAttach(content::WebContents* web_contents); | 276 void WaitForInterstitialAttach(content::WebContents* web_contents); |
| 271 | 277 |
| 272 // Waits for an interstitial page to detach from given web contents. | 278 // Waits for an interstitial page to detach from given web contents. |
| 273 void WaitForInterstitialDetach(content::WebContents* web_contents); | 279 void WaitForInterstitialDetach(content::WebContents* web_contents); |
| 274 | 280 |
| 275 // Runs task and waits for an interstitial page to detach from given web | 281 // Runs task and waits for an interstitial page to detach from given web |
| 276 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be | 282 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 blink::WebInputEvent::Type wait_for_type_; | 512 blink::WebInputEvent::Type wait_for_type_; |
| 507 uint32_t ack_result_; | 513 uint32_t ack_result_; |
| 508 base::Closure quit_; | 514 base::Closure quit_; |
| 509 | 515 |
| 510 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); | 516 DISALLOW_COPY_AND_ASSIGN(InputMsgWatcher); |
| 511 }; | 517 }; |
| 512 | 518 |
| 513 } // namespace content | 519 } // namespace content |
| 514 | 520 |
| 515 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 521 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |