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 CHROME_TEST_UI_UI_TEST_H_ | 5 #ifndef CHROME_TEST_UI_UI_TEST_H_ |
6 #define CHROME_TEST_UI_UI_TEST_H_ | 6 #define CHROME_TEST_UI_UI_TEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // This file provides a common base for running UI unit tests, which operate | 9 // This file provides a common base for running UI unit tests, which operate |
10 // the entire browser application in a separate process for holistic | 10 // the entire browser application in a separate process for holistic |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 int action_timeout_ms(); | 71 int action_timeout_ms(); |
72 void set_action_timeout_ms(int timeout); | 72 void set_action_timeout_ms(int timeout); |
73 | 73 |
74 // Overridable so that derived classes can provide their own ProxyLauncher. | 74 // Overridable so that derived classes can provide their own ProxyLauncher. |
75 virtual ProxyLauncher* CreateProxyLauncher(); | 75 virtual ProxyLauncher* CreateProxyLauncher(); |
76 | 76 |
77 // Closes the browser and IPC testing server. | 77 // Closes the browser and IPC testing server. |
78 void CloseBrowserAndServer(); | 78 void CloseBrowserAndServer(); |
79 | 79 |
80 // Launches the browser with the given command line. | 80 // Launches the browser with the given command line. |
81 // TODO(phajdan.jr): Make LaunchBrowser private. Tests should use | 81 // TODO(phajdan.jr): Make LaunchBrowser private. |
82 // LaunchAnotherBrowserBlockUntilClosed. | |
83 void LaunchBrowser(const CommandLine& cmdline, bool clear_profile); | 82 void LaunchBrowser(const CommandLine& cmdline, bool clear_profile); |
84 | 83 |
85 #if !defined(OS_MACOSX) | |
86 // These functions are deliberately not defined on the Mac because re-using an | |
87 // existing browser process when launching from the command line isn't a | |
88 // concept that we support on the Mac; AppleEvents are the Mac solution for | |
89 // the same need. Any test based on these functions doesn't apply to the Mac. | |
90 | |
91 // Launches an another browser process and waits for it to finish. Returns | |
92 // true on success. | |
93 bool LaunchAnotherBrowserBlockUntilClosed(const CommandLine& cmdline); | |
94 | |
95 // Same as LaunchAnotherBrowserBlockUntilClosed except that the URL argument | |
96 // is not used. | |
97 bool LaunchAnotherBrowserNoUrlArg(const CommandLine& cmdline); | |
98 #endif | |
99 | |
100 // Exits out browser instance. | 84 // Exits out browser instance. |
101 void QuitBrowser(); | 85 void QuitBrowser(); |
102 | 86 |
103 // Tells the browser to navigate to the given URL in the active tab | 87 // Tells the browser to navigate to the given URL in the active tab |
104 // of the first app window. | 88 // of the first app window. |
105 // This method doesn't return until the navigation is complete. | 89 // This method doesn't return until the navigation is complete. |
106 void NavigateToURL(const GURL& url); | 90 void NavigateToURL(const GURL& url); |
107 | 91 |
108 // Navigate to the given URL in the active tab of the given app window. | 92 // Navigate to the given URL in the active tab of the given app window. |
109 void NavigateToURL(const GURL& url, int window_index); | 93 void NavigateToURL(const GURL& url, int window_index); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 #ifdef UNIT_TEST | 457 #ifdef UNIT_TEST |
474 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); | 458 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); |
475 | 459 |
476 template<typename T> | 460 template<typename T> |
477 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { | 461 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { |
478 return out << ptr.get(); | 462 return out << ptr.get(); |
479 } | 463 } |
480 #endif // UNIT_TEST | 464 #endif // UNIT_TEST |
481 | 465 |
482 #endif // CHROME_TEST_UI_UI_TEST_H_ | 466 #endif // CHROME_TEST_UI_UI_TEST_H_ |
OLD | NEW |