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
31fd0f75
Unverified
Commit
31fd0f75
authored
Aug 03, 2021
by
Nguyen Phuc Loi
Committed by
GitHub
Aug 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_driver] Remove `runUnsynchronized` in `VMServiceFlutterDriver` (#87467)
parent
52bf9dbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
12 deletions
+34
-12
vmservice_driver.dart
packages/flutter_driver/lib/src/driver/vmservice_driver.dart
+0
-12
flutter_driver_test.dart
...utter_driver/test/src/real_tests/flutter_driver_test.dart
+34
-0
No files found.
packages/flutter_driver/lib/src/driver/vmservice_driver.dart
View file @
31fd0f75
...
...
@@ -485,18 +485,6 @@ class VMServiceFlutterDriver extends FlutterDriver {
}
}
@override
Future
<
T
>
runUnsynchronized
<
T
>(
Future
<
T
>
Function
()
action
,
{
Duration
?
timeout
})
async
{
await
sendCommand
(
SetFrameSync
(
false
,
timeout:
timeout
));
T
result
;
try
{
result
=
await
action
();
}
finally
{
await
sendCommand
(
SetFrameSync
(
true
,
timeout:
timeout
));
}
return
result
;
}
@override
Future
<
void
>
forceGC
()
async
{
try
{
...
...
packages/flutter_driver/test/src/real_tests/flutter_driver_test.dart
View file @
31fd0f75
...
...
@@ -666,6 +666,23 @@ void main() {
test
(
'VMServiceFlutterDriver does not support webDriver'
,
()
async
{
expect
(()
=>
driver
.
webDriver
,
throwsUnsupportedError
);
});
group
(
'runUnsynchronized'
,
()
{
test
(
'wrap waitFor with runUnsynchronized'
,
()
async
{
fakeClient
.
responses
[
'waitFor'
]
=
makeFakeResponse
(<
String
,
dynamic
>{});
fakeClient
.
responses
[
'set_frame_sync'
]
=
makeFakeResponse
(<
String
,
dynamic
>{});
await
driver
.
runUnsynchronized
(()
async
{
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
_kTestTimeout
);
});
expect
(
fakeClient
.
commandLog
,
<
String
>[
'ext.flutter.driver {command: set_frame_sync, enabled: false}'
,
'ext.flutter.driver {command: waitFor, timeout:
$_kSerializedTestTimeout
, finderType: ByTooltipMessage, text: foo}'
,
'ext.flutter.driver {command: set_frame_sync, enabled: true}'
]);
});
});
});
group
(
'VMServiceFlutterDriver with custom timeout'
,
()
{
...
...
@@ -965,6 +982,23 @@ void main() {
expect
(()
=>
driver
.
serviceClient
.
getVM
(),
throwsUnsupportedError
);
});
});
group
(
'runUnsynchronized'
,
()
{
test
(
'wrap waitFor with runUnsynchronized'
,
()
async
{
fakeConnection
.
responses
[
'waitFor'
]
=
jsonEncode
(
makeFakeResponse
(<
String
,
dynamic
>{
'text'
:
'hello'
}));
fakeConnection
.
responses
[
'set_frame_sync'
]
=
jsonEncode
(
makeFakeResponse
(<
String
,
dynamic
>{}));
await
driver
.
runUnsynchronized
(()
async
{
await
driver
.
waitFor
(
find
.
byTooltip
(
'foo'
),
timeout:
_kTestTimeout
);
});
expect
(
fakeConnection
.
commandLog
,
<
String
>[
r''
'window.
$flutterDriver
('
{
"command"
:
"set_frame_sync"
,
"enabled"
:
"false"
}
') null'''
,
r''
'window.
$flutterDriver
('
{
"command"
:
"waitFor"
,
"timeout"
:
"1234"
,
"finderType"
:
"ByTooltipMessage"
,
"text"
:
"foo"
}
') 0:00:01.234000'''
,
r''
'window.
$flutterDriver
('
{
"command"
:
"set_frame_sync"
,
"enabled"
:
"true"
}
') null'''
,
]);
});
});
});
group
(
'WebFlutterDriver with non-chrome browser'
,
()
{
...
...
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