Unverified Commit 305a855f authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Migrate integration test shard test data to null safety (#92147)

parent 12ec91a5
...@@ -2,15 +2,13 @@ ...@@ -2,15 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart'; import 'package:file/file.dart';
import '../test_utils.dart'; import '../test_utils.dart';
abstract class DeferredComponentsConfig { abstract class DeferredComponentsConfig {
String get deferredLibrary; String get deferredLibrary;
String get deferredComponentsGolden; String? get deferredComponentsGolden;
String get androidSettings; String get androidSettings;
String get androidBuild; String get androidBuild;
String get androidLocalProperties; String get androidLocalProperties;
...@@ -30,8 +28,9 @@ abstract class DeferredComponentsConfig { ...@@ -30,8 +28,9 @@ abstract class DeferredComponentsConfig {
if (deferredLibrary != null) { if (deferredLibrary != null) {
writeFile(fileSystem.path.join(dir.path, 'lib', 'deferred_library.dart'), deferredLibrary); writeFile(fileSystem.path.join(dir.path, 'lib', 'deferred_library.dart'), deferredLibrary);
} }
if (deferredComponentsGolden != null) { final String? golden = deferredComponentsGolden;
writeFile(fileSystem.path.join(dir.path, 'deferred_components_loading_units.yaml'), deferredComponentsGolden); if (golden != null) {
writeFile(fileSystem.path.join(dir.path, 'deferred_components_loading_units.yaml'), golden);
} }
if (androidSettings != null) { if (androidSettings != null) {
writeFile(fileSystem.path.join(dir.path, 'android', 'settings.gradle'), androidSettings); writeFile(fileSystem.path.join(dir.path, 'android', 'settings.gradle'), androidSettings);
......
...@@ -2,13 +2,10 @@ ...@@ -2,13 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:file/local.dart'; import 'package:file/local.dart';
import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/platform.dart';
import 'package:meta/meta.dart';
import 'package:process/process.dart'; import 'package:process/process.dart';
import 'package:vm_service/vm_service.dart'; import 'package:vm_service/vm_service.dart';
...@@ -91,18 +88,18 @@ List<String> getLocalEngineArguments() { ...@@ -91,18 +88,18 @@ List<String> getLocalEngineArguments() {
} }
Future<void> pollForServiceExtensionValue<T>({ Future<void> pollForServiceExtensionValue<T>({
@required FlutterTestDriver testDriver, required FlutterTestDriver testDriver,
@required String extension, required String extension,
@required T continuePollingValue, required T continuePollingValue,
@required Matcher matches, required Matcher matches,
String valueKey = 'value', String valueKey = 'value',
}) async { }) async {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
final Response response = await testDriver.callServiceExtension(extension); final Response response = await testDriver.callServiceExtension(extension);
if (response.json[valueKey] as T == continuePollingValue) { if (response.json?[valueKey] as T == continuePollingValue) {
await Future<void>.delayed(const Duration(seconds: 1)); await Future<void>.delayed(const Duration(seconds: 1));
} else { } else {
expect(response.json[valueKey] as T, matches); expect(response.json?[valueKey] as T, matches);
return; return;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment