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
4fa0e0d4
Unverified
Commit
4fa0e0d4
authored
Jan 29, 2022
by
Danny Tuppeny
Committed by
GitHub
Jan 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make DAP tests more tolerant of output that didn't come from the app being tested (#97291)
Fixes #97238.
parent
daf6465c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
flutter_adapter_test.dart
...integration.shard/debug_adapter/flutter_adapter_test.dart
+9
-10
test_client.dart
...ols/test/integration.shard/debug_adapter/test_client.dart
+5
-0
No files found.
packages/flutter_tools/test/integration.shard/debug_adapter/flutter_adapter_test.dart
View file @
4fa0e0d4
...
...
@@ -40,8 +40,8 @@ void main() {
// Once the "topLevelFunction" output arrives, we can terminate the app.
unawaited
(
dap
.
client
.
output
Events
.
firstWhere
((
OutputEventBody
output
)
=>
output
.
output
.
startsWith
(
'topLevelFunction'
))
dap
.
client
.
output
.
firstWhere
((
String
output
)
=>
output
.
startsWith
(
'topLevelFunction'
))
.
whenComplete
(()
=>
dap
.
client
.
terminate
()),
);
...
...
@@ -70,8 +70,8 @@ void main() {
// Once the "topLevelFunction" output arrives, we can terminate the app.
unawaited
(
dap
.
client
.
outputEvents
.
firstWhere
((
OutputEventBody
output
)
=>
output
.
output
.
startsWith
(
'topLevelFunction'
))
dap
.
client
.
stdoutOutput
.
firstWhere
((
String
output
)
=>
output
.
startsWith
(
'topLevelFunction'
))
.
whenComplete
(()
=>
dap
.
client
.
terminate
()),
);
...
...
@@ -118,7 +118,7 @@ void main() {
// Launch the app and wait for it to print "topLevelFunction".
await
Future
.
wait
(<
Future
<
void
>>[
dap
.
client
.
outputEvents
.
firstWhere
((
OutputEventBody
output
)
=>
output
.
output
.
startsWith
(
'topLevelFunction'
)),
dap
.
client
.
stdoutOutput
.
firstWhere
((
String
output
)
=>
output
.
startsWith
(
'topLevelFunction'
)),
dap
.
client
.
start
(
launch:
()
=>
dap
.
client
.
launch
(
cwd:
project
.
dir
.
path
,
...
...
@@ -130,7 +130,7 @@ void main() {
// Capture the next two output events that we expect to be the Reload
// notification and then topLevelFunction being printed again.
final
Future
<
List
<
String
>>
outputEventsFuture
=
dap
.
client
.
o
utput
final
Future
<
List
<
String
>>
outputEventsFuture
=
dap
.
client
.
stdoutO
utput
// But skip any topLevelFunctions that come before the reload.
.
skipWhile
((
String
output
)
=>
output
.
startsWith
(
'topLevelFunction'
))
.
take
(
2
)
...
...
@@ -155,7 +155,7 @@ void main() {
// Launch the app and wait for it to print "topLevelFunction".
await
Future
.
wait
(<
Future
<
void
>>[
dap
.
client
.
outputEvents
.
firstWhere
((
OutputEventBody
output
)
=>
output
.
output
.
startsWith
(
'topLevelFunction'
)),
dap
.
client
.
stdoutOutput
.
firstWhere
((
String
output
)
=>
output
.
startsWith
(
'topLevelFunction'
)),
dap
.
client
.
start
(
launch:
()
=>
dap
.
client
.
launch
(
cwd:
project
.
dir
.
path
,
...
...
@@ -167,7 +167,7 @@ void main() {
// Capture the next two output events that we expect to be the Restart
// notification and then topLevelFunction being printed again.
final
Future
<
List
<
String
>>
outputEventsFuture
=
dap
.
client
.
o
utput
final
Future
<
List
<
String
>>
outputEventsFuture
=
dap
.
client
.
stdoutO
utput
// But skip any topLevelFunctions that come before the restart.
.
skipWhile
((
String
output
)
=>
output
.
startsWith
(
'topLevelFunction'
))
.
take
(
2
)
...
...
@@ -233,8 +233,7 @@ void main() {
// Launch the app and wait for it to print "topLevelFunction" so we know
// it's up and running.
await
Future
.
wait
(<
Future
<
void
>>[
dap
.
client
.
outputEvents
.
firstWhere
((
OutputEventBody
output
)
=>
output
.
output
.
startsWith
(
'topLevelFunction'
)),
dap
.
client
.
stdoutOutput
.
firstWhere
((
String
output
)
=>
output
.
startsWith
(
'topLevelFunction'
)),
dap
.
client
.
start
(
launch:
()
=>
dap
.
client
.
launch
(
cwd:
project
.
dir
.
path
,
...
...
packages/flutter_tools/test/integration.shard/debug_adapter/test_client.dart
View file @
4fa0e0d4
...
...
@@ -63,6 +63,11 @@ class DapTestClient {
/// Returns a stream of the string output from [OutputEventBody] events.
Stream
<
String
>
get
output
=>
outputEvents
.
map
((
OutputEventBody
output
)
=>
output
.
output
);
/// Returns a stream of the string output from [OutputEventBody] events with the category 'stdout'.
Stream
<
String
>
get
stdoutOutput
=>
outputEvents
.
where
((
OutputEventBody
output
)
=>
output
.
category
==
'stdout'
)
.
map
((
OutputEventBody
output
)
=>
output
.
output
);
/// Sends a custom request to the server and waits for a response.
Future
<
Response
>
custom
(
String
name
,
[
Object
?
args
])
async
{
return
sendRequest
(
args
,
overrideCommand:
name
);
...
...
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