migrate complex layout to null safety (#83894)
This commit is contained in:
committed by
GitHub
parent
1df798a54b
commit
92e3436fe7
@@ -8,7 +8,7 @@ import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||
|
||||
Future<void> main() => driver.integrationDriver(
|
||||
timeout: const Duration(minutes: 5),
|
||||
responseDataCallback: (Map<String, dynamic> data) async {
|
||||
responseDataCallback: (Map<String, dynamic>? data) async {
|
||||
await driver.writeResponseData(
|
||||
data,
|
||||
testOutputFilename: 'scroll_smoothness_test',
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
void main() {
|
||||
group('scrolling performance test', () {
|
||||
FlutterDriver driver;
|
||||
late FlutterDriver driver;
|
||||
|
||||
setUpAll(() async {
|
||||
driver = await FlutterDriver.connect();
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||
|
||||
void main() {
|
||||
group('semantics performance test', () {
|
||||
FlutterDriver driver;
|
||||
late FlutterDriver driver;
|
||||
|
||||
setUpAll(() async {
|
||||
driver = await FlutterDriver.connect(printCommunication: true);
|
||||
@@ -33,10 +33,10 @@ void main() {
|
||||
expect(await driver.setSemantics(true), isTrue);
|
||||
});
|
||||
|
||||
final Iterable<TimelineEvent> semanticsEvents = timeline.events.where((TimelineEvent event) => event.name == 'Semantics');
|
||||
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 Iterable<TimelineEvent>? semanticsEvents = timeline.events?.where((TimelineEvent event) => event.name == 'Semantics');
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user