| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_util.h" | 5 #include "base/test/gtest_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 return tests; | 44 return tests; |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool WriteCompiledInTestsToFile(const FilePath& path) { | 47 bool WriteCompiledInTestsToFile(const FilePath& path) { |
| 48 std::vector<TestIdentifier> tests(GetCompiledInTests()); | 48 std::vector<TestIdentifier> tests(GetCompiledInTests()); |
| 49 | 49 |
| 50 ListValue root; | 50 ListValue root; |
| 51 for (size_t i = 0; i < tests.size(); ++i) { | 51 for (size_t i = 0; i < tests.size(); ++i) { |
| 52 std::unique_ptr<class base::DictionaryValue> test_info(new DictionaryValue); | 52 std::unique_ptr<DictionaryValue> test_info(new DictionaryValue); |
| 53 test_info->SetString("test_case_name", tests[i].test_case_name); | 53 test_info->SetString("test_case_name", tests[i].test_case_name); |
| 54 test_info->SetString("test_name", tests[i].test_name); | 54 test_info->SetString("test_name", tests[i].test_name); |
| 55 test_info->SetString("file", tests[i].file); | 55 test_info->SetString("file", tests[i].file); |
| 56 test_info->SetInteger("line", tests[i].line); | 56 test_info->SetInteger("line", tests[i].line); |
| 57 root.Append(std::move(test_info)); | 57 root.Append(std::move(test_info)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 JSONFileValueSerializer serializer(path); | 60 JSONFileValueSerializer serializer(path); |
| 61 return serializer.Serialize(root); | 61 return serializer.Serialize(root); |
| 62 } | 62 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return false; | 96 return false; |
| 97 | 97 |
| 98 result.push_back(test_data); | 98 result.push_back(test_data); |
| 99 } | 99 } |
| 100 | 100 |
| 101 output->swap(result); | 101 output->swap(result); |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace base | 105 } // namespace base |
| OLD | NEW |