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 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart';
import '../test_utils.dart';
abstract class DeferredComponentsConfig {
String get deferredLibrary;
String get deferredComponentsGolden;
String? get deferredComponentsGolden;
String get androidSettings;
String get androidBuild;
String get androidLocalProperties;
......@@ -30,8 +28,9 @@ abstract class DeferredComponentsConfig {
if (deferredLibrary != null) {
writeFile(fileSystem.path.join(dir.path, 'lib', 'deferred_library.dart'), deferredLibrary);
}
if (deferredComponentsGolden != null) {
writeFile(fileSystem.path.join(dir.path, 'deferred_components_loading_units.yaml'), deferredComponentsGolden);
final String? golden = deferredComponentsGolden;
if (golden != null) {
writeFile(fileSystem.path.join(dir.path, 'deferred_components_loading_units.yaml'), golden);
}
if (androidSettings != null) {
writeFile(fileSystem.path.join(dir.path, 'android', 'settings.gradle'), androidSettings);
......
......@@ -2,13 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart';
import 'package:file/local.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:meta/meta.dart';
import 'package:process/process.dart';
import 'package:vm_service/vm_service.dart';
......@@ -91,18 +88,18 @@ List<String> getLocalEngineArguments() {
}
Future<void> pollForServiceExtensionValue<T>({
@required FlutterTestDriver testDriver,
@required String extension,
@required T continuePollingValue,
@required Matcher matches,
required FlutterTestDriver testDriver,
required String extension,
required T continuePollingValue,
required Matcher matches,
String valueKey = 'value',
}) async {
for (int i = 0; i < 10; i++) {
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));
} else {
expect(response.json[valueKey] as T, matches);
expect(response.json?[valueKey] as T, matches);
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