Skip to content

Commit d4afa28

Browse files
authored
Migrate core devicelab tasks f-i null safety. (flutter#85997)
1 parent 9d3563a commit d4afa28

61 files changed

Lines changed: 29 additions & 147 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev/devicelab/bin/tasks/flutter_attach_test_fuchsia.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'dart:async';
86
import 'dart:convert';
97
import 'dart:io';
@@ -116,8 +114,8 @@ void main() {
116114
'sentinel-${random.nextInt(1<<32)}': Completer<void>(),
117115
};
118116

119-
Process runProcess;
120-
Process logsProcess;
117+
late Process runProcess;
118+
late Process logsProcess;
121119

122120
try {
123121
section('Creating lib/fuchsia_main.dart');
@@ -158,12 +156,12 @@ void main() {
158156
print('logs:stdout: $log');
159157
for (final String sentinel in sentinelMessage.keys) {
160158
if (log.contains(sentinel)) {
161-
if (sentinelMessage[sentinel].isCompleted) {
159+
if (sentinelMessage[sentinel]!.isCompleted) {
162160
throw Exception(
163161
'Expected a single `$sentinel` message in the device log, but found more than one'
164162
);
165163
}
166-
sentinelMessage[sentinel].complete();
164+
sentinelMessage[sentinel]!.complete();
167165
break;
168166
}
169167
}
@@ -230,7 +228,7 @@ void main() {
230228
}
231229

232230
for (final String sentinel in sentinelMessage.keys) {
233-
if (!sentinelMessage[sentinel].isCompleted) {
231+
if (!sentinelMessage[sentinel]!.isCompleted) {
234232
throw Exception('Expected $sentinel in the device logs.');
235233
}
236234
}

dev/devicelab/bin/tasks/flutter_engine_group_performance.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'dart:io';
86

97
import 'package:flutter_devicelab/framework/devices.dart';
@@ -73,7 +71,7 @@ Future<TaskResult> _doTest() async {
7371
final String apkPath = path.join(multipleFluttersPath, 'android', 'app',
7472
'build', 'outputs', 'apk', 'release', 'app-release.apk');
7573

76-
TaskResult result;
74+
TaskResult? result;
7775
await _withApkInstall(apkPath, _bundleName, (AndroidDevice device) async {
7876
final List<int> totalMemorySamples = <int>[];
7977
for (int i = 0; i < _numberOfIterations; ++i) {

dev/devicelab/bin/tasks/flutter_gallery__back_button_memory.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
/// Measure application memory usage after pausing and resuming the app
86
/// with the Android back button.
97
@@ -19,7 +17,7 @@ class BackButtonMemoryTest extends MemoryTest {
1917
BackButtonMemoryTest() : super('${flutterDirectory.path}/dev/integration_tests/flutter_gallery', 'test_memory/back_button.dart', packageName);
2018

2119
@override
22-
AndroidDevice get device => super.device as AndroidDevice;
20+
AndroidDevice? get device => super.device as AndroidDevice?;
2321

2422
@override
2523
int get iterationCount => 5;
@@ -34,15 +32,15 @@ class BackButtonMemoryTest extends MemoryTest {
3432

3533
// Push back button, wait for it to be seen by the Flutter app.
3634
prepareForNextMessage('AppLifecycleState.paused');
37-
await device.shellExec('input', <String>['keyevent', 'KEYCODE_BACK']);
35+
await device!.shellExec('input', <String>['keyevent', 'KEYCODE_BACK']);
3836
await receivedNextMessage;
3937

4038
// Give Android time to settle (e.g. run GCs) after closing the app.
4139
await Future<void>.delayed(const Duration(milliseconds: 100));
4240

4341
// Relaunch the app, wait for it to launch.
4442
prepareForNextMessage('READY');
45-
final String output = await device.shellEval('am', <String>['start', '-n', '$packageName/$activityName']);
43+
final String output = await device!.shellEval('am', <String>['start', '-n', '$packageName/$activityName']);
4644
print('adb shell am start: $output');
4745
if (output.contains('Error'))
4846
fail('unable to launch activity');

dev/devicelab/bin/tasks/flutter_gallery__image_cache_memory.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/framework.dart';
86
import 'package:flutter_devicelab/framework/utils.dart';
97
import 'package:flutter_devicelab/tasks/perf_tests.dart';

dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/framework.dart';
86
import 'package:flutter_devicelab/framework/utils.dart';
97
import 'package:flutter_devicelab/tasks/perf_tests.dart';

dev/devicelab/bin/tasks/flutter_gallery__start_up.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/perf_tests.dart';

dev/devicelab/bin/tasks/flutter_gallery__transition_perf.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/gallery.dart';

dev/devicelab/bin/tasks/flutter_gallery__transition_perf_e2e.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/gallery.dart';

dev/devicelab/bin/tasks/flutter_gallery__transition_perf_e2e_ios.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/gallery.dart';

dev/devicelab/bin/tasks/flutter_gallery__transition_perf_e2e_ios32.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart = 2.8
6-
75
import 'package:flutter_devicelab/framework/devices.dart';
86
import 'package:flutter_devicelab/framework/framework.dart';
97
import 'package:flutter_devicelab/tasks/gallery.dart';

0 commit comments

Comments
 (0)