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/launcher/test_results_tracker.h" | 5 #include "base/test/launcher/test_results_tracker.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 current_iteration_data->SetWithoutPathExpansion(j->first, test_results); | 281 current_iteration_data->SetWithoutPathExpansion(j->first, test_results); |
282 | 282 |
283 for (size_t k = 0; k < j->second.test_results.size(); k++) { | 283 for (size_t k = 0; k < j->second.test_results.size(); k++) { |
284 const TestResult& test_result = j->second.test_results[k]; | 284 const TestResult& test_result = j->second.test_results[k]; |
285 | 285 |
286 DictionaryValue* test_result_value = new DictionaryValue; | 286 DictionaryValue* test_result_value = new DictionaryValue; |
287 test_results->Append(test_result_value); | 287 test_results->Append(test_result_value); |
288 | 288 |
289 test_result_value->SetString("status", test_result.StatusAsString()); | 289 test_result_value->SetString("status", test_result.StatusAsString()); |
290 test_result_value->SetInteger( | 290 test_result_value->SetInteger( |
291 "elapsed_time_ms", test_result.elapsed_time.InMilliseconds()); | 291 "elapsed_time_ms", |
| 292 static_cast<int>(test_result.elapsed_time.InMilliseconds())); |
292 | 293 |
293 // There are no guarantees about character encoding of the output | 294 // There are no guarantees about character encoding of the output |
294 // snippet. Escape it and record whether it was losless. | 295 // snippet. Escape it and record whether it was losless. |
295 // It's useful to have the output snippet as string in the summary | 296 // It's useful to have the output snippet as string in the summary |
296 // for easy viewing. | 297 // for easy viewing. |
297 std::string escaped_output_snippet; | 298 std::string escaped_output_snippet; |
298 bool losless_snippet = EscapeJSONString( | 299 bool losless_snippet = EscapeJSONString( |
299 test_result.output_snippet, false, &escaped_output_snippet); | 300 test_result.output_snippet, false, &escaped_output_snippet); |
300 test_result_value->SetString("output_snippet", | 301 test_result_value->SetString("output_snippet", |
301 escaped_output_snippet); | 302 escaped_output_snippet); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 TestResultsTracker::AggregateTestResult::~AggregateTestResult() { | 351 TestResultsTracker::AggregateTestResult::~AggregateTestResult() { |
351 } | 352 } |
352 | 353 |
353 TestResultsTracker::PerIterationData::PerIterationData() { | 354 TestResultsTracker::PerIterationData::PerIterationData() { |
354 } | 355 } |
355 | 356 |
356 TestResultsTracker::PerIterationData::~PerIterationData() { | 357 TestResultsTracker::PerIterationData::~PerIterationData() { |
357 } | 358 } |
358 | 359 |
359 } // namespace base | 360 } // namespace base |
OLD | NEW |