Skip to content

Commit 9e024fd

Browse files
authored
Tiny fix inaccurate documentations about bindings (#140282)
The old doc says that, AutomatedTestWidgetsFlutterBinding for `flutter test` and LiveTestWidgetsFlutterBinding for `flutter run`. However, suppose we `flutter test integration_test/simple_test.dart` with the following code: ``` void main() { testWidgets('hi', (WidgetTester tester) async { print('hi ${TestWidgetsFlutterBinding.instance} ${Platform.operatingSystem}'); }); } ``` We will see: `hi <IntegrationTestWidgetsFlutterBinding> ios`. Therefore, we see `IntegrationTestWidgetsFlutterBinding` is used in a `flutter test` command, which is contrary to the documentation.
1 parent d4707d1 commit 9e024fd

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

packages/flutter_test/lib/src/binding.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,8 +1181,11 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
11811181
}
11821182
}
11831183

1184-
/// A variant of [TestWidgetsFlutterBinding] for executing tests in
1185-
/// the `flutter test` environment.
1184+
/// A variant of [TestWidgetsFlutterBinding] for executing tests typically
1185+
/// the `flutter test` environment, unless it is an integration test.
1186+
///
1187+
/// When doing integration test, [LiveTestWidgetsFlutterBinding] is utilized
1188+
/// instead.
11861189
///
11871190
/// This binding controls time, allowing tests to verify long
11881191
/// animation sequences without having to execute them in real time.
@@ -1632,9 +1635,9 @@ enum LiveTestWidgetsFlutterBindingFramePolicy {
16321635
benchmarkLive,
16331636
}
16341637

1635-
/// A variant of [TestWidgetsFlutterBinding] for executing tests in
1636-
/// the `flutter run` environment, on a device. This is intended to
1637-
/// allow interactive test development.
1638+
/// A variant of [TestWidgetsFlutterBinding] for executing tests
1639+
/// on a device, typically via `flutter run`, or via integration tests.
1640+
/// This is intended to allow interactive test development.
16381641
///
16391642
/// This is not the way to run a remote-control test. To run a test on
16401643
/// a device from a development computer, see the [flutter_driver]

0 commit comments

Comments
 (0)