| 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 // If calling into this function, we are running as a standalone program. | 620 // If calling into this function, we are running as a standalone program. |
| 621 g_stand_alone = true; | 621 g_stand_alone = true; |
| 622 | 622 |
| 623 // Since we use --enable-dcheck for reliability tests, suppress the error | 623 // Since we use --enable-dcheck for reliability tests, suppress the error |
| 624 // dialog in the test process. | 624 // dialog in the test process. |
| 625 logging::SetLogReportHandler(ReportHandler); | 625 logging::SetLogReportHandler(ReportHandler); |
| 626 | 626 |
| 627 if (parsed_command_line.HasSwitch(kStartPageSwitch)) { | 627 if (parsed_command_line.HasSwitch(kStartPageSwitch)) { |
| 628 ASSERT_TRUE(parsed_command_line.HasSwitch(kEndPageSwitch)); | 628 ASSERT_TRUE(parsed_command_line.HasSwitch(kEndPageSwitch)); |
| 629 ASSERT_TRUE( | 629 ASSERT_TRUE( |
| 630 StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 630 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( |
| 631 kStartPageSwitch)), &g_start_page)); | 631 kStartPageSwitch)), &g_start_page)); |
| 632 ASSERT_TRUE( | 632 ASSERT_TRUE( |
| 633 StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 633 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( |
| 634 kEndPageSwitch)), &g_end_page)); | 634 kEndPageSwitch)), &g_end_page)); |
| 635 ASSERT_TRUE(g_start_page > 0 && g_end_page > 0); | 635 ASSERT_TRUE(g_start_page > 0 && g_end_page > 0); |
| 636 ASSERT_TRUE(g_start_page < g_end_page); | 636 ASSERT_TRUE(g_start_page < g_end_page); |
| 637 g_append_page_id = true; | 637 g_append_page_id = true; |
| 638 } else { | 638 } else { |
| 639 ASSERT_FALSE(parsed_command_line.HasSwitch(kEndPageSwitch)); | 639 ASSERT_FALSE(parsed_command_line.HasSwitch(kEndPageSwitch)); |
| 640 } | 640 } |
| 641 | 641 |
| 642 if (parsed_command_line.HasSwitch(kSiteSwitch)) { | 642 if (parsed_command_line.HasSwitch(kSiteSwitch)) { |
| 643 g_server_url = WideToUTF8(parsed_command_line.GetSwitchValue(kSiteSwitch)); | 643 g_server_url = WideToUTF8(parsed_command_line.GetSwitchValue(kSiteSwitch)); |
| 644 } | 644 } |
| 645 | 645 |
| 646 if (parsed_command_line.HasSwitch(kStartIndexSwitch)) { | 646 if (parsed_command_line.HasSwitch(kStartIndexSwitch)) { |
| 647 ASSERT_TRUE( | 647 ASSERT_TRUE( |
| 648 StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 648 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( |
| 649 kStartIndexSwitch)), &g_start_index)); | 649 kStartIndexSwitch)), &g_start_index)); |
| 650 ASSERT_GT(g_start_index, 0); | 650 ASSERT_GT(g_start_index, 0); |
| 651 } | 651 } |
| 652 | 652 |
| 653 if (parsed_command_line.HasSwitch(kEndIndexSwitch)) { | 653 if (parsed_command_line.HasSwitch(kEndIndexSwitch)) { |
| 654 ASSERT_TRUE( | 654 ASSERT_TRUE( |
| 655 StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 655 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( |
| 656 kEndIndexSwitch)), &g_end_index)); | 656 kEndIndexSwitch)), &g_end_index)); |
| 657 ASSERT_GT(g_end_index, 0); | 657 ASSERT_GT(g_end_index, 0); |
| 658 } | 658 } |
| 659 | 659 |
| 660 ASSERT_TRUE(g_end_index >= g_start_index); | 660 ASSERT_TRUE(g_end_index >= g_start_index); |
| 661 | 661 |
| 662 if (parsed_command_line.HasSwitch(kListSwitch)) | 662 if (parsed_command_line.HasSwitch(kListSwitch)) |
| 663 g_url_file_path = parsed_command_line.GetSwitchValuePath(kListSwitch); | 663 g_url_file_path = parsed_command_line.GetSwitchValuePath(kListSwitch); |
| 664 | 664 |
| 665 if (parsed_command_line.HasSwitch(kIterationSwitch)) { | 665 if (parsed_command_line.HasSwitch(kIterationSwitch)) { |
| 666 ASSERT_TRUE( | 666 ASSERT_TRUE( |
| 667 StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 667 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( |
| 668 kIterationSwitch)), &g_iterations)); | 668 kIterationSwitch)), &g_iterations)); |
| 669 ASSERT_GT(g_iterations, 0); | 669 ASSERT_GT(g_iterations, 0); |
| 670 } | 670 } |
| 671 | 671 |
| 672 if (parsed_command_line.HasSwitch(kMemoryUsageSwitch)) | 672 if (parsed_command_line.HasSwitch(kMemoryUsageSwitch)) |
| 673 g_memory_usage = true; | 673 g_memory_usage = true; |
| 674 | 674 |
| 675 if (parsed_command_line.HasSwitch(kContinuousLoadSwitch)) | 675 if (parsed_command_line.HasSwitch(kContinuousLoadSwitch)) |
| 676 g_continuous_load = true; | 676 g_continuous_load = true; |
| 677 | 677 |
| 678 if (parsed_command_line.HasSwitch(kEndURLSwitch)) { | 678 if (parsed_command_line.HasSwitch(kEndURLSwitch)) { |
| 679 g_end_url = WideToUTF8( | 679 g_end_url = WideToUTF8( |
| 680 parsed_command_line.GetSwitchValue(kEndURLSwitch)); | 680 parsed_command_line.GetSwitchValue(kEndURLSwitch)); |
| 681 } | 681 } |
| 682 | 682 |
| 683 if (parsed_command_line.HasSwitch(kLogFileSwitch)) | 683 if (parsed_command_line.HasSwitch(kLogFileSwitch)) |
| 684 g_log_file_path = parsed_command_line.GetSwitchValuePath(kLogFileSwitch); | 684 g_log_file_path = parsed_command_line.GetSwitchValuePath(kLogFileSwitch); |
| 685 | 685 |
| 686 if (parsed_command_line.HasSwitch(kTimeoutSwitch)) { | 686 if (parsed_command_line.HasSwitch(kTimeoutSwitch)) { |
| 687 ASSERT_TRUE( | 687 ASSERT_TRUE( |
| 688 StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( | 688 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( |
| 689 kTimeoutSwitch)), &g_timeout_ms)); | 689 kTimeoutSwitch)), &g_timeout_ms)); |
| 690 ASSERT_GT(g_timeout_ms, 0); | 690 ASSERT_GT(g_timeout_ms, 0); |
| 691 } | 691 } |
| 692 | 692 |
| 693 if (parsed_command_line.HasSwitch(kNoPageDownSwitch)) | 693 if (parsed_command_line.HasSwitch(kNoPageDownSwitch)) |
| 694 g_page_down = false; | 694 g_page_down = false; |
| 695 | 695 |
| 696 if (parsed_command_line.HasSwitch(kNoClearProfileSwitch)) | 696 if (parsed_command_line.HasSwitch(kNoClearProfileSwitch)) |
| 697 g_clear_profile = false; | 697 g_clear_profile = false; |
| 698 | 698 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 709 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); | 709 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); |
| 710 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 710 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
| 711 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); | 711 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); |
| 712 if (!file_util::AbsolutePath(&g_v8_log_path)) | 712 if (!file_util::AbsolutePath(&g_v8_log_path)) |
| 713 g_v8_log_path = FilePath(); | 713 g_v8_log_path = FilePath(); |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 } | 717 } |
| 718 } | 718 } |
| OLD | NEW |