OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/test/gtest_xml_util.h" | 5 #include "base/test/gtest_xml_util.h" |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/test/launcher/test_launcher.h" | 10 #include "base/test/launcher/test_launcher.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 if (!xml_reader.NodeAttribute("classname", &test_case_name)) | 171 if (!xml_reader.NodeAttribute("classname", &test_case_name)) |
172 return false; | 172 return false; |
173 std::string test_name; | 173 std::string test_name; |
174 if (!xml_reader.NodeAttribute("name", &test_name)) | 174 if (!xml_reader.NodeAttribute("name", &test_name)) |
175 return false; | 175 return false; |
176 result.full_name = test_case_name + "." + test_name; | 176 result.full_name = test_case_name + "." + test_name; |
177 | 177 |
178 std::string test_time_str; | 178 std::string test_time_str; |
179 if (!xml_reader.NodeAttribute("time", &test_time_str)) | 179 if (!xml_reader.NodeAttribute("time", &test_time_str)) |
180 return false; | 180 return false; |
181 result.elapsed_time = | 181 result.elapsed_time = TimeDelta::FromMicroseconds( |
182 TimeDelta::FromMicroseconds(strtod(test_time_str.c_str(), NULL) * | 182 static_cast<int64>(strtod(test_time_str.c_str(), NULL) * |
183 Time::kMicrosecondsPerSecond); | 183 Time::kMicrosecondsPerSecond)); |
184 | 184 |
185 result.status = TestResult::TEST_SUCCESS; | 185 result.status = TestResult::TEST_SUCCESS; |
186 | 186 |
187 if (!results->empty() && | 187 if (!results->empty() && |
188 results->at(results->size() - 1).full_name == result.full_name && | 188 results->at(results->size() - 1).full_name == result.full_name && |
189 results->at(results->size() - 1).status == | 189 results->at(results->size() - 1).status == |
190 TestResult::TEST_CRASH) { | 190 TestResult::TEST_CRASH) { |
191 // Erase the fail-safe "crashed" result - now we know the test did | 191 // Erase the fail-safe "crashed" result - now we know the test did |
192 // not crash. | 192 // not crash. |
193 results->pop_back(); | 193 results->pop_back(); |
(...skipping 26 matching lines...) Expand all Loading... |
220 // format. | 220 // format. |
221 return false; | 221 return false; |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 *crashed = (state != STATE_END); | 225 *crashed = (state != STATE_END); |
226 return true; | 226 return true; |
227 } | 227 } |
228 | 228 |
229 } // namespace base | 229 } // namespace base |
OLD | NEW |