E2E test setting and using isolate names (#23388)
Adds an integration devicelab test that runs an Android app with two custom named isolates. Tests that the isolate names are present and that it's possible to attach to just one of the isolates. Fixes flutter/flutter#22009
This commit is contained in:
committed by
GitHub
parent
b63ced55b4
commit
93573de216
23
dev/integration_tests/named_isolates/lib/main.dart
Normal file
23
dev/integration_tests/named_isolates/lib/main.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// named_isolates_test depends on these values.
|
||||
const String _kFirstIsolateName = 'first isolate name';
|
||||
const String _kSecondIsolateName = 'second isolate name';
|
||||
|
||||
void first() {
|
||||
_run(_kFirstIsolateName);
|
||||
}
|
||||
|
||||
void second() {
|
||||
_run(_kSecondIsolateName);
|
||||
}
|
||||
|
||||
void _run(String name) {
|
||||
ui.window.setIsolateDebugName(name);
|
||||
runApp(Center(child: Text(name, textDirection: TextDirection.ltr)));
|
||||
}
|
||||
|
||||
// `first` and `second` are the actual entrypoints to this app, but dart specs
|
||||
// require a main function.
|
||||
void main() { }
|
||||
Reference in New Issue
Block a user