Fix semantics and transition-perf tests to parse new event format. (#47899)

This commit is contained in:
Jim Graham
2019-12-27 18:15:49 -08:00
committed by GitHub
parent 4f23c4342b
commit cf00b969a1
2 changed files with 17 additions and 7 deletions

View File

@@ -34,9 +34,9 @@ void main() {
});
final Iterable<TimelineEvent> semanticsEvents = timeline.events.where((TimelineEvent event) => event.name == 'Semantics');
if (semanticsEvents.length != 1)
fail('Expected exactly one semantics event, got ${semanticsEvents.length}');
final Duration semanticsTreeCreation = semanticsEvents.first.duration;
if (semanticsEvents.length != 2)
fail('Expected exactly two semantics events, got ${semanticsEvents.length}');
final Duration semanticsTreeCreation = Duration(microseconds: semanticsEvents.last.timestampMicros - semanticsEvents.first.timestampMicros);
final String jsonEncoded = json.encode(<String, dynamic>{'initialSemanticsTreeCreation': semanticsTreeCreation.inMilliseconds});
File(p.join(testOutputsDirectory, 'complex_layout_semantics_perf.json')).writeAsStringSync(jsonEncoded);