Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: tools/json_schema_compiler/test/test_util.cc

Issue 11827026: Overhaul JSON Schema Compiler to support a number of features required to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #include "tools/json_schema_compiler/test/test_util.h"
6
7 #include "base/values.h"
8
9 namespace json_schema_compiler {
10 namespace test_util {
11
12 scoped_ptr<base::DictionaryValue> ValueMapToDictionary(
Yoyo Zhou 2013/01/15 01:49:25 Why are these converters in test_util? You've used
not at google - send to devlin 2013/01/15 21:47:27 Yeah, I'll delete.
13 const std::map<std::string, linked_ptr<base::Value> >& values) {
14 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
15 for (std::map<std::string, linked_ptr<base::Value> >::const_iterator it =
16 values.begin();
17 it != values.end(); ++it) {
18 dict->SetWithoutPathExpansion(it->first, it->second->DeepCopy());
19 }
20 return dict.Pass();
21 }
22
23 std::map<std::string, linked_ptr<base::Value> > DictionaryToValueMap(
24 const base::DictionaryValue& dict) {
25 std::map<std::string, linked_ptr<base::Value> > values;
26 for (DictionaryValue::Iterator it(dict); it.HasNext(); it.Advance())
27 values[it.key()] = make_linked_ptr(it.value().DeepCopy());
28 return values;
29 }
30
31 } // namespace test_util
32 } // namespace json_schema_compiler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698