Dispose FocusNode in tests. (#146161)
This commit is contained in:
parent
972725332f
commit
96a491ceef
@ -890,10 +890,13 @@ void main() {
|
|||||||
'This will be the start of a new line. When triple clicking this block '
|
'This will be the start of a new line. When triple clicking this block '
|
||||||
'of text all of it should be selected.';
|
'of text all of it should be selected.';
|
||||||
|
|
||||||
|
final FocusNode focusNode = FocusNode();
|
||||||
|
addTearDown(focusNode.dispose);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: SelectableRegion(
|
home: SelectableRegion(
|
||||||
focusNode: FocusNode(),
|
focusNode: focusNode,
|
||||||
selectionControls: materialTextSelectionControls,
|
selectionControls: materialTextSelectionControls,
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text(longText),
|
child: Text(longText),
|
||||||
@ -962,10 +965,13 @@ void main() {
|
|||||||
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
||||||
|
|
||||||
testWidgets('mouse can select multiple widgets on triple click drag when selecting inside a WidgetSpan', (WidgetTester tester) async {
|
testWidgets('mouse can select multiple widgets on triple click drag when selecting inside a WidgetSpan', (WidgetTester tester) async {
|
||||||
|
final FocusNode focusNode = FocusNode();
|
||||||
|
addTearDown(focusNode.dispose);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: SelectableRegion(
|
home: SelectableRegion(
|
||||||
focusNode: FocusNode(),
|
focusNode: focusNode,
|
||||||
selectionControls: materialTextSelectionControls,
|
selectionControls: materialTextSelectionControls,
|
||||||
child: const Text.rich(
|
child: const Text.rich(
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
@ -1015,10 +1021,13 @@ void main() {
|
|||||||
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
||||||
|
|
||||||
testWidgets('mouse can select multiple widgets on triple click drag', (WidgetTester tester) async {
|
testWidgets('mouse can select multiple widgets on triple click drag', (WidgetTester tester) async {
|
||||||
|
final FocusNode focusNode = FocusNode();
|
||||||
|
addTearDown(focusNode.dispose);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: SelectableRegion(
|
home: SelectableRegion(
|
||||||
focusNode: FocusNode(),
|
focusNode: focusNode,
|
||||||
selectionControls: materialTextSelectionControls,
|
selectionControls: materialTextSelectionControls,
|
||||||
child: const Column(
|
child: const Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -1078,10 +1087,13 @@ void main() {
|
|||||||
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
||||||
|
|
||||||
testWidgets('mouse can select multiple widgets on triple click drag and return to origin paragraph', (WidgetTester tester) async {
|
testWidgets('mouse can select multiple widgets on triple click drag and return to origin paragraph', (WidgetTester tester) async {
|
||||||
|
final FocusNode focusNode = FocusNode();
|
||||||
|
addTearDown(focusNode.dispose);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: SelectableRegion(
|
home: SelectableRegion(
|
||||||
focusNode: FocusNode(),
|
focusNode: focusNode,
|
||||||
selectionControls: materialTextSelectionControls,
|
selectionControls: materialTextSelectionControls,
|
||||||
child: const Column(
|
child: const Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -1151,10 +1163,13 @@ void main() {
|
|||||||
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
}, skip: kIsWeb); // https://github.com/flutter/flutter/issues/125582.
|
||||||
|
|
||||||
testWidgets('mouse can reverse selection across multiple widgets on triple click drag', (WidgetTester tester) async {
|
testWidgets('mouse can reverse selection across multiple widgets on triple click drag', (WidgetTester tester) async {
|
||||||
|
final FocusNode focusNode = FocusNode();
|
||||||
|
addTearDown(focusNode.dispose);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MaterialApp(
|
MaterialApp(
|
||||||
home: SelectableRegion(
|
home: SelectableRegion(
|
||||||
focusNode: FocusNode(),
|
focusNode: focusNode,
|
||||||
selectionControls: materialTextSelectionControls,
|
selectionControls: materialTextSelectionControls,
|
||||||
child: const Column(
|
child: const Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user