Home | History | Annotate | Download | only in src

Lines Matching refs:json

7 #include <base/json/json_reader.h>
8 #include <base/json/json_writer.h>
91 const base::Value& json) {
94 json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &text);
264 base::DictionaryValue json;
265 json.SetString("access_token", test_data::kAccessToken);
266 json.SetInteger("expires_in", 3600);
268 callback.Run(ReplyWithJson(200, json), nullptr);
281 base::DictionaryValue json;
282 callback.Run(ReplyWithJson(200, json), nullptr);
307 base::DictionaryValue json;
308 json.SetString("error", "unable_to_authenticate");
309 callback.Run(ReplyWithJson(400, json), nullptr);
336 base::DictionaryValue json;
337 json.SetString("error", "invalid_grant");
338 callback.Run(ReplyWithJson(400, json), nullptr);
359 base::DictionaryValue json;
360 json.SetString("channel.supportedType", "xmpp");
361 json.SetString("deviceKind", "vendor");
362 json.SetString("id", test_data::kCloudId);
363 json.SetString("kind", "weave#device");
364 callback.Run(ReplyWithJson(200, json), nullptr);
420 auto json = test::CreateDictionaryValue(data);
421 EXPECT_NE(nullptr, json.get());
423 EXPECT_TRUE(json->GetString("id", &value));
426 json->GetString("deviceDraft.channel.supportedType", &value));
428 EXPECT_TRUE(json->GetString("oauthClientId", &value));
430 EXPECT_TRUE(json->GetString("deviceDraft.description", &value));
432 EXPECT_TRUE(json->GetString("deviceDraft.location", &value));
434 EXPECT_TRUE(json->GetString("deviceDraft.modelManifestId", &value));
436 EXPECT_TRUE(json->GetString("deviceDraft.name", &value));
439 EXPECT_FALSE(json->GetDictionary("deviceDraft.commandDefs", &dict));
440 EXPECT_FALSE(json->GetDictionary("deviceDraft.state", &dict));
441 EXPECT_TRUE(json->GetDictionary("deviceDraft.traits", &dict));
465 EXPECT_TRUE(json->GetDictionary("deviceDraft.components", &dict));
481 EXPECT_TRUE(json->GetDictionary("deviceDraft", &device_draft));
496 base::DictionaryValue json;
497 json.SetString("id", test_data::kClaimTicketId);
498 json.SetString("kind", "weave#registrationTicket");
499 json.SetString("oauthClientId", test_data::kClientId);
500 json.SetString("userEmail", "user@email.com");
501 json.SetString("deviceDraft.id", test_data::kCloudId);
502 json.SetString("deviceDraft.kind", "weave#device");
503 json.SetString("deviceDraft.channel.supportedType", "xmpp");
504 json.SetString("robotAccountEmail", test_data::kRobotAccountEmail);
505 json.SetString("robotAccountAuthorizationCode",
507 callback.Run(ReplyWithJson(200, json), nullptr);
524 base::DictionaryValue json;
525 json.SetString("access_token", test_data::kAccessToken);
526 json.SetString("token_type", "Bearer");
527 json.SetString("refresh_token", test_data::kRefreshToken);
528 json.SetInteger("expires_in", 3600);
530 callback.Run(ReplyWithJson(200, json), nullptr);
543 base::DictionaryValue json;
544 callback.Run(ReplyWithJson(200, json), nullptr);
658 base::DictionaryValue json;
659 callback.Run(ReplyWithJson(200, json), nullptr);
675 base::DictionaryValue json;
676 callback.Run(ReplyWithJson(200, json), nullptr);
692 base::DictionaryValue json;
693 callback.Run(ReplyWithJson(200, json), nullptr);