forked from firka/flutter
Migrate external_ui to null safety (#80640)
This commit is contained in:
committed by
GitHub
parent
4825c639b6
commit
4f2e7987f4
@@ -13,7 +13,7 @@ const Duration samplingTime = Duration(seconds: 8);
|
||||
|
||||
Future<void> main() async {
|
||||
group('texture suite', () {
|
||||
FlutterDriver driver;
|
||||
late FlutterDriver driver;
|
||||
|
||||
setUpAll(() async {
|
||||
driver = await FlutterDriver.connect();
|
||||
@@ -32,9 +32,9 @@ Future<void> main() async {
|
||||
await driver.waitFor(fab);
|
||||
|
||||
final String calibrationResult = await driver.getText(summary);
|
||||
final Match matchCalibration = calibrationRegExp.matchAsPrefix(calibrationResult);
|
||||
final Match? matchCalibration = calibrationRegExp.matchAsPrefix(calibrationResult);
|
||||
expect(matchCalibration, isNotNull);
|
||||
final double flutterFrameRate = double.parse(matchCalibration.group(1));
|
||||
final double flutterFrameRate = double.parse(matchCalibration?.group(1) ?? '0');
|
||||
|
||||
// Texture frame stats at 0.5x Flutter frame rate
|
||||
await driver.tap(fab);
|
||||
@@ -42,11 +42,11 @@ Future<void> main() async {
|
||||
await driver.tap(fab);
|
||||
|
||||
final String statsSlow = await driver.getText(summary);
|
||||
final Match matchSlow = statsRegExp.matchAsPrefix(statsSlow);
|
||||
final Match matchSlow = statsRegExp.matchAsPrefix(statsSlow)!;
|
||||
expect(matchSlow, isNotNull);
|
||||
expect(double.parse(matchSlow.group(1)), closeTo(flutterFrameRate / 2.0, 5.0));
|
||||
expect(double.parse(matchSlow.group(2)), closeTo(flutterFrameRate / 2.0, 5.0));
|
||||
expect(int.parse(matchSlow.group(3)), 1);
|
||||
expect(double.parse(matchSlow.group(1)!), closeTo(flutterFrameRate / 2.0, 5.0));
|
||||
expect(double.parse(matchSlow.group(2)!), closeTo(flutterFrameRate / 2.0, 5.0));
|
||||
expect(int.parse(matchSlow.group(3)!), 1);
|
||||
|
||||
// Texture frame stats at 2.0x Flutter frame rate
|
||||
await driver.tap(fab);
|
||||
@@ -54,15 +54,15 @@ Future<void> main() async {
|
||||
await driver.tap(fab);
|
||||
|
||||
final String statsFast = await driver.getText(summary);
|
||||
final Match matchFast = statsRegExp.matchAsPrefix(statsFast);
|
||||
final Match matchFast = statsRegExp.matchAsPrefix(statsFast)!;
|
||||
expect(matchFast, isNotNull);
|
||||
expect(double.parse(matchFast.group(1)), closeTo(flutterFrameRate * 2.0, 5.0));
|
||||
expect(double.parse(matchFast.group(2)), closeTo(flutterFrameRate, 10.0));
|
||||
expect(int.parse(matchFast.group(3)), 1);
|
||||
expect(double.parse(matchFast.group(1)!), closeTo(flutterFrameRate * 2.0, 5.0));
|
||||
expect(double.parse(matchFast.group(2)!), closeTo(flutterFrameRate, 10.0));
|
||||
expect(int.parse(matchFast.group(3)!), 1);
|
||||
});
|
||||
|
||||
tearDownAll(() async {
|
||||
driver?.close();
|
||||
driver.close();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user