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 |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 // Waits until the Find window has become fully visible (if |wait_for_open| is | 464 // Waits until the Find window has become fully visible (if |wait_for_open| is |
465 // true) or fully hidden (if |wait_for_open| is false). This function can time | 465 // true) or fully hidden (if |wait_for_open| is false). This function can time |
466 // out (return false) if the window doesn't appear within a specific time. | 466 // out (return false) if the window doesn't appear within a specific time. |
467 bool WaitForFindWindowVisibilityChange(BrowserProxy* browser, | 467 bool WaitForFindWindowVisibilityChange(BrowserProxy* browser, |
468 bool wait_for_open); | 468 bool wait_for_open); |
469 | 469 |
470 // Terminates the browser, simulates end of session. | 470 // Terminates the browser, simulates end of session. |
471 void TerminateBrowser(); | 471 void TerminateBrowser(); |
472 | 472 |
| 473 // Verify that the browser exited cleanly. |
| 474 void VerifyCleanExit(); |
| 475 |
473 // Tells the browser to navigate to the given URL in the active tab | 476 // Tells the browser to navigate to the given URL in the active tab |
474 // of the first app window. | 477 // of the first app window. |
475 // Does not wait for the navigation to complete to return. | 478 // Does not wait for the navigation to complete to return. |
476 // To avoid intermittent test failures, use NavigateToURL instead, if | 479 // To avoid intermittent test failures, use NavigateToURL instead, if |
477 // possible. | 480 // possible. |
478 void NavigateToURLAsync(const GURL& url); | 481 void NavigateToURLAsync(const GURL& url); |
479 | 482 |
480 private: | 483 private: |
481 // Waits for download shelf visibility or invisibility. | 484 // Waits for download shelf visibility or invisibility. |
482 bool WaitForDownloadShelfVisibilityChange(BrowserProxy* browser, | 485 bool WaitForDownloadShelfVisibilityChange(BrowserProxy* browser, |
483 bool wait_for_open); | 486 bool wait_for_open); |
484 | 487 |
485 MessageLoop message_loop_; // Enables PostTask to main thread. | 488 MessageLoop message_loop_; // Enables PostTask to main thread. |
486 }; | 489 }; |
487 | 490 |
488 // These exist only to support the gTest assertion macros, and | 491 // These exist only to support the gTest assertion macros, and |
489 // shouldn't be used in normal program code. | 492 // shouldn't be used in normal program code. |
490 #ifdef UNIT_TEST | 493 #ifdef UNIT_TEST |
491 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); | 494 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); |
492 | 495 |
493 template<typename T> | 496 template<typename T> |
494 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { | 497 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { |
495 return out << ptr.get(); | 498 return out << ptr.get(); |
496 } | 499 } |
497 #endif // UNIT_TEST | 500 #endif // UNIT_TEST |
498 | 501 |
499 #endif // CHROME_TEST_UI_UI_TEST_H_ | 502 #endif // CHROME_TEST_UI_UI_TEST_H_ |
OLD | NEW |