| 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 <stdint.h> |
| 8 |
| 7 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 10 #include "base/test/gtest_util.h" | 12 #include "base/test/gtest_util.h" |
| 11 #include "base/test/launcher/test_launcher.h" | 13 #include "base/test/launcher/test_launcher.h" |
| 12 #include "third_party/libxml/chromium/libxml_utils.h" | 14 #include "third_party/libxml/chromium/libxml_utils.h" |
| 13 | 15 |
| 14 namespace base { | 16 namespace base { |
| 15 | 17 |
| 16 namespace { | 18 namespace { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return false; | 113 return false; |
| 112 std::string test_name; | 114 std::string test_name; |
| 113 if (!xml_reader.NodeAttribute("name", &test_name)) | 115 if (!xml_reader.NodeAttribute("name", &test_name)) |
| 114 return false; | 116 return false; |
| 115 result.full_name = test_case_name + "." + test_name; | 117 result.full_name = test_case_name + "." + test_name; |
| 116 | 118 |
| 117 std::string test_time_str; | 119 std::string test_time_str; |
| 118 if (!xml_reader.NodeAttribute("time", &test_time_str)) | 120 if (!xml_reader.NodeAttribute("time", &test_time_str)) |
| 119 return false; | 121 return false; |
| 120 result.elapsed_time = TimeDelta::FromMicroseconds( | 122 result.elapsed_time = TimeDelta::FromMicroseconds( |
| 121 static_cast<int64>(strtod(test_time_str.c_str(), NULL) * | 123 static_cast<int64_t>(strtod(test_time_str.c_str(), NULL) * |
| 122 Time::kMicrosecondsPerSecond)); | 124 Time::kMicrosecondsPerSecond)); |
| 123 | 125 |
| 124 result.status = TestResult::TEST_SUCCESS; | 126 result.status = TestResult::TEST_SUCCESS; |
| 125 | 127 |
| 126 if (!results->empty() && | 128 if (!results->empty() && |
| 127 results->at(results->size() - 1).full_name == result.full_name && | 129 results->at(results->size() - 1).full_name == result.full_name && |
| 128 results->at(results->size() - 1).status == | 130 results->at(results->size() - 1).status == |
| 129 TestResult::TEST_CRASH) { | 131 TestResult::TEST_CRASH) { |
| 130 // Erase the fail-safe "crashed" result - now we know the test did | 132 // Erase the fail-safe "crashed" result - now we know the test did |
| 131 // not crash. | 133 // not crash. |
| 132 results->pop_back(); | 134 results->pop_back(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 159 // format. | 161 // format. |
| 160 return false; | 162 return false; |
| 161 } | 163 } |
| 162 } | 164 } |
| 163 | 165 |
| 164 *crashed = (state != STATE_END); | 166 *crashed = (state != STATE_END); |
| 165 return true; | 167 return true; |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // namespace base | 170 } // namespace base |
| OLD | NEW |