Home
last modified time | relevance | path

Searched refs:JSONReader (Results 1 – 18 of 18) sorted by relevance

/external/libchrome/base/json/
Djson_reader_unittest.cc25 std::unique_ptr<Value> root = JSONReader().ReadToValue(" null "); in TEST()
31 EXPECT_FALSE(JSONReader().ReadToValue("nu")); in TEST()
35 std::unique_ptr<Value> root = JSONReader().ReadToValue("true "); in TEST()
41 std::unique_ptr<Value> root = JSONReader().ReadToValue("/* comment */null"); in TEST()
44 root = JSONReader().ReadToValue("40 /* comment */"); in TEST()
47 root = JSONReader().ReadToValue("true // comment"); in TEST()
50 root = JSONReader().ReadToValue("/* comment */\"sample string\""); in TEST()
57 ListValue::From(JSONReader().ReadToValue("[1, /* comment, 2 ] */ \n 3]")); in TEST()
65 list = ListValue::From(JSONReader().ReadToValue("[1, /*a*/2, 3]")); in TEST()
68 root = JSONReader().ReadToValue("/* comment **/42"); in TEST()
[all …]
Djson_reader.cc19 const int JSONReader::kStackMaxDepth = 200;
22 static_assert(JSONReader::JSON_PARSE_ERROR_COUNT < 1000,
25 const char JSONReader::kInvalidEscape[] =
27 const char JSONReader::kSyntaxError[] =
29 const char JSONReader::kUnexpectedToken[] =
31 const char JSONReader::kTrailingComma[] =
33 const char JSONReader::kTooMuchNesting[] =
35 const char JSONReader::kUnexpectedDataAfterRoot[] =
37 const char JSONReader::kUnsupportedEncoding[] =
39 const char JSONReader::kUnquotedDictionaryKey[] =
[all …]
Djson_parser_unittest.cc228 std::unique_ptr<Value> root = JSONReader::ReadAndReturnError( in TEST_F()
236 root = JSONReader::ReadAndReturnError(big_json, JSON_PARSE_RFC, &error_code, in TEST_F()
239 EXPECT_EQ(JSONParser::FormatErrorMessage(5, 10, JSONReader::kSyntaxError), in TEST_F()
241 EXPECT_EQ(JSONReader::JSON_SYNTAX_ERROR, error_code); in TEST_F()
249 root = JSONReader::ReadAndReturnError(big_json_crlf, JSON_PARSE_RFC, in TEST_F()
252 EXPECT_EQ(JSONParser::FormatErrorMessage(5, 10, JSONReader::kSyntaxError), in TEST_F()
254 EXPECT_EQ(JSONReader::JSON_SYNTAX_ERROR, error_code); in TEST_F()
257 root = JSONReader::ReadAndReturnError("{},{}", JSON_PARSE_RFC, &error_code, in TEST_F()
261 JSONReader::kUnexpectedDataAfterRoot), error_message); in TEST_F()
262 EXPECT_EQ(JSONReader::JSON_UNEXPECTED_DATA_AFTER_ROOT, error_code); in TEST_F()
[all …]
Djson_parser.cc65 error_code_(JSONReader::JSON_NO_ERROR), in JSONParser()
68 CHECK_LE(max_depth, JSONReader::kStackMaxDepth); in JSONParser()
79 error_code_ = JSONReader::JSON_NO_ERROR; in Parse()
86 ReportError(JSONReader::JSON_TOO_LARGE, 0); in Parse()
102 ReportError(JSONReader::JSON_UNEXPECTED_DATA_AFTER_ROOT, 1); in Parse()
109 JSONReader::JsonParseError JSONParser::error_code() const { in error_code()
115 JSONReader::ErrorCodeToString(error_code_)); in GetErrorMessage()
323 ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); in ParseToken()
330 ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); in ConsumeDictionary()
336 ReportError(JSONReader::JSON_TOO_MUCH_NESTING, 0); in ConsumeDictionary()
[all …]
Djson_parser.h46 JSONParser(int options, int max_depth = JSONReader::kStackMaxDepth);
56 JSONReader::JsonParseError error_code() const;
207 void ReportError(JSONReader::JsonParseError code, int column_adjust);
236 JSONReader::JsonParseError error_code_;
Djson_value_converter_unittest.cc108 std::unique_ptr<Value> value = base::JSONReader::Read(normal_data); in TEST()
150 std::unique_ptr<Value> value = base::JSONReader::Read(normal_data); in TEST()
192 std::unique_ptr<Value> value = base::JSONReader::Read(normal_data); in TEST()
208 std::unique_ptr<Value> value = base::JSONReader::Read(normal_data); in TEST()
231 std::unique_ptr<Value> value = base::JSONReader::Read(normal_data); in TEST()
248 std::unique_ptr<Value> value = base::JSONReader::Read(normal_data); in TEST()
Djson_reader.h59 class BASE_EXPORT JSONReader {
90 JSONReader(int options = JSON_PARSE_RFC, int max_depth = kStackMaxDepth);
92 ~JSONReader();
Djson_correctness_fuzzer.cc38 auto parsed_value = base::JSONReader::ReadAndReturnError( in LLVMFuzzerTestOneInput()
48 auto double_parsed_value = base::JSONReader::ReadAndReturnError( in LLVMFuzzerTestOneInput()
Djson_value_serializer_unittest.cc79 std::unique_ptr<ListValue> list = ListValue::From(JSONReader::Read(json)); in ValidateJsonList()
142 ASSERT_EQ(JSONReader::JSON_TRAILING_COMMA, error_code); in TEST()
196 ASSERT_EQ(JSONReader::JSON_TRAILING_COMMA, error_code); in TEST()
382 ListValue::From(JSONReader::Read("[\"// ok\\n /* foo */ \"]")); in TEST()
392 ASSERT_FALSE(JSONReader::Read("/* /* inner */ outer */ [ 1 ]")); in TEST()
395 ASSERT_FALSE(JSONReader::Read("/ * * / [1]")); in TEST()
Djson_reader_fuzzer.cc24 base::JSONReader::ReadAndReturnError(input_string, options, &error_code, in LLVMFuzzerTestOneInput()
Djson_string_value_serializer.cc53 return base::JSONReader::ReadAndReturnError(json_string_, options_, in Deserialize()
/external/libchrome/base/metrics/
Dstatistics_recorder_unittest.cc362 std::unique_ptr<Value> root = JSONReader::Read(json); in TEST_P()
389 root = JSONReader::Read(json); in TEST_P()
/external/libbrillo/brillo/http/
Dhttp_transport_fake.cc183 auto value = base::JSONReader::Read(GetDataAsString()); in GetDataAsJson()
Dhttp_utils.cc399 auto value = base::JSONReader::ReadAndReturnError(json, base::JSON_PARSE_RFC, in ParseJsonResponse()
/external/libbrillo/brillo/
Dvalue_conversion_unittest.cc34 auto value = base::JSONReader::ReadAndReturnError(json, base::JSON_PARSE_RFC, in ParseValue()
/external/libchrome/components/policy/core/common/
Dregistry_dict.cc129 base::JSONReader::Read(string_value); in ConvertRegistryValue()
/external/libbrillo/policy/
Ddevice_policy_impl.cc152 base::JSONReader::ReadAndReturnError(json_string, in DecodeListValueFromJSON()
/external/libchrome/components/json_schema/
Djson_schema_validator.cc418 std::unique_ptr<base::Value> json = base::JSONReader::ReadAndReturnError( in IsValidSchema()