Update our deprecation style. (#44618)

This commit is contained in:
Ian Hickson
2019-11-15 19:21:53 -08:00
committed by GitHub
parent 879da263ff
commit 62e4ab87b3
27 changed files with 363 additions and 53 deletions

View File

@@ -41,8 +41,11 @@ class WaitForCondition extends Command {
/// ```dart
/// WaitForCondition noTransientCallbacks = WaitForCondition(NoTransientCallbacks());
/// ```
@Deprecated('This command has been deprecated in favor of WaitForCondition. '
'Use WaitForCondition command with 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);
@@ -63,8 +66,11 @@ class WaitUntilNoTransientCallbacks extends Command {
/// ```dart
/// WaitForCondition noPendingFrame = WaitForCondition(NoPendingFrame());
/// ```
@Deprecated('This command has been deprecated in favor of WaitForCondition. '
'Use WaitForCondition command with 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);
@@ -92,8 +98,11 @@ class WaitUntilNoPendingFrame extends Command {
/// ```dart
/// WaitForCondition firstFrameRasterized = WaitForCondition(FirstFrameRasterized());
/// ```
@Deprecated('This command has been deprecated in favor of WaitForCondition. '
'Use WaitForCondition command with 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);

View File

@@ -232,7 +232,10 @@ class FlutterDriverExtension {
}
// This can be used to wait for the first frame being rasterized during app launch.
@Deprecated('This method has been deprecated in favor of _waitForCondition.')
@Deprecated(
'This method has been deprecated in favor of _waitForCondition. '
'This feature was deprecated after v1.9.3.'
)
Future<Result> _waitUntilFirstFrameRasterized(Command command) async {
await WidgetsBinding.instance.waitUntilFirstFrameRasterized;
return null;
@@ -390,7 +393,10 @@ class FlutterDriverExtension {
return null;
}
@Deprecated('This method has been deprecated in favor of _waitForCondition.')
@Deprecated(
'This method has been deprecated in favor of _waitForCondition. '
'This feature was deprecated after v1.9.3.'
)
Future<Result> _waitUntilNoTransientCallbacks(Command command) async {
if (SchedulerBinding.instance.transientCallbackCount != 0)
await _waitUntilFrame(() => SchedulerBinding.instance.transientCallbackCount == 0);
@@ -416,7 +422,10 @@ class FlutterDriverExtension {
/// test author to use some other method to avoid flakiness.
///
/// This method has been deprecated in favor of [_waitForCondition].
@Deprecated('This method has been deprecated in favor of _waitForCondition.')
@Deprecated(
'This method has been deprecated in favor of _waitForCondition. '
'This feature was deprecated after v1.9.3.'
)
Future<Result> _waitUntilNoPendingFrame(Command command) async {
await _waitUntilFrame(() {
return SchedulerBinding.instance.transientCallbackCount == 0