OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 static bool show_error_dialogs() { return show_error_dialogs_; } | 343 static bool show_error_dialogs() { return show_error_dialogs_; } |
344 static void set_show_error_dialogs(bool value) { | 344 static void set_show_error_dialogs(bool value) { |
345 show_error_dialogs_ = value; | 345 show_error_dialogs_ = value; |
346 } | 346 } |
347 | 347 |
348 static bool full_memory_dump() { return full_memory_dump_; } | 348 static bool full_memory_dump() { return full_memory_dump_; } |
349 static void set_full_memory_dump(bool value) { | 349 static void set_full_memory_dump(bool value) { |
350 full_memory_dump_ = value; | 350 full_memory_dump_ = value; |
351 } | 351 } |
352 | 352 |
353 static bool use_existing_browser() { return default_use_existing_browser_; } | |
354 static void set_use_existing_browser(bool value) { | |
355 default_use_existing_browser_ = value; | |
356 } | |
357 | |
358 static bool dump_histograms_on_exit() { return dump_histograms_on_exit_; } | 353 static bool dump_histograms_on_exit() { return dump_histograms_on_exit_; } |
359 static void set_dump_histograms_on_exit(bool value) { | 354 static void set_dump_histograms_on_exit(bool value) { |
360 dump_histograms_on_exit_ = value; | 355 dump_histograms_on_exit_ = value; |
361 } | 356 } |
362 | 357 |
363 static int test_timeout_ms() { return timeout_ms_; } | 358 static int test_timeout_ms() { return timeout_ms_; } |
364 static void set_test_timeout_ms(int value) { | 359 static void set_test_timeout_ms(int value) { |
365 timeout_ms_ = value; | 360 timeout_ms_ = value; |
366 } | 361 } |
367 | 362 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 base::ProcessId process_id_; // PID of |process_| (for debugging). | 567 base::ProcessId process_id_; // PID of |process_| (for debugging). |
573 FilePath user_data_dir_; // User data directory used for the test | 568 FilePath user_data_dir_; // User data directory used for the test |
574 static bool in_process_renderer_; // true if we're in single process mode | 569 static bool in_process_renderer_; // true if we're in single process mode |
575 bool show_window_; // Determines if the window is shown or | 570 bool show_window_; // Determines if the window is shown or |
576 // hidden. Defaults to hidden. | 571 // hidden. Defaults to hidden. |
577 bool clear_profile_; // If true the profile is cleared before | 572 bool clear_profile_; // If true the profile is cleared before |
578 // launching. Default is true. | 573 // launching. Default is true. |
579 bool include_testing_id_; // Should we supply the testing channel | 574 bool include_testing_id_; // Should we supply the testing channel |
580 // id on the command line? Default is | 575 // id on the command line? Default is |
581 // true. | 576 // true. |
582 bool use_existing_browser_; // Duplicate of the static version. | |
583 // Default value comes from static. | |
584 bool enable_file_cookies_; // Enable file cookies, default is true. | 577 bool enable_file_cookies_; // Enable file cookies, default is true. |
585 ProfileType profile_type_; // Are we using a profile with a | 578 ProfileType profile_type_; // Are we using a profile with a |
586 // complex theme? | 579 // complex theme? |
587 FilePath websocket_pid_file_; // PID file for websocket server. | 580 FilePath websocket_pid_file_; // PID file for websocket server. |
588 ShutdownType shutdown_type_; // The method for shutting down | 581 ShutdownType shutdown_type_; // The method for shutting down |
589 // the browser. Used in ShutdownTest. | 582 // the browser. Used in ShutdownTest. |
590 | 583 |
591 private: | 584 private: |
592 bool LaunchBrowserHelper(const CommandLine& arguments, | 585 bool LaunchBrowserHelper(const CommandLine& arguments, |
593 bool use_existing_browser, | |
594 bool wait, | 586 bool wait, |
595 base::ProcessHandle* process); | 587 base::ProcessHandle* process); |
596 | 588 |
597 // We want to have a current history database when we start the browser so | 589 // We want to have a current history database when we start the browser so |
598 // things like the NTP will have thumbnails. This method updates the dates | 590 // things like the NTP will have thumbnails. This method updates the dates |
599 // in the history to be more recent. | 591 // in the history to be more recent. |
600 void UpdateHistoryDates(); | 592 void UpdateHistoryDates(); |
601 | 593 |
602 base::Time test_start_time_; // Time the test was started | 594 base::Time test_start_time_; // Time the test was started |
603 // (so we can check for new crash dumps) | 595 // (so we can check for new crash dumps) |
604 static bool no_sandbox_; | 596 static bool no_sandbox_; |
605 static bool safe_plugins_; | 597 static bool safe_plugins_; |
606 static bool full_memory_dump_; // If true, write full memory dump | 598 static bool full_memory_dump_; // If true, write full memory dump |
607 // during crash. | 599 // during crash. |
608 static bool show_error_dialogs_; // If true, a user is paying attention | 600 static bool show_error_dialogs_; // If true, a user is paying attention |
609 // to the test, so show error dialogs. | 601 // to the test, so show error dialogs. |
610 static bool default_use_existing_browser_; // The test connects to an already | |
611 // running browser instance. | |
612 static bool dump_histograms_on_exit_; // Include histograms in log on exit. | 602 static bool dump_histograms_on_exit_; // Include histograms in log on exit. |
613 static bool enable_dcheck_; // Enable dchecks in release mode. | 603 static bool enable_dcheck_; // Enable dchecks in release mode. |
614 static bool silent_dump_on_dcheck_; // Dump process memory on dcheck without | 604 static bool silent_dump_on_dcheck_; // Dump process memory on dcheck without |
615 // crashing. | 605 // crashing. |
616 static bool disable_breakpad_; // Disable breakpad on the browser. | 606 static bool disable_breakpad_; // Disable breakpad on the browser. |
617 static int timeout_ms_; // Timeout in milliseconds to wait | 607 static int timeout_ms_; // Timeout in milliseconds to wait |
618 // for an test to finish. | 608 // for an test to finish. |
619 static std::wstring js_flags_; // Flags passed to the JS engine. | 609 static std::wstring js_flags_; // Flags passed to the JS engine. |
620 static std::wstring log_level_; // Logging level. | 610 static std::wstring log_level_; // Logging level. |
621 | 611 |
(...skipping 26 matching lines...) Expand all Loading... |
648 #ifdef UNIT_TEST | 638 #ifdef UNIT_TEST |
649 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); | 639 std::ostream& operator<<(std::ostream& out, const std::wstring& wstr); |
650 | 640 |
651 template<typename T> | 641 template<typename T> |
652 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { | 642 std::ostream& operator<<(std::ostream& out, const ::scoped_ptr<T>& ptr) { |
653 return out << ptr.get(); | 643 return out << ptr.get(); |
654 } | 644 } |
655 #endif // UNIT_TEST | 645 #endif // UNIT_TEST |
656 | 646 |
657 #endif // CHROME_TEST_UI_UI_TEST_H_ | 647 #endif // CHROME_TEST_UI_UI_TEST_H_ |
OLD | NEW |