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 // This file provides reliablity test which runs under UI test framework. The | 5 // This file provides reliablity test which runs under UI test framework. The |
6 // test is intended to run within QEMU environment. | 6 // test is intended to run within QEMU environment. |
7 // | 7 // |
8 // Usage 1: reliability_test | 8 // Usage 1: reliability_test |
9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly | 9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly |
10 // used by buildbot, to verify reliability_test itself runs ok. | 10 // used by buildbot, to verify reliability_test itself runs ok. |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 // If calling into this function, we are running as a standalone program. | 621 // If calling into this function, we are running as a standalone program. |
622 g_stand_alone = true; | 622 g_stand_alone = true; |
623 | 623 |
624 // Since we use --enable-dcheck for reliability tests, suppress the error | 624 // Since we use --enable-dcheck for reliability tests, suppress the error |
625 // dialog in the test process. | 625 // dialog in the test process. |
626 logging::SetLogReportHandler(ReportHandler); | 626 logging::SetLogReportHandler(ReportHandler); |
627 | 627 |
628 if (parsed_command_line.HasSwitch(kStartPageSwitch)) { | 628 if (parsed_command_line.HasSwitch(kStartPageSwitch)) { |
629 ASSERT_TRUE(parsed_command_line.HasSwitch(kEndPageSwitch)); | 629 ASSERT_TRUE(parsed_command_line.HasSwitch(kEndPageSwitch)); |
630 ASSERT_TRUE( | 630 ASSERT_TRUE( |
631 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 631 base::StringToInt(parsed_command_line.GetSwitchValueASCII( |
632 kStartPageSwitch)), &g_start_page)); | 632 kStartPageSwitch), |
| 633 &g_start_page)); |
633 ASSERT_TRUE( | 634 ASSERT_TRUE( |
634 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 635 base::StringToInt(parsed_command_line.GetSwitchValueASCII( |
635 kEndPageSwitch)), &g_end_page)); | 636 kEndPageSwitch), |
| 637 &g_end_page)); |
636 ASSERT_TRUE(g_start_page > 0 && g_end_page > 0); | 638 ASSERT_TRUE(g_start_page > 0 && g_end_page > 0); |
637 ASSERT_TRUE(g_start_page < g_end_page); | 639 ASSERT_TRUE(g_start_page < g_end_page); |
638 g_append_page_id = true; | 640 g_append_page_id = true; |
639 } else { | 641 } else { |
640 ASSERT_FALSE(parsed_command_line.HasSwitch(kEndPageSwitch)); | 642 ASSERT_FALSE(parsed_command_line.HasSwitch(kEndPageSwitch)); |
641 } | 643 } |
642 | 644 |
643 if (parsed_command_line.HasSwitch(kSiteSwitch)) { | 645 if (parsed_command_line.HasSwitch(kSiteSwitch)) { |
644 g_server_url = WideToUTF8(parsed_command_line.GetSwitchValue(kSiteSwitch)); | 646 g_server_url = parsed_command_line.GetSwitchValueASCII(kSiteSwitch); |
645 } | 647 } |
646 | 648 |
647 if (parsed_command_line.HasSwitch(kStartIndexSwitch)) { | 649 if (parsed_command_line.HasSwitch(kStartIndexSwitch)) { |
648 ASSERT_TRUE( | 650 ASSERT_TRUE( |
649 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 651 base::StringToInt(parsed_command_line.GetSwitchValueASCII( |
650 kStartIndexSwitch)), &g_start_index)); | 652 kStartIndexSwitch), |
| 653 &g_start_index)); |
651 ASSERT_GT(g_start_index, 0); | 654 ASSERT_GT(g_start_index, 0); |
652 } | 655 } |
653 | 656 |
654 if (parsed_command_line.HasSwitch(kEndIndexSwitch)) { | 657 if (parsed_command_line.HasSwitch(kEndIndexSwitch)) { |
655 ASSERT_TRUE( | 658 ASSERT_TRUE( |
656 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 659 base::StringToInt(parsed_command_line.GetSwitchValueASCII( |
657 kEndIndexSwitch)), &g_end_index)); | 660 kEndIndexSwitch), |
| 661 &g_end_index)); |
658 ASSERT_GT(g_end_index, 0); | 662 ASSERT_GT(g_end_index, 0); |
659 } | 663 } |
660 | 664 |
661 ASSERT_TRUE(g_end_index >= g_start_index); | 665 ASSERT_TRUE(g_end_index >= g_start_index); |
662 | 666 |
663 if (parsed_command_line.HasSwitch(kListSwitch)) | 667 if (parsed_command_line.HasSwitch(kListSwitch)) |
664 g_url_file_path = parsed_command_line.GetSwitchValuePath(kListSwitch); | 668 g_url_file_path = parsed_command_line.GetSwitchValuePath(kListSwitch); |
665 | 669 |
666 if (parsed_command_line.HasSwitch(kIterationSwitch)) { | 670 if (parsed_command_line.HasSwitch(kIterationSwitch)) { |
667 ASSERT_TRUE( | 671 ASSERT_TRUE( |
668 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 672 base::StringToInt(parsed_command_line.GetSwitchValueASCII( |
669 kIterationSwitch)), &g_iterations)); | 673 kIterationSwitch), |
| 674 &g_iterations)); |
670 ASSERT_GT(g_iterations, 0); | 675 ASSERT_GT(g_iterations, 0); |
671 } | 676 } |
672 | 677 |
673 if (parsed_command_line.HasSwitch(kMemoryUsageSwitch)) | 678 if (parsed_command_line.HasSwitch(kMemoryUsageSwitch)) |
674 g_memory_usage = true; | 679 g_memory_usage = true; |
675 | 680 |
676 if (parsed_command_line.HasSwitch(kContinuousLoadSwitch)) | 681 if (parsed_command_line.HasSwitch(kContinuousLoadSwitch)) |
677 g_continuous_load = true; | 682 g_continuous_load = true; |
678 | 683 |
679 if (parsed_command_line.HasSwitch(kEndURLSwitch)) { | 684 if (parsed_command_line.HasSwitch(kEndURLSwitch)) |
680 g_end_url = WideToUTF8( | 685 g_end_url = parsed_command_line.GetSwitchValueASCII(kEndURLSwitch); |
681 parsed_command_line.GetSwitchValue(kEndURLSwitch)); | |
682 } | |
683 | 686 |
684 if (parsed_command_line.HasSwitch(kLogFileSwitch)) | 687 if (parsed_command_line.HasSwitch(kLogFileSwitch)) |
685 g_log_file_path = parsed_command_line.GetSwitchValuePath(kLogFileSwitch); | 688 g_log_file_path = parsed_command_line.GetSwitchValuePath(kLogFileSwitch); |
686 | 689 |
687 if (parsed_command_line.HasSwitch(kTimeoutSwitch)) { | 690 if (parsed_command_line.HasSwitch(kTimeoutSwitch)) { |
688 ASSERT_TRUE( | 691 ASSERT_TRUE( |
689 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 692 base::StringToInt(parsed_command_line.GetSwitchValueASCII( |
690 kTimeoutSwitch)), &g_timeout_ms)); | 693 kTimeoutSwitch), |
| 694 &g_timeout_ms)); |
691 ASSERT_GT(g_timeout_ms, 0); | 695 ASSERT_GT(g_timeout_ms, 0); |
692 } | 696 } |
693 | 697 |
694 if (parsed_command_line.HasSwitch(kNoPageDownSwitch)) | 698 if (parsed_command_line.HasSwitch(kNoPageDownSwitch)) |
695 g_page_down = false; | 699 g_page_down = false; |
696 | 700 |
697 if (parsed_command_line.HasSwitch(kNoClearProfileSwitch)) | 701 if (parsed_command_line.HasSwitch(kNoClearProfileSwitch)) |
698 g_clear_profile = false; | 702 g_clear_profile = false; |
699 | 703 |
700 if (parsed_command_line.HasSwitch(kSaveDebugLogSwitch)) { | 704 if (parsed_command_line.HasSwitch(kSaveDebugLogSwitch)) { |
701 g_save_debug_log = true; | 705 g_save_debug_log = true; |
702 g_chrome_log_path = logging::GetLogFileName(); | 706 g_chrome_log_path = logging::GetLogFileName(); |
703 // We won't get v8 log unless --no-sandbox is specified. | 707 // We won't get v8 log unless --no-sandbox is specified. |
704 if (parsed_command_line.HasSwitch(switches::kNoSandbox)) { | 708 if (parsed_command_line.HasSwitch(switches::kNoSandbox)) { |
705 PathService::Get(base::DIR_CURRENT, &g_v8_log_path); | 709 PathService::Get(base::DIR_CURRENT, &g_v8_log_path); |
706 g_v8_log_path = g_v8_log_path.AppendASCII(kV8LogFileDefaultName); | 710 g_v8_log_path = g_v8_log_path.AppendASCII(kV8LogFileDefaultName); |
707 // The command line switch may override the default v8 log path. | 711 // The command line switch may override the default v8 log path. |
708 if (parsed_command_line.HasSwitch(switches::kJavaScriptFlags)) { | 712 if (parsed_command_line.HasSwitch(switches::kJavaScriptFlags)) { |
709 CommandLine v8_command_line( | 713 CommandLine v8_command_line( |
710 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); | 714 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); |
711 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 715 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
712 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); | 716 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); |
713 if (!file_util::AbsolutePath(&g_v8_log_path)) | 717 if (!file_util::AbsolutePath(&g_v8_log_path)) |
714 g_v8_log_path = FilePath(); | 718 g_v8_log_path = FilePath(); |
715 } | 719 } |
716 } | 720 } |
717 } | 721 } |
718 } | 722 } |
719 } | 723 } |
OLD | NEW |