OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <fstream> | 5 #include <fstream> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 if (result != AUTOMATION_MSG_NAVIGATION_SUCCESS) { | 620 if (result != AUTOMATION_MSG_NAVIGATION_SUCCESS) { |
621 AddErrorAttribute("navigation_failed"); | 621 AddErrorAttribute("navigation_failed"); |
622 return false; | 622 return false; |
623 } | 623 } |
624 return true; | 624 return true; |
625 } | 625 } |
626 | 626 |
627 bool AutomatedUITest::InitXMLReader() { | 627 bool AutomatedUITest::InitXMLReader() { |
628 base::FilePath input_path = GetInputFilePath(); | 628 base::FilePath input_path = GetInputFilePath(); |
629 | 629 |
630 if (!file_util::ReadFileToString(input_path, &xml_init_file_)) | 630 if (!base::ReadFileToString(input_path, &xml_init_file_)) |
631 return false; | 631 return false; |
632 return init_reader_.Load(xml_init_file_); | 632 return init_reader_.Load(xml_init_file_); |
633 } | 633 } |
634 | 634 |
635 bool AutomatedUITest::WriteReportToFile() { | 635 bool AutomatedUITest::WriteReportToFile() { |
636 base::FilePath path = GetOutputFilePath(); | 636 base::FilePath path = GetOutputFilePath(); |
637 std::ofstream error_file; | 637 std::ofstream error_file; |
638 if (!path.empty()) | 638 if (!path.empty()) |
639 error_file.open(path.value().c_str(), std::ios::out); | 639 error_file.open(path.value().c_str(), std::ios::out); |
640 | 640 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 } | 756 } |
757 } | 757 } |
758 | 758 |
759 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 759 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
760 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 760 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
761 if (parsed_command_line.HasSwitch(kReproSwitch)) | 761 if (parsed_command_line.HasSwitch(kReproSwitch)) |
762 RunReproduction(); | 762 RunReproduction(); |
763 else | 763 else |
764 RunAutomatedUITest(); | 764 RunAutomatedUITest(); |
765 } | 765 } |
OLD | NEW |