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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 std::string GetChromeRevision() { | 108 std::string GetChromeRevision() { |
109 // Get Chrome version | 109 // Get Chrome version |
110 std::string last_change; | 110 std::string last_change; |
111 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
112 // Check file version info for chrome dll. | 112 // Check file version info for chrome dll. |
113 scoped_ptr<FileVersionInfo> file_info; | 113 scoped_ptr<FileVersionInfo> file_info; |
114 file_info.reset( | 114 file_info.reset( |
115 FileVersionInfo::CreateFileVersionInfo(base::FilePath(kChromeDll))); | 115 FileVersionInfo::CreateFileVersionInfo(base::FilePath(kChromeDll))); |
116 last_change = WideToASCII(file_info->last_change()); | 116 last_change = base::WideToASCII(file_info->last_change()); |
117 #elif defined(OS_POSIX) | 117 #elif defined(OS_POSIX) |
118 chrome::VersionInfo version_info; | 118 chrome::VersionInfo version_info; |
119 last_change = version_info.LastChange(); | 119 last_change = version_info.LastChange(); |
120 #endif // !defined(OS_WIN) | 120 #endif // !defined(OS_WIN) |
121 return last_change; | 121 return last_change; |
122 } | 122 } |
123 | 123 |
124 void InitTestLog(base::Time start_time) { | 124 void InitTestLog(base::Time start_time) { |
125 base::FilePath path = GetTestLogFilePath(); | 125 base::FilePath path = GetTestLogFilePath(); |
126 std::ofstream test_log_file; | 126 std::ofstream test_log_file; |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 } | 710 } |
711 | 711 |
712 void AutomatedUITest::LogCrashResult(const base::FilePath& crash_dump, | 712 void AutomatedUITest::LogCrashResult(const base::FilePath& crash_dump, |
713 bool command_completed) { | 713 bool command_completed) { |
714 xml_writer_.StartElement("result"); | 714 xml_writer_.StartElement("result"); |
715 xml_writer_.AddAttribute("test_log_path", | 715 xml_writer_.AddAttribute("test_log_path", |
716 GetTestLogFilePath().MaybeAsASCII()); | 716 GetTestLogFilePath().MaybeAsASCII()); |
717 xml_writer_.AddAttribute("revision", GetChromeRevision()); | 717 xml_writer_.AddAttribute("revision", GetChromeRevision()); |
718 xml_writer_.StartElement("crash"); | 718 xml_writer_.StartElement("crash"); |
719 #if defined(OS_WIN) | 719 #if defined(OS_WIN) |
720 xml_writer_.AddAttribute("crash_dump", WideToASCII(crash_dump.value())); | 720 xml_writer_.AddAttribute("crash_dump", base::WideToASCII(crash_dump.value())); |
721 #else | 721 #else |
722 xml_writer_.AddAttribute("crash_dump", crash_dump.value()); | 722 xml_writer_.AddAttribute("crash_dump", crash_dump.value()); |
723 #endif | 723 #endif |
724 if (command_completed) | 724 if (command_completed) |
725 xml_writer_.AddAttribute("command_completed", "yes"); | 725 xml_writer_.AddAttribute("command_completed", "yes"); |
726 else | 726 else |
727 xml_writer_.AddAttribute("command_completed", "no"); | 727 xml_writer_.AddAttribute("command_completed", "no"); |
728 xml_writer_.EndElement(); | 728 xml_writer_.EndElement(); |
729 xml_writer_.EndElement(); | 729 xml_writer_.EndElement(); |
730 } | 730 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 } | 809 } |
810 } | 810 } |
811 | 811 |
812 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 812 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
813 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 813 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
814 if (parsed_command_line.HasSwitch(kReproSwitch)) | 814 if (parsed_command_line.HasSwitch(kReproSwitch)) |
815 RunReproduction(); | 815 RunReproduction(); |
816 else | 816 else |
817 RunAutomatedUITest(); | 817 RunAutomatedUITest(); |
818 } | 818 } |
OLD | NEW |