m3_lightmeter/test_driver/performance_driver.dart

28 lines
969 B
Dart
Raw Normal View History

2023-08-12 13:31:32 +00:00
import 'package:flutter_driver/flutter_driver.dart' as driver;
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() {
return integrationDriver(
responseDataCallback: (data) async {
if (data != null) {
final timeline =
driver.Timeline.fromJson(data['dialog_opening_timeline'] as Map<String, dynamic>);
// Convert the Timeline into a TimelineSummary that's easier to
// read and understand.
final summary = driver.TimelineSummary.summarize(timeline);
// Then, write the entire timeline to disk in a json format.
// This file can be opened in the Chrome browser's tracing tools
// found by navigating to chrome://tracing.
// Optionally, save the summary to disk by setting includeSummary
// to true
await summary.writeTimelineToFile(
2023-08-12 13:34:31 +00:00
'dialog_opening_timeline(fade)',
2023-08-12 13:31:32 +00:00
pretty: true,
);
}
},
);
}