| 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 #ifndef TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_ | 5 #ifndef TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_ |
| 6 #define TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_ | 6 #define TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 arr.push_back(b); | 27 arr.push_back(b); |
| 28 return arr; | 28 return arr; |
| 29 } | 29 } |
| 30 template <typename T> | 30 template <typename T> |
| 31 std::vector<T> Vector(const T& a, const T& b, const T& c) { | 31 std::vector<T> Vector(const T& a, const T& b, const T& c) { |
| 32 std::vector<T> arr = Vector(a, b); | 32 std::vector<T> arr = Vector(a, b); |
| 33 arr.push_back(c); | 33 arr.push_back(c); |
| 34 return arr; | 34 return arr; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // TODO(dcheng): These various helpers should all take std::unique_ptr |
| 38 // arguments. See https://crbug.com/581865. |
| 37 std::unique_ptr<base::ListValue> List(base::Value* a); | 39 std::unique_ptr<base::ListValue> List(base::Value* a); |
| 38 std::unique_ptr<base::ListValue> List(base::Value* a, base::Value* b); | 40 std::unique_ptr<base::ListValue> List(base::Value* a, base::Value* b); |
| 39 std::unique_ptr<base::ListValue> List(base::Value* a, | 41 std::unique_ptr<base::ListValue> List(base::Value* a, |
| 40 base::Value* b, | 42 base::Value* b, |
| 41 base::Value* c); | 43 base::Value* c); |
| 42 | 44 |
| 43 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, | 45 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, |
| 44 base::Value* av); | 46 base::Value* av); |
| 45 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, | 47 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, |
| 46 base::Value* av, | 48 base::Value* av, |
| 47 const std::string& bk, | 49 const std::string& bk, |
| 48 base::Value* bv); | 50 base::Value* bv); |
| 49 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, | 51 std::unique_ptr<base::DictionaryValue> Dictionary(const std::string& ak, |
| 50 base::Value* av, | 52 base::Value* av, |
| 51 const std::string& bk, | 53 const std::string& bk, |
| 52 base::Value* bv, | 54 base::Value* bv, |
| 53 const std::string& ck, | 55 const std::string& ck, |
| 54 base::Value* cv); | 56 base::Value* cv); |
| 55 | 57 |
| 56 } // namespace test_util | 58 } // namespace test_util |
| 57 } // namespace json_schema_compiler | 59 } // namespace json_schema_compiler |
| 58 | 60 |
| 59 #endif // TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_ | 61 #endif // TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_ |
| OLD | NEW |