Migrate some dev/ things to null-safety (#74861)
This commit is contained in:
parent
2e7ab87a4d
commit
15703fb93b
@ -1,7 +1,7 @@
|
||||
name: missing_dependency_tests
|
||||
|
||||
environment:
|
||||
sdk: ">=2.0.0-dev.68.0 <3.0.0"
|
||||
sdk: ">=2.12.0-0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
@ -2,7 +2,7 @@ name: tracing_tests
|
||||
description: Various tests for tracing in flutter/flutter
|
||||
|
||||
environment:
|
||||
sdk: ">=2.2.2 <3.0.0"
|
||||
sdk: ">=2.12.0-0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
|
@ -12,7 +12,7 @@ import 'package:vm_service/vm_service_io.dart';
|
||||
// for "Dart", "Embedder", and "GC" recorded from startup.
|
||||
|
||||
void main() {
|
||||
VmService vmService;
|
||||
late VmService vmService;
|
||||
|
||||
setUpAll(() async {
|
||||
final developer.ServiceProtocolInfo info = await developer.Service.getInfo();
|
||||
@ -22,7 +22,7 @@ void main() {
|
||||
}
|
||||
|
||||
vmService = await vmServiceConnectUri(
|
||||
'ws://localhost:${info.serverUri.port}${info.serverUri.path}ws',
|
||||
'ws://localhost:${info.serverUri!.port}${info.serverUri!.path}ws',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -12,8 +12,8 @@ import 'package:vm_service/vm_service.dart';
|
||||
import 'package:vm_service/vm_service_io.dart';
|
||||
|
||||
void main() {
|
||||
VmService vmService;
|
||||
String isolateId;
|
||||
late VmService vmService;
|
||||
late String isolateId;
|
||||
setUpAll(() async {
|
||||
final developer.ServiceProtocolInfo info = await developer.Service.getInfo();
|
||||
|
||||
@ -21,9 +21,9 @@ void main() {
|
||||
fail('This test _must_ be run with --enable-vmservice.');
|
||||
}
|
||||
|
||||
vmService = await vmServiceConnectUri('ws://localhost:${info.serverUri.port}${info.serverUri.path}ws');
|
||||
vmService = await vmServiceConnectUri('ws://localhost:${info.serverUri!.port}${info.serverUri!.path}ws');
|
||||
await vmService.setVMTimelineFlags(<String>['Dart']);
|
||||
isolateId = developer.Service.getIsolateID(isolate.Isolate.current);
|
||||
isolateId = developer.Service.getIsolateID(isolate.Isolate.current)!;
|
||||
|
||||
// Initialize the image cache.
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
@ -32,22 +32,22 @@ void main() {
|
||||
test('Image cache tracing', () async {
|
||||
final TestImageStreamCompleter completer1 = TestImageStreamCompleter();
|
||||
final TestImageStreamCompleter completer2 = TestImageStreamCompleter();
|
||||
PaintingBinding.instance.imageCache.putIfAbsent(
|
||||
PaintingBinding.instance!.imageCache!.putIfAbsent(
|
||||
'Test',
|
||||
() => completer1,
|
||||
);
|
||||
PaintingBinding.instance.imageCache.clear();
|
||||
PaintingBinding.instance!.imageCache!.clear();
|
||||
|
||||
completer2.testSetImage(ImageInfo(image: await createTestImage()));
|
||||
PaintingBinding.instance.imageCache.putIfAbsent(
|
||||
PaintingBinding.instance!.imageCache!.putIfAbsent(
|
||||
'Test2',
|
||||
() => completer2,
|
||||
);
|
||||
PaintingBinding.instance.imageCache.evict('Test2');
|
||||
PaintingBinding.instance!.imageCache!.evict('Test2');
|
||||
|
||||
final Timeline timeline = await vmService.getVMTimeline();
|
||||
_expectTimelineEvents(
|
||||
timeline.traceEvents,
|
||||
timeline.traceEvents!,
|
||||
<Map<String, dynamic>>[
|
||||
<String, dynamic>{
|
||||
'name': 'ImageCache.putIfAbsent',
|
||||
@ -83,9 +83,9 @@ void main() {
|
||||
void _expectTimelineEvents(List<TimelineEvent> events, List<Map<String, dynamic>> expected) {
|
||||
for (final TimelineEvent event in events) {
|
||||
for (int index = 0; index < expected.length; index += 1) {
|
||||
if (expected[index]['name'] == event.json['name']) {
|
||||
if (expected[index]['name'] == event.json!['name']) {
|
||||
final Map<String, dynamic> expectedArgs = expected[index]['args'] as Map<String, dynamic>;
|
||||
final Map<String, dynamic> args = event.json['args'] as Map<String, dynamic>;
|
||||
final Map<String, dynamic> args = event.json!['args'] as Map<String, dynamic>;
|
||||
if (_mapsEqual(expectedArgs, args)) {
|
||||
expected.removeAt(index);
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ import 'package:vm_service/vm_service.dart';
|
||||
import 'package:vm_service/vm_service_io.dart';
|
||||
|
||||
void main() {
|
||||
VmService vmService;
|
||||
LiveTestWidgetsFlutterBinding binding;
|
||||
late VmService vmService;
|
||||
late LiveTestWidgetsFlutterBinding binding;
|
||||
setUpAll(() async {
|
||||
final developer.ServiceProtocolInfo info =
|
||||
await developer.Service.getInfo();
|
||||
@ -24,7 +24,7 @@ void main() {
|
||||
fail('This test _must_ be run with --enable-vmservice.');
|
||||
}
|
||||
|
||||
vmService = await vmServiceConnectUri('ws://localhost:${info.serverUri.port}${info.serverUri.path}ws');
|
||||
vmService = await vmServiceConnectUri('ws://localhost:${info.serverUri!.port}${info.serverUri!.path}ws');
|
||||
await vmService.streamListen(EventStreams.kExtension);
|
||||
|
||||
// Initialize bindings
|
||||
@ -72,7 +72,7 @@ void main() {
|
||||
final Event event = await completer.future;
|
||||
expect(event.extensionKind, 'Flutter.ImageSizesForFrame');
|
||||
expect(
|
||||
jsonEncode(event.extensionData.data),
|
||||
jsonEncode(event.extensionData!.data),
|
||||
'{"test.png":{"source":"test.png","displaySize":{"width":200.0,"height":100.0},"imageSize":{"width":300.0,"height":300.0},"displaySizeInBytes":106666,"decodedSizeInBytes":480000}}',
|
||||
);
|
||||
}, skip: isBrowser); // uses dart:isolate and io
|
||||
@ -101,7 +101,7 @@ void main() {
|
||||
final Event event = await completer.future;
|
||||
expect(event.extensionKind, 'Flutter.ImageSizesForFrame');
|
||||
expect(
|
||||
jsonEncode(event.extensionData.data),
|
||||
jsonEncode(event.extensionData!.data),
|
||||
'{"test.png":{"source":"test.png","displaySize":{"width":300.0,"height":300.0},"imageSize":{"width":300.0,"height":300.0},"displaySizeInBytes":480000,"decodedSizeInBytes":480000}}',
|
||||
);
|
||||
}, skip: isBrowser); // uses dart:isolate and io
|
||||
|
Loading…
x
Reference in New Issue
Block a user