Remove deprecated WaitUntil[NoTransientCallbacks, NoPendingFrame, FirstFrameRasterized] methods from flutter_driver (#73754)
This commit is contained in:
parent
a9b937479e
commit
aed4518569
@ -703,7 +703,9 @@ mixin WidgetsBinding on BindingBase, ServicesBinding, SchedulerBinding, GestureB
|
|||||||
|
|
||||||
/// Whether the Flutter engine has rasterized the first frame.
|
/// 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:
|
/// 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
|
/// A future that completes when the Flutter engine has rasterized the first
|
||||||
/// frame.
|
/// 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:
|
/// See also:
|
||||||
///
|
///
|
||||||
|
@ -57,9 +57,9 @@ mixin DeserializeCommandFactory {
|
|||||||
case 'waitFor': return WaitFor.deserialize(params, finderFactory);
|
case 'waitFor': return WaitFor.deserialize(params, finderFactory);
|
||||||
case 'waitForAbsent': return WaitForAbsent.deserialize(params, finderFactory);
|
case 'waitForAbsent': return WaitForAbsent.deserialize(params, finderFactory);
|
||||||
case 'waitForCondition': return WaitForCondition.deserialize(params);
|
case 'waitForCondition': return WaitForCondition.deserialize(params);
|
||||||
case 'waitUntilNoTransientCallbacks': return WaitUntilNoTransientCallbacks.deserialize(params);
|
case 'waitUntilNoTransientCallbacks': return WaitForCondition.deserialize(params);
|
||||||
case 'waitUntilNoPendingFrame': return WaitUntilNoPendingFrame.deserialize(params);
|
case 'waitUntilNoPendingFrame': return WaitForCondition.deserialize(params);
|
||||||
case 'waitUntilFirstFrameRasterized': return WaitUntilFirstFrameRasterized.deserialize(params);
|
case 'waitUntilFirstFrameRasterized': return WaitForCondition.deserialize(params);
|
||||||
case 'get_semantics_id': return GetSemanticsId.deserialize(params, finderFactory);
|
case 'get_semantics_id': return GetSemanticsId.deserialize(params, finderFactory);
|
||||||
case 'get_offset': return GetOffset.deserialize(params, finderFactory);
|
case 'get_offset': return GetOffset.deserialize(params, finderFactory);
|
||||||
case 'get_diagnostics_tree': return GetDiagnosticsTree.deserialize(params, finderFactory);
|
case 'get_diagnostics_tree': return GetDiagnosticsTree.deserialize(params, finderFactory);
|
||||||
|
@ -36,88 +36,6 @@ class WaitForCondition extends Command {
|
|||||||
bool get requiresRootWidgetAttached => condition.requiresRootWidgetAttached;
|
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<String, String> 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<String, String> 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<String, String> json)
|
|
||||||
: super.deserialize(json);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get kind => 'waitUntilFirstFrameRasterized';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Thrown to indicate a serialization error.
|
/// Thrown to indicate a serialization error.
|
||||||
class SerializationException implements Exception {
|
class SerializationException implements Exception {
|
||||||
/// Creates a [SerializationException] with an optional error message.
|
/// Creates a [SerializationException] with an optional error message.
|
||||||
|
@ -48,7 +48,7 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('returns immediately when transient callback queue is empty', (WidgetTester tester) async {
|
testWidgets('returns immediately when transient callback queue is empty', (WidgetTester tester) async {
|
||||||
driverExtension.call(const WaitUntilNoTransientCallbacks().serialize())
|
driverExtension.call(const WaitForCondition(NoTransientCallbacks()).serialize())
|
||||||
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
||||||
result = r;
|
result = r;
|
||||||
}));
|
}));
|
||||||
@ -68,7 +68,7 @@ void main() {
|
|||||||
// Intentionally blank. We only care about existence of a callback.
|
// Intentionally blank. We only care about existence of a callback.
|
||||||
});
|
});
|
||||||
|
|
||||||
driverExtension.call(const WaitUntilNoTransientCallbacks().serialize())
|
driverExtension.call(const WaitForCondition(NoTransientCallbacks()).serialize())
|
||||||
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
||||||
result = r;
|
result = r;
|
||||||
}));
|
}));
|
||||||
@ -1137,7 +1137,7 @@ void main() {
|
|||||||
|
|
||||||
testWidgets('returns immediately when frame is synced', (
|
testWidgets('returns immediately when frame is synced', (
|
||||||
WidgetTester tester) async {
|
WidgetTester tester) async {
|
||||||
driverExtension.call(const WaitUntilNoPendingFrame().serialize())
|
driverExtension.call(const WaitForCondition(NoPendingFrame()).serialize())
|
||||||
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
||||||
result = r;
|
result = r;
|
||||||
}));
|
}));
|
||||||
@ -1158,7 +1158,7 @@ void main() {
|
|||||||
// Intentionally blank. We only care about existence of a callback.
|
// Intentionally blank. We only care about existence of a callback.
|
||||||
});
|
});
|
||||||
|
|
||||||
driverExtension.call(const WaitUntilNoPendingFrame().serialize())
|
driverExtension.call(const WaitForCondition(NoPendingFrame()).serialize())
|
||||||
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
||||||
result = r;
|
result = r;
|
||||||
}));
|
}));
|
||||||
@ -1182,7 +1182,7 @@ void main() {
|
|||||||
'waits until no pending scheduled frame', (WidgetTester tester) async {
|
'waits until no pending scheduled frame', (WidgetTester tester) async {
|
||||||
SchedulerBinding.instance.scheduleFrame();
|
SchedulerBinding.instance.scheduleFrame();
|
||||||
|
|
||||||
driverExtension.call(const WaitUntilNoPendingFrame().serialize())
|
driverExtension.call(const WaitForCondition(NoPendingFrame()).serialize())
|
||||||
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
.then<void>(expectAsync1((Map<String, dynamic> r) {
|
||||||
result = r;
|
result = r;
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user