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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // Wait a certain amount of time for all the app processes to exit, | 420 // Wait a certain amount of time for all the app processes to exit, |
421 // forcibly killing them if they haven't exited by then. | 421 // forcibly killing them if they haven't exited by then. |
422 // It has the side-effect of killing every browser window opened in your | 422 // It has the side-effect of killing every browser window opened in your |
423 // session, even those unrelated in the test. | 423 // session, even those unrelated in the test. |
424 void CleanupAppProcesses(); | 424 void CleanupAppProcesses(); |
425 | 425 |
426 // Returns the proxy for the currently active tab, or NULL if there is no | 426 // Returns the proxy for the currently active tab, or NULL if there is no |
427 // tab or there was some kind of error. Only looks at the first window, for | 427 // tab or there was some kind of error. Only looks at the first window, for |
428 // backward compatibility. The returned pointer MUST be deleted by the | 428 // backward compatibility. The returned pointer MUST be deleted by the |
429 // caller if non-NULL. | 429 // caller if non-NULL. |
430 TabProxy* GetActiveTab() { return GetActiveTab(0); } | 430 scoped_refptr<TabProxy> GetActiveTab(); |
431 | 431 |
432 // Like above, but looks at the window at the given index. | 432 // Like above, but looks at the window at the given index. |
433 TabProxy* GetActiveTab(int window_index); | 433 scoped_refptr<TabProxy> GetActiveTab(int window_index); |
434 | 434 |
435 // ********* Member variables ********* | 435 // ********* Member variables ********* |
436 | 436 |
437 FilePath browser_directory_; // Path to the browser executable. | 437 FilePath browser_directory_; // Path to the browser executable. |
438 FilePath test_data_directory_; // Path to the unit test data. | 438 FilePath test_data_directory_; // Path to the unit test data. |
439 CommandLine launch_arguments_; // Command to launch the browser | 439 CommandLine launch_arguments_; // Command to launch the browser |
440 size_t expected_errors_; // The number of errors expected during | 440 size_t expected_errors_; // The number of errors expected during |
441 // the run (generally 0). | 441 // the run (generally 0). |
442 int expected_crashes_; // The number of crashes expected during | 442 int expected_crashes_; // The number of crashes expected during |
443 // the run (generally 0). | 443 // the run (generally 0). |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 #ifdef UNIT_TEST | 500 #ifdef UNIT_TEST |
501 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); | 501 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); |
502 | 502 |
503 template<typename T> | 503 template<typename T> |
504 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { | 504 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { |
505 return out << ptr.get(); | 505 return out << ptr.get(); |
506 } | 506 } |
507 #endif // UNIT_TEST | 507 #endif // UNIT_TEST |
508 | 508 |
509 #endif // CHROME_TEST_UI_UI_TEST_H_ | 509 #endif // CHROME_TEST_UI_UI_TEST_H_ |
OLD | NEW |