Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
073126fd
Unverified
Commit
073126fd
authored
May 13, 2020
by
Jia Hao
Committed by
GitHub
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow waitUntilFirstFrameRasterized without a root widget (#56430)
parent
e88ef6d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
wait.dart
packages/flutter_driver/lib/src/common/wait.dart
+20
-0
wait_test.dart
packages/flutter_driver/test/src/real_tests/wait_test.dart
+15
-0
No files found.
packages/flutter_driver/lib/src/common/wait.dart
View file @
073126fd
...
...
@@ -31,6 +31,9 @@ class WaitForCondition extends Command {
@override
String
get
kind
=>
'waitForCondition'
;
@override
bool
get
requiresRootWidgetAttached
=>
condition
.
requiresRootWidgetAttached
;
}
/// A Flutter Driver command that waits until there are no more transient callbacks in the queue.
...
...
@@ -148,6 +151,20 @@ abstract class SerializableWaitCondition {
'conditionName'
:
conditionName
};
}
/// Whether this command requires the widget tree to be initialized before
/// the command may be run.
///
/// This defaults to true to force the application under test to call [runApp]
/// before attempting to remotely drive the application. Subclasses may
/// override this to return false if they allow invocation before the
/// application has started.
///
/// See also:
///
/// * [WidgetsBinding.isRootWidgetAttached], which indicates whether the
/// widget tree has been initialized.
bool
get
requiresRootWidgetAttached
=>
true
;
}
/// A condition that waits until no transient callbacks are scheduled.
...
...
@@ -208,6 +225,9 @@ class FirstFrameRasterized extends SerializableWaitCondition {
@override
String
get
conditionName
=>
'FirstFrameRasterizedCondition'
;
@override
bool
get
requiresRootWidgetAttached
=>
false
;
}
/// A condition that waits until there are no pending platform messages.
...
...
packages/flutter_driver/test/src/real_tests/wait_test.dart
View file @
073126fd
...
...
@@ -41,6 +41,17 @@ void main() {
expect
(
waitForCondition
.
condition
,
equals
(
const
NoTransientCallbacks
()));
expect
(
waitForCondition
.
timeout
,
equals
(
const
Duration
(
milliseconds:
10
)));
});
test
(
'WaitForCondition requiresRootWidget'
,
()
{
expect
(
const
WaitForCondition
(
NoTransientCallbacks
())
.
requiresRootWidgetAttached
,
isTrue
);
expect
(
const
WaitForCondition
(
FirstFrameRasterized
())
.
requiresRootWidgetAttached
,
isFalse
);
});
});
group
(
'NoTransientCallbacksCondition'
,
()
{
...
...
@@ -113,6 +124,10 @@ void main() {
throwsA
(
predicate
<
SerializationException
>((
SerializationException
e
)
=>
e
.
message
==
'Error occurred during deserializing the FirstFrameRasterizedCondition JSON string: {conditionName: Unknown}'
)));
});
test
(
'FirstFrameRasterizedCondition requiresRootWidget'
,
()
{
expect
(
const
FirstFrameRasterized
().
requiresRootWidgetAttached
,
isFalse
);
});
});
group
(
'CombinedCondition'
,
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment