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
5ce7282a
Unverified
Commit
5ce7282a
authored
Aug 03, 2020
by
Helin Shiah
Committed by
GitHub
Aug 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return devtools serve response instead of printing (#62702)
parent
52299fa3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
daemon.md
packages/flutter_tools/doc/daemon.md
+1
-1
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+3
-3
daemon_test.dart
...utter_tools/test/commands.shard/hermetic/daemon_test.dart
+4
-6
No files found.
packages/flutter_tools/doc/daemon.md
View file @
5ce7282a
...
...
@@ -256,7 +256,7 @@ The returned `params` will contain:
#### devtools.serve
The
`serve()`
command starts a DevTools server if one isn't already running and
prints out
the host and port of the server.
The
`serve()`
command starts a DevTools server if one isn't already running and
returns
the host and port of the server.
## 'flutter run --machine' and 'flutter attach --machine'
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
5ce7282a
...
...
@@ -896,14 +896,14 @@ class DevToolsDomain extends Domain {
DevtoolsLauncher
_devtoolsLauncher
;
Future
<
void
>
serve
([
Map
<
String
,
dynamic
>
args
])
async
{
Future
<
Map
<
String
,
dynamic
>
>
serve
([
Map
<
String
,
dynamic
>
args
])
async
{
_devtoolsLauncher
??=
DevtoolsLauncher
.
instance
;
final
HttpServer
server
=
await
_devtoolsLauncher
.
serve
();
sendEvent
(
'devtools.serve'
,
<
String
,
dynamic
>{
return
<
String
,
dynamic
>{
'host'
:
server
.
address
.
host
,
'port'
:
server
.
port
,
}
)
;
};
}
@override
...
...
packages/flutter_tools/test/commands.shard/hermetic/daemon_test.dart
View file @
5ce7282a
...
...
@@ -321,10 +321,10 @@ void main() {
when
(
mockDevToolsLauncher
.
serve
()).
thenAnswer
((
_
)
async
=>
mockDevToolsServer
);
commands
.
add
(<
String
,
dynamic
>{
'id'
:
0
,
'method'
:
'devtools.serve'
});
final
Map
<
String
,
dynamic
>
response
=
await
responses
.
stream
.
firstWhere
(
_isDevToolsEvent
);
expect
(
response
[
'
params
'
],
isNotEmpty
);
expect
(
response
[
'
params
'
][
'host'
],
equals
(
'127.0.0.1'
));
expect
(
response
[
'
params
'
][
'port'
],
equals
(
1234
));
final
Map
<
String
,
dynamic
>
response
=
await
responses
.
stream
.
firstWhere
(
(
Map
<
String
,
dynamic
>
response
)
=>
response
[
'id'
]
==
0
);
expect
(
response
[
'
result
'
],
isNotEmpty
);
expect
(
response
[
'
result
'
][
'host'
],
equals
(
'127.0.0.1'
));
expect
(
response
[
'
result
'
][
'port'
],
equals
(
1234
));
await
responses
.
close
();
await
commands
.
close
();
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -466,8 +466,6 @@ bool _notEvent(Map<String, dynamic> map) => map['event'] == null;
bool
_isConnectedEvent
(
Map
<
String
,
dynamic
>
map
)
=>
map
[
'event'
]
==
'daemon.connected'
;
bool
_isDevToolsEvent
(
Map
<
String
,
dynamic
>
map
)
=>
map
[
'event'
]
==
'devtools.serve'
;
class
MockFuchsiaWorkflow
extends
FuchsiaWorkflow
{
MockFuchsiaWorkflow
({
this
.
canListDevices
=
true
});
...
...
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