| Index: base/test/values_test_util.cc
|
| diff --git a/base/test/values_test_util.cc b/base/test/values_test_util.cc
|
| index c5dfd7946adc2333e67fa96dac955e2953126879..46241c328778ce29736a72cccfeef1ccded7bbdb 100644
|
| --- a/base/test/values_test_util.cc
|
| +++ b/base/test/values_test_util.cc
|
| @@ -74,5 +74,21 @@ scoped_ptr<Value> ParseJson(base::StringPiece json) {
|
| return result.Pass();
|
| }
|
|
|
| +scoped_ptr<DictionaryValue> ParseJsonDictionaryWithSingleQuotes(
|
| + std::string json) {
|
| + std::replace(json.begin(), json.end(), '\'', '"');
|
| + std::string error_msg;
|
| + scoped_ptr<Value> result(base::JSONReader::ReadAndReturnError(
|
| + json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error_msg));
|
| + scoped_ptr<base::DictionaryValue> result_dict;
|
| + if (result && result->IsType(base::Value::TYPE_DICTIONARY)) {
|
| + result_dict.reset(static_cast<DictionaryValue*>(result.release()));
|
| + } else {
|
| + ADD_FAILURE() << "Failed to parse \"" << json << "\": " << error_msg;
|
| + result_dict.reset(new base::DictionaryValue());
|
| + }
|
| + return result_dict.Pass();
|
| +}
|
| +
|
| } // namespace test
|
| } // namespace base
|
|
|