| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 // This file provides a common base for running UI unit tests, which operate | 8 // This file provides a common base for running UI unit tests, which operate |
| 9 // the entire browser application in a separate process for holistic | 9 // the entire browser application in a separate process for holistic |
| 10 // functional testing. | 10 // functional testing. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual void SetUp(); | 57 virtual void SetUp(); |
| 58 | 58 |
| 59 // Closes the browser window. | 59 // Closes the browser window. |
| 60 virtual void TearDown(); | 60 virtual void TearDown(); |
| 61 | 61 |
| 62 // Set up the test time out values. | 62 // Set up the test time out values. |
| 63 virtual void InitializeTimeouts(); | 63 virtual void InitializeTimeouts(); |
| 64 | 64 |
| 65 // ********* Utility functions ********* | 65 // ********* Utility functions ********* |
| 66 | 66 |
| 67 // Tries to delete the specified file/directory returning true on | |
| 68 // success. This differs from file_util::Delete in that it | |
| 69 // repeatedly invokes Delete until successful, or a timeout is | |
| 70 // reached. (This retrying is to work around Windows file locks | |
| 71 // and shouldn't be necessary on POSIX, but it can't hurt.) | |
| 72 // Returns true on success. | |
| 73 bool DieFileDie(const FilePath& file, bool recurse); | |
| 74 | |
| 75 // Launches the browser and IPC testing server. | 67 // Launches the browser and IPC testing server. |
| 76 void LaunchBrowserAndServer(); | 68 void LaunchBrowserAndServer(); |
| 77 | 69 |
| 78 // Overridable so that derived classes can provide their own AutomationProxy. | 70 // Overridable so that derived classes can provide their own AutomationProxy. |
| 79 virtual AutomationProxy* CreateAutomationProxy(int execution_timeout); | 71 virtual AutomationProxy* CreateAutomationProxy(int execution_timeout); |
| 80 | 72 |
| 81 // Closes the browser and IPC testing server. | 73 // Closes the browser and IPC testing server. |
| 82 void CloseBrowserAndServer(); | 74 void CloseBrowserAndServer(); |
| 83 | 75 |
| 84 // Launches the browser with the given command line. | 76 // Launches the browser with the given command line. |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 #ifdef UNIT_TEST | 509 #ifdef UNIT_TEST |
| 518 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); | 510 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); |
| 519 | 511 |
| 520 template<typename T> | 512 template<typename T> |
| 521 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { | 513 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { |
| 522 return out << ptr.get(); | 514 return out << ptr.get(); |
| 523 } | 515 } |
| 524 #endif // UNIT_TEST | 516 #endif // UNIT_TEST |
| 525 | 517 |
| 526 #endif // CHROME_TEST_UI_UI_TEST_H_ | 518 #endif // CHROME_TEST_UI_UI_TEST_H_ |
| OLD | NEW |