Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: chrome_frame/test/reliability/page_load_test.cc

Issue 3057033: Remove GetSwitchValue() from chrome/* where easy. (Closed)
Patch Set: finally Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 tests which run for ChromeFrame. 5 // This file provides reliablity tests which run for ChromeFrame.
6 // 6 //
7 // Usage: 7 // Usage:
8 // <reliability test exe> --list=file --startline=start --endline=end [...] 8 // <reliability test exe> --list=file --startline=start --endline=end [...]
9 // Upon invocation, it visits each of the URLs on line numbers between start 9 // Upon invocation, it visits each of the URLs on line numbers between start
10 // and end, inclusive, stored in the input file. The line number starts from 1. 10 // and end, inclusive, stored in the input file. The line number starts from 1.
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 void SetPageRange(const CommandLine& parsed_command_line) { 554 void SetPageRange(const CommandLine& parsed_command_line) {
555 // If calling into this function, we are running as a standalone program. 555 // If calling into this function, we are running as a standalone program.
556 g_stand_alone = true; 556 g_stand_alone = true;
557 557
558 // Since we use --enable-dcheck for reliability tests, suppress the error 558 // Since we use --enable-dcheck for reliability tests, suppress the error
559 // dialog in the test process. 559 // dialog in the test process.
560 logging::SetLogReportHandler(ReportHandler); 560 logging::SetLogReportHandler(ReportHandler);
561 561
562 if (parsed_command_line.HasSwitch(kStartIndexSwitch)) { 562 if (parsed_command_line.HasSwitch(kStartIndexSwitch)) {
563 ASSERT_TRUE( 563 ASSERT_TRUE(
564 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( 564 base::StringToInt(parsed_command_line.GetSwitchValue(
565 kStartIndexSwitch)), &g_start_index)); 565 kStartIndexSwitch),
tony 2010/08/06 00:09:38 Nit: Can this line (and the ones below it) be merg
566 &g_start_index));
566 ASSERT_GT(g_start_index, 0); 567 ASSERT_GT(g_start_index, 0);
567 } 568 }
568 569
569 if (parsed_command_line.HasSwitch(kEndIndexSwitch)) { 570 if (parsed_command_line.HasSwitch(kEndIndexSwitch)) {
570 ASSERT_TRUE( 571 ASSERT_TRUE(
571 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( 572 base::StringToInt(parsed_command_line.GetSwitchValue(
572 kEndIndexSwitch)), &g_end_index)); 573 kEndIndexSwitch),
574 &g_end_index));
573 ASSERT_GT(g_end_index, 0); 575 ASSERT_GT(g_end_index, 0);
574 } 576 }
575 577
576 ASSERT_TRUE(g_end_index >= g_start_index); 578 ASSERT_TRUE(g_end_index >= g_start_index);
577 579
578 if (parsed_command_line.HasSwitch(kListSwitch)) 580 if (parsed_command_line.HasSwitch(kListSwitch))
579 g_url_file_path = parsed_command_line.GetSwitchValuePath(kListSwitch); 581 g_url_file_path = parsed_command_line.GetSwitchValuePath(kListSwitch);
580 582
581 if (parsed_command_line.HasSwitch(kIterationSwitch)) { 583 if (parsed_command_line.HasSwitch(kIterationSwitch)) {
582 ASSERT_TRUE( 584 ASSERT_TRUE(
583 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( 585 base::StringToInt(parsed_command_line.GetSwitchValue(
584 kIterationSwitch)), &g_iterations)); 586 kIterationSwitch),
587 &g_iterations));
585 ASSERT_GT(g_iterations, 0); 588 ASSERT_GT(g_iterations, 0);
586 } 589 }
587 590
588 if (parsed_command_line.HasSwitch(kMemoryUsageSwitch)) 591 if (parsed_command_line.HasSwitch(kMemoryUsageSwitch))
589 g_memory_usage = true; 592 g_memory_usage = true;
590 593
591 if (parsed_command_line.HasSwitch(kContinuousLoadSwitch)) 594 if (parsed_command_line.HasSwitch(kContinuousLoadSwitch))
592 g_continuous_load = true; 595 g_continuous_load = true;
593 596
594 if (parsed_command_line.HasSwitch(kLogFileSwitch)) 597 if (parsed_command_line.HasSwitch(kLogFileSwitch))
595 g_log_file_path = parsed_command_line.GetSwitchValuePath(kLogFileSwitch); 598 g_log_file_path = parsed_command_line.GetSwitchValuePath(kLogFileSwitch);
596 599
597 if (parsed_command_line.HasSwitch(kTimeoutSwitch)) { 600 if (parsed_command_line.HasSwitch(kTimeoutSwitch)) {
598 ASSERT_TRUE( 601 ASSERT_TRUE(
599 base::StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue( 602 base::StringToInt(parsed_command_line.GetSwitchValue(
600 kTimeoutSwitch)), &g_timeout_ms)); 603 kTimeoutSwitch),
604 &g_timeout_ms));
601 ASSERT_GT(g_timeout_ms, 0); 605 ASSERT_GT(g_timeout_ms, 0);
602 } 606 }
603 607
604 if (parsed_command_line.HasSwitch(kNoPageDownSwitch)) 608 if (parsed_command_line.HasSwitch(kNoPageDownSwitch))
605 g_page_down = false; 609 g_page_down = false;
606 610
607 if (parsed_command_line.HasSwitch(kNoClearProfileSwitch)) 611 if (parsed_command_line.HasSwitch(kNoClearProfileSwitch))
608 g_clear_profile = false; 612 g_clear_profile = false;
609 613
610 if (parsed_command_line.HasSwitch(kSaveDebugLogSwitch)) { 614 if (parsed_command_line.HasSwitch(kSaveDebugLogSwitch)) {
611 g_save_debug_log = true; 615 g_save_debug_log = true;
612 g_chrome_log_path = logging::GetLogFileName(); 616 g_chrome_log_path = logging::GetLogFileName();
613 // We won't get v8 log unless --no-sandbox is specified. 617 // We won't get v8 log unless --no-sandbox is specified.
614 if (parsed_command_line.HasSwitch(switches::kNoSandbox)) { 618 if (parsed_command_line.HasSwitch(switches::kNoSandbox)) {
615 PathService::Get(base::DIR_CURRENT, &g_v8_log_path); 619 PathService::Get(base::DIR_CURRENT, &g_v8_log_path);
616 g_v8_log_path = g_v8_log_path.AppendASCII(kV8LogFileDefaultName); 620 g_v8_log_path = g_v8_log_path.AppendASCII(kV8LogFileDefaultName);
617 // The command line switch may override the default v8 log path. 621 // The command line switch may override the default v8 log path.
618 if (parsed_command_line.HasSwitch(switches::kJavaScriptFlags)) { 622 if (parsed_command_line.HasSwitch(switches::kJavaScriptFlags)) {
619 CommandLine v8_command_line( 623 CommandLine v8_command_line(
620 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags)); 624 parsed_command_line.GetSwitchValuePath(switches::kJavaScriptFlags));
621 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { 625 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) {
622 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch); 626 g_v8_log_path = v8_command_line.GetSwitchValuePath(kV8LogFileSwitch);
623 if (!file_util::AbsolutePath(&g_v8_log_path)) 627 if (!file_util::AbsolutePath(&g_v8_log_path))
624 g_v8_log_path = FilePath(); 628 g_v8_log_path = FilePath();
625 } 629 }
626 } 630 }
627 } 631 }
628 } 632 }
629 } 633 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698