diff --git a/packages/flutter/lib/src/widgets/binding.dart b/packages/flutter/lib/src/widgets/binding.dart index 2ed61f99b3..0b9af414de 100644 --- a/packages/flutter/lib/src/widgets/binding.dart +++ b/packages/flutter/lib/src/widgets/binding.dart @@ -703,7 +703,9 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB /// Whether the Flutter engine has rasterized the first frame. /// - /// {@macro flutter.flutter_driver.WaitUntilFirstFrameRasterized} + /// Usually, the time that a frame is rasterized is very close to the time that + /// it gets presented on the display. Specifically, rasterization is the last + /// expensive phase of a frame that's still in Flutter's control. /// /// See also: /// @@ -714,7 +716,9 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB /// A future that completes when the Flutter engine has rasterized the first /// frame. /// - /// {@macro flutter.flutter_driver.WaitUntilFirstFrameRasterized} + /// Usually, the time that a frame is rasterized is very close to the time that + /// it gets presented on the display. Specifically, rasterization is the last + /// expensive phase of a frame that's still in Flutter's control. /// /// See also: /// diff --git a/packages/flutter_driver/lib/src/common/deserialization_factory.dart b/packages/flutter_driver/lib/src/common/deserialization_factory.dart index b2e8b95822..215b0edaa3 100644 --- a/packages/flutter_driver/lib/src/common/deserialization_factory.dart +++ b/packages/flutter_driver/lib/src/common/deserialization_factory.dart @@ -57,9 +57,9 @@ mixin DeserializeCommandFactory { case 'waitFor': return WaitFor.deserialize(params, finderFactory); case 'waitForAbsent': return WaitForAbsent.deserialize(params, finderFactory); case 'waitForCondition': return WaitForCondition.deserialize(params); - case 'waitUntilNoTransientCallbacks': return WaitUntilNoTransientCallbacks.deserialize(params); - case 'waitUntilNoPendingFrame': return WaitUntilNoPendingFrame.deserialize(params); - case 'waitUntilFirstFrameRasterized': return WaitUntilFirstFrameRasterized.deserialize(params); + case 'waitUntilNoTransientCallbacks': return WaitForCondition.deserialize(params); + case 'waitUntilNoPendingFrame': return WaitForCondition.deserialize(params); + case 'waitUntilFirstFrameRasterized': return WaitForCondition.deserialize(params); case 'get_semantics_id': return GetSemanticsId.deserialize(params, finderFactory); case 'get_offset': return GetOffset.deserialize(params, finderFactory); case 'get_diagnostics_tree': return GetDiagnosticsTree.deserialize(params, finderFactory); diff --git a/packages/flutter_driver/lib/src/common/wait.dart b/packages/flutter_driver/lib/src/common/wait.dart index 4e9791ce41..4eec32c8e8 100644 --- a/packages/flutter_driver/lib/src/common/wait.dart +++ b/packages/flutter_driver/lib/src/common/wait.dart @@ -36,88 +36,6 @@ class WaitForCondition extends Command { bool get requiresRootWidgetAttached => condition.requiresRootWidgetAttached; } -/// A Flutter Driver command that waits until there are no more transient callbacks in the queue. -/// -/// This command has been deprecated in favor of [WaitForCondition]. Construct -/// a command that waits until no transient callbacks as follows: -/// -/// ```dart -/// WaitForCondition noTransientCallbacks = WaitForCondition(NoTransientCallbacks()); -/// ``` -@Deprecated( - 'This command has been deprecated in favor of WaitForCondition. ' - 'Use WaitForCondition command with NoTransientCallbacks. ' - 'This feature was deprecated after v1.9.3.' -) -class WaitUntilNoTransientCallbacks extends Command { - /// Creates a command that waits for there to be no transient callbacks. - const WaitUntilNoTransientCallbacks({ Duration? timeout }) : super(timeout: timeout); - - /// Deserializes this command from the value generated by [serialize]. - WaitUntilNoTransientCallbacks.deserialize(Map json) - : super.deserialize(json); - - @override - String get kind => 'waitUntilNoTransientCallbacks'; -} - -/// A Flutter Driver command that waits until the frame is synced. -/// -/// This command has been deprecated in favor of [WaitForCondition]. Construct -/// a command that waits until no pending frame as follows: -/// -/// ```dart -/// WaitForCondition noPendingFrame = WaitForCondition(NoPendingFrame()); -/// ``` -@Deprecated( - 'This command has been deprecated in favor of WaitForCondition. ' - 'Use WaitForCondition command with NoPendingFrame. ' - 'This feature was deprecated after v1.9.3.' -) -class WaitUntilNoPendingFrame extends Command { - /// Creates a command that waits until there's no pending frame scheduled. - const WaitUntilNoPendingFrame({ Duration? timeout }) : super(timeout: timeout); - - /// Deserializes this command from the value generated by [serialize]. - WaitUntilNoPendingFrame.deserialize(Map json) - : super.deserialize(json); - - @override - String get kind => 'waitUntilNoPendingFrame'; -} - -/// A Flutter Driver command that waits until the Flutter engine rasterizes the -/// first frame. -/// -/// {@template flutter.flutter_driver.WaitUntilFirstFrameRasterized} -/// Usually, the time that a frame is rasterized is very close to the time that -/// it gets presented on the display. Specifically, rasterization is the last -/// expensive phase of a frame that's still in Flutter's control. -/// {@endtemplate} -/// -/// This command has been deprecated in favor of [WaitForCondition]. Construct -/// a command that waits until no pending frame as follows: -/// -/// ```dart -/// WaitForCondition firstFrameRasterized = WaitForCondition(FirstFrameRasterized()); -/// ``` -@Deprecated( - 'This command has been deprecated in favor of WaitForCondition. ' - 'Use WaitForCondition command with FirstFrameRasterized. ' - 'This feature was deprecated after v1.9.3.' -) -class WaitUntilFirstFrameRasterized extends Command { - /// Creates this command. - const WaitUntilFirstFrameRasterized({ Duration? timeout }) : super(timeout: timeout); - - /// Deserializes this command from the value generated by [serialize]. - WaitUntilFirstFrameRasterized.deserialize(Map json) - : super.deserialize(json); - - @override - String get kind => 'waitUntilFirstFrameRasterized'; -} - /// Thrown to indicate a serialization error. class SerializationException implements Exception { /// Creates a [SerializationException] with an optional error message. diff --git a/packages/flutter_driver/test/src/real_tests/extension_test.dart b/packages/flutter_driver/test/src/real_tests/extension_test.dart index 8b75fb0894..b26b7b484a 100644 --- a/packages/flutter_driver/test/src/real_tests/extension_test.dart +++ b/packages/flutter_driver/test/src/real_tests/extension_test.dart @@ -48,7 +48,7 @@ void main() { }); testWidgets('returns immediately when transient callback queue is empty', (WidgetTester tester) async { - driverExtension.call(const WaitUntilNoTransientCallbacks().serialize()) + driverExtension.call(const WaitForCondition(NoTransientCallbacks()).serialize()) .then(expectAsync1((Map r) { result = r; })); @@ -68,7 +68,7 @@ void main() { // Intentionally blank. We only care about existence of a callback. }); - driverExtension.call(const WaitUntilNoTransientCallbacks().serialize()) + driverExtension.call(const WaitForCondition(NoTransientCallbacks()).serialize()) .then(expectAsync1((Map r) { result = r; })); @@ -1137,7 +1137,7 @@ void main() { testWidgets('returns immediately when frame is synced', ( WidgetTester tester) async { - driverExtension.call(const WaitUntilNoPendingFrame().serialize()) + driverExtension.call(const WaitForCondition(NoPendingFrame()).serialize()) .then(expectAsync1((Map r) { result = r; })); @@ -1158,7 +1158,7 @@ void main() { // Intentionally blank. We only care about existence of a callback. }); - driverExtension.call(const WaitUntilNoPendingFrame().serialize()) + driverExtension.call(const WaitForCondition(NoPendingFrame()).serialize()) .then(expectAsync1((Map r) { result = r; })); @@ -1182,7 +1182,7 @@ void main() { 'waits until no pending scheduled frame', (WidgetTester tester) async { SchedulerBinding.instance.scheduleFrame(); - driverExtension.call(const WaitUntilNoPendingFrame().serialize()) + driverExtension.call(const WaitForCondition(NoPendingFrame()).serialize()) .then(expectAsync1((Map r) { result = r; }));