OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
11 // functional testing. | 11 // functional testing. |
12 // | 12 // |
13 // Tests should #include this file, subclass UITest, and use the TEST_F macro | 13 // Tests should #include this file, subclass UITest, and use the TEST_F macro |
14 // to declare individual test cases. This provides a running browser window | 14 // to declare individual test cases. This provides a running browser window |
15 // during the test, accessible through the window_ member variable. The window | 15 // during the test, accessible through the window_ member variable. The window |
16 // will close when the test ends, regardless of whether the test passed. | 16 // will close when the test ends, regardless of whether the test passed. |
17 // | 17 // |
18 // Tests which need to launch the browser with a particular set of command-line | 18 // Tests which need to launch the browser with a particular set of command-line |
19 // arguments should set the value of launch_arguments_ in their constructors. | 19 // arguments should set the value of launch_arguments_ in their constructors. |
20 | 20 |
21 #include <string> | 21 #include <string> |
22 | 22 |
23 #include "base/command_line.h" | 23 #include "base/command_line.h" |
24 #include "base/memory/scoped_ptr.h" | 24 #include "base/memory/scoped_ptr.h" |
25 #include "base/message_loop.h" | 25 #include "base/message_loop.h" |
26 #include "base/process.h" | 26 #include "base/process.h" |
27 #include "base/test/test_timeouts.h" | |
28 #include "base/time.h" | 27 #include "base/time.h" |
29 #include "build/build_config.h" | 28 #include "build/build_config.h" |
30 // TODO(evanm): we should be able to just forward-declare | 29 // TODO(evanm): we should be able to just forward-declare |
31 // AutomationProxy here, but many files that #include this one don't | 30 // AutomationProxy here, but many files that #include this one don't |
32 // themselves #include automation_proxy.h. | 31 // themselves #include automation_proxy.h. |
33 #include "chrome/test/automation/automation_proxy.h" | 32 #include "chrome/test/automation/automation_proxy.h" |
34 #include "chrome/test/automation/proxy_launcher.h" | 33 #include "chrome/test/automation/proxy_launcher.h" |
35 #include "testing/platform_test.h" | 34 #include "testing/platform_test.h" |
36 | 35 |
37 class AutomationProxy; | 36 class AutomationProxy; |
(...skipping 17 matching lines...) Expand all Loading... | |
55 void LaunchBrowser(); | 54 void LaunchBrowser(); |
56 | 55 |
57 // Launches the browser and IPC testing connection in server mode. | 56 // Launches the browser and IPC testing connection in server mode. |
58 void LaunchBrowserAndServer(); | 57 void LaunchBrowserAndServer(); |
59 | 58 |
60 // Launches the IPC testing connection in client mode, | 59 // Launches the IPC testing connection in client mode, |
61 // which then attempts to connect to a browser. | 60 // which then attempts to connect to a browser. |
62 void ConnectToRunningBrowser(); | 61 void ConnectToRunningBrowser(); |
63 | 62 |
64 // Only for pyauto. | 63 // Only for pyauto. |
65 void set_command_execution_timeout_ms(int timeout); | 64 int action_timeout_ms(); |
65 void set_action_timeout_ms(int timeout); | |
Paweł Hajdan Jr.
2011/03/31 20:11:09
This should be removed too.
| |
66 | 66 |
67 // Overridable so that derived classes can provide their own ProxyLauncher. | 67 // Overridable so that derived classes can provide their own ProxyLauncher. |
68 virtual ProxyLauncher* CreateProxyLauncher(); | 68 virtual ProxyLauncher* CreateProxyLauncher(); |
69 | 69 |
70 // Closes the browser and IPC testing server. | 70 // Closes the browser and IPC testing server. |
71 void CloseBrowserAndServer(); | 71 void CloseBrowserAndServer(); |
72 | 72 |
73 // Launches the browser with the given command line. | 73 // Launches the browser with the given command line. |
74 // TODO(phajdan.jr): Make LaunchBrowser private. Tests should use | 74 // TODO(phajdan.jr): Make LaunchBrowser private. Tests should use |
75 // LaunchAnotherBrowserBlockUntilClosed. | 75 // LaunchAnotherBrowserBlockUntilClosed. |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
495 #ifdef UNIT_TEST | 495 #ifdef UNIT_TEST |
496 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); | 496 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); |
497 | 497 |
498 template<typename T> | 498 template<typename T> |
499 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { | 499 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { |
500 return out << ptr.get(); | 500 return out << ptr.get(); |
501 } | 501 } |
502 #endif // UNIT_TEST | 502 #endif // UNIT_TEST |
503 | 503 |
504 #endif // CHROME_TEST_UI_UI_TEST_H_ | 504 #endif // CHROME_TEST_UI_UI_TEST_H_ |
OLD | NEW |