Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: content/public/test/browser_test_utils.h

Issue 1411073005: Migrating tests to use EmbeddedTestServer (/content) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding missing headers. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/process/process.h" 16 #include "base/process/process.h"
17 #include "base/strings/string16.h" 17 #include "base/strings/string16.h"
18 #include "content/public/browser/browser_message_filter.h" 18 #include "content/public/browser/browser_message_filter.h"
19 #include "content/public/browser/notification_observer.h" 19 #include "content/public/browser/notification_observer.h"
20 #include "content/public/browser/notification_registrar.h" 20 #include "content/public/browser/notification_registrar.h"
21 #include "content/public/browser/render_process_host_observer.h" 21 #include "content/public/browser/render_process_host_observer.h"
22 #include "content/public/browser/web_contents_observer.h" 22 #include "content/public/browser/web_contents_observer.h"
23 #include "content/public/common/page_type.h" 23 #include "content/public/common/page_type.h"
24 #include "net/test/embedded_test_server/embedded_test_server.h"
24 #include "third_party/WebKit/public/web/WebInputEvent.h" 25 #include "third_party/WebKit/public/web/WebInputEvent.h"
25 #include "ui/events/keycodes/keyboard_codes.h" 26 #include "ui/events/keycodes/keyboard_codes.h"
26 #include "url/gurl.h" 27 #include "url/gurl.h"
27 28
28 #if defined(OS_WIN) 29 #if defined(OS_WIN)
29 #include "base/win/scoped_handle.h" 30 #include "base/win/scoped_handle.h"
30 #endif 31 #endif
31 32
32 namespace gfx { 33 namespace gfx {
33 class Point; 34 class Point;
34 } 35 }
35 36
36 namespace net { 37 namespace net {
37 namespace test_server { 38 namespace test_server {
38 class EmbeddedTestServer; 39 class EmbeddedTestServer;
39 } 40 }
41 // TODO(svaldez): Remove typedef once EmbeddedTestServer has been migrated
42 // out of net::test_server.
43 using test_server::EmbeddedTestServer;
40 } 44 }
davidben 2015/11/03 19:51:33 Now that you've included the header, there's no ne
mmenke 2015/11/03 20:03:01 I actually have the opposite opinion - we should r
41 45
42 // A collections of functions designed for use with content_browsertests and 46 // A collections of functions designed for use with content_browsertests and
43 // browser_tests. 47 // browser_tests.
44 // TO BE CLEAR: any function here must work against both binaries. If it only 48 // 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. 49 // 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 50 // If it only works with content_browsertests, it should be in
47 // content\test\content_browser_test_utils.h. 51 // content\test\content_browser_test_utils.h.
48 52
49 namespace content { 53 namespace content {
50 54
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 245
242 // Fetch the histograms data from other processes. This should be called after 246 // Fetch the histograms data from other processes. This should be called after
243 // the test code has been executed but before performing assertions. 247 // the test code has been executed but before performing assertions.
244 void FetchHistogramsFromChildProcesses(); 248 void FetchHistogramsFromChildProcesses();
245 249
246 // Registers a request handler which redirects to a different host, based 250 // Registers a request handler which redirects to a different host, based
247 // on the request path. The format of the path should be 251 // on the request path. The format of the path should be
248 // "/cross-site/hostname/rest/of/path" to redirect the request to 252 // "/cross-site/hostname/rest/of/path" to redirect the request to
249 // "<scheme>://hostname:<port>/rest/of/path", where <scheme> and <port> 253 // "<scheme>://hostname:<port>/rest/of/path", where <scheme> and <port>
250 // are the values for the instance of EmbeddedTestServer. 254 // are the values for the instance of EmbeddedTestServer.
251 void SetupCrossSiteRedirector( 255 void SetupCrossSiteRedirector(net::EmbeddedTestServer* embedded_test_server);
252 net::test_server::EmbeddedTestServer* embedded_test_server);
253 256
254 // Waits for an interstitial page to attach to given web contents. 257 // Waits for an interstitial page to attach to given web contents.
255 void WaitForInterstitialAttach(content::WebContents* web_contents); 258 void WaitForInterstitialAttach(content::WebContents* web_contents);
256 259
257 // Waits for an interstitial page to detach from given web contents. 260 // Waits for an interstitial page to detach from given web contents.
258 void WaitForInterstitialDetach(content::WebContents* web_contents); 261 void WaitForInterstitialDetach(content::WebContents* web_contents);
259 262
260 // Runs task and waits for an interstitial page to detach from given web 263 // Runs task and waits for an interstitial page to detach from given web
261 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be 264 // contents. Prefer this over WaitForInterstitialDetach if web_contents may be
262 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting 265 // destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 431
429 int frames_to_wait_; 432 int frames_to_wait_;
430 base::Closure quit_; 433 base::Closure quit_;
431 434
432 DISALLOW_COPY_AND_ASSIGN(FrameWatcher); 435 DISALLOW_COPY_AND_ASSIGN(FrameWatcher);
433 }; 436 };
434 437
435 } // namespace content 438 } // namespace content
436 439
437 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ 440 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/child/site_isolation_stats_gatherer_browsertest.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698