Commit b0ccc6ad authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[perfetto] Skip metadata in JsonIntegrationTest

Fixes the test after a perfetto roll

Change-Id: Ib861edd1f87435b6bbc5e8b7599f118c72cc0776
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3732108
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81417}
parent c68c7248
......@@ -855,15 +855,20 @@ TEST_F(PlatformTracingTest, JsonIntegrationTest) {
harness.StopTracing();
std::string json = harness.perfetto_json_stream();
std::cout << json << "\n";
std::vector<std::string> all_args;
std::vector<std::string> all_args, all_cats;
GetJSONStrings(&all_args, json, "\"args\"", "{", "}");
GetJSONStrings(&all_cats, json, "\"cat\"", "\"", "\"");
// Ignore the first metadata event.
CHECK_EQ("\"1\":1e+100", all_args[1]);
CHECK_EQ("\"2\":\"NaN\"", all_args[2]);
CHECK_EQ("\"3\":\"Infinity\"", all_args[3]);
CHECK_EQ("\"4\":\"-Infinity\"", all_args[4]);
// Ignore the metadata events.
int i = 0;
while (all_cats[i] == "__metadata") ++i;
CHECK_EQ("\"1\":1e+100", all_args[i++]);
CHECK_EQ("\"2\":\"NaN\"", all_args[i++]);
CHECK_EQ("\"3\":\"Infinity\"", all_args[i++]);
CHECK_EQ("\"4\":\"-Infinity\"", all_args[i++]);
}
#endif // V8_USE_PERFETTO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment