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
3 // found in the LICENSE file.
5 #ifndef TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_
6 #define TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string_piece.h"
10 #include "base/values.h"
12 namespace json_schema_compiler
{
15 scoped_ptr
<base::Value
> ReadJson(const base::StringPiece
& json
);
18 std::vector
<T
> Vector(const T
& a
) {
24 std::vector
<T
> Vector(const T
& a
, const T
& b
) {
25 std::vector
<T
> arr
= Vector(a
);
30 std::vector
<T
> Vector(const T
& a
, const T
& b
, const T
& c
) {
31 std::vector
<T
> arr
= Vector(a
, b
);
36 scoped_ptr
<base::ListValue
> List(base::Value
* a
);
37 scoped_ptr
<base::ListValue
> List(base::Value
* a
, base::Value
* b
);
38 scoped_ptr
<base::ListValue
> List(base::Value
* a
,
42 scoped_ptr
<base::DictionaryValue
> Dictionary(
43 const std::string
& ak
, base::Value
* av
);
44 scoped_ptr
<base::DictionaryValue
> Dictionary(
45 const std::string
& ak
, base::Value
* av
,
46 const std::string
& bk
, base::Value
* bv
);
47 scoped_ptr
<base::DictionaryValue
> Dictionary(
48 const std::string
& ak
, base::Value
* av
,
49 const std::string
& bk
, base::Value
* bv
,
50 const std::string
& ck
, base::Value
* cv
);
52 } // namespace test_util
53 } // namespace json_schema_compiler
55 #endif // TOOLS_JSON_SCHEMA_COMPILER_TEST_TEST_UTIL_H_