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

Unified Diff: runtime/vm/json_test.cc

Issue 1799933002: Ensure embedder timeline callbacks are called for service protocol requests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/json_test.cc
diff --git a/runtime/vm/json_test.cc b/runtime/vm/json_test.cc
index 7c5b49f81a149483cbccde503cf832ef7b39f1ec..e8c4f5d959a52812890373d21543ee83526858fe 100644
--- a/runtime/vm/json_test.cc
+++ b/runtime/vm/json_test.cc
@@ -315,6 +315,33 @@ TEST_CASE(JSON_JSONStream_Params) {
EXPECT(!js.ParamIs("dog", "banana"));
}
+
+TEST_CASE(JSON_JSONStream_AppendJSONStreamConsumer) {
+ JSONStream js;
+
+ {
+ JSONObject obj(&js);
+ {
+ JSONArray arr(&obj, "test");
+ const char* test_data = "{a, b, c},";
+ AppendJSONStreamConsumer(Dart_StreamConsumer_kData, "",
+ reinterpret_cast<const uint8_t*>(&test_data[0]),
+ strlen(test_data),
+ &js);
+ AppendJSONStreamConsumer(Dart_StreamConsumer_kData, "",
+ reinterpret_cast<const uint8_t*>(&test_data[0]),
+ strlen(test_data),
+ &js);
+ AppendJSONStreamConsumer(Dart_StreamConsumer_kData, "",
+ reinterpret_cast<const uint8_t*>(&test_data[0]),
+ strlen(test_data) - 1,
+ &js);
+ }
+ }
+
+ EXPECT_STREQ("{\"test\":[{a, b, c},{a, b, c},{a, b, c}]}", js.ToCString());
+}
+
#endif // !PRODUCT
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698