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
27bdb110
Unverified
Commit
27bdb110
authored
May 29, 2019
by
Mehmet Fidanboylu
Committed by
GitHub
May 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose service client and app isolate in driver (#33431)
parent
0c517aec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
driver.dart
packages/flutter_driver/lib/src/driver/driver.dart
+18
-9
No files found.
packages/flutter_driver/lib/src/driver/driver.dart
View file @
27bdb110
...
...
@@ -122,12 +122,12 @@ typedef EvaluatorFunction = dynamic Function();
/// Drives a Flutter Application running in another process.
class
FlutterDriver
{
/// Creates a driver that uses a connection provided by the given
/// [
_serviceClient], [_peer] and [_
appIsolate].
/// [
serviceClient], [_peer] and [
appIsolate].
@visibleForTesting
FlutterDriver
.
connectedTo
(
this
.
_
serviceClient
,
this
.
serviceClient
,
this
.
_peer
,
this
.
_
appIsolate
,
{
this
.
appIsolate
,
{
bool
printCommunication
=
false
,
bool
logCommunicationToFile
=
true
,
})
:
_printCommunication
=
printCommunication
,
...
...
@@ -383,13 +383,22 @@ class FlutterDriver {
final
int
_driverId
;
/// Client connected to the Dart VM running the Flutter application
final
VMServiceClient
_serviceClient
;
///
/// You can use [VMServiceClient] to check VM version, flags and get
/// notified when a new isolate has been instantiated. That could be
/// useful if your application spawns multiple isolates that you
/// would like to instrument.
final
VMServiceClient
serviceClient
;
/// JSON-RPC client useful for sending raw JSON requests.
final
rpc
.
Peer
_peer
;
/// The main isolate hosting the Flutter application
final
VMIsolate
_appIsolate
;
/// The main isolate hosting the Flutter application.
///
/// If you used the [registerExtension] API to instrument your application,
/// you can use this [VMIsolate] to call these extension methods via
/// [invokeExtension].
final
VMIsolate
appIsolate
;
/// Whether to print communication between host and app to `stdout`.
final
bool
_printCommunication
;
...
...
@@ -402,7 +411,7 @@ class FlutterDriver {
try
{
final
Map
<
String
,
String
>
serialized
=
command
.
serialize
();
_logCommunication
(
'>>>
$serialized
'
);
final
Future
<
Map
<
String
,
dynamic
>>
future
=
_
appIsolate
.
invokeExtension
(
final
Future
<
Map
<
String
,
dynamic
>>
future
=
appIsolate
.
invokeExtension
(
_flutterExtensionMethodName
,
serialized
,
).
then
<
Map
<
String
,
dynamic
>>((
Object
value
)
=>
value
);
...
...
@@ -905,7 +914,7 @@ class FlutterDriver {
try
{
await
_peer
.
sendRequest
(
_collectAllGarbageMethodName
,
<
String
,
String
>{
'isolateId'
:
'isolates/
${
_
appIsolate.numberAsString}
'
,
'isolateId'
:
'isolates/
${appIsolate.numberAsString}
'
,
});
}
catch
(
error
,
stackTrace
)
{
throw
DriverError
(
...
...
@@ -921,7 +930,7 @@ class FlutterDriver {
/// Returns a [Future] that fires once the connection has been closed.
Future
<
void
>
close
()
async
{
// Don't leak vm_service_client-specific objects, if any
await
_
serviceClient
.
close
();
await
serviceClient
.
close
();
await
_peer
.
close
();
}
}
...
...
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