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
a341da6e
Unverified
Commit
a341da6e
authored
Feb 24, 2021
by
Jia Hao
Committed by
GitHub
Feb 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Don't stringify null values in EventPrinter (#76579)
parent
2d0fa57c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
8 deletions
+41
-8
event_printer.dart
packages/flutter_tools/lib/src/test/event_printer.dart
+1
-1
event_printer_test.dart
...ter_tools/test/general.shard/test/event_printer_test.dart
+40
-7
No files found.
packages/flutter_tools/lib/src/test/event_printer.dart
View file @
a341da6e
...
...
@@ -22,7 +22,7 @@ class EventPrinter extends TestWatcher {
@override
void
handleStartedDevice
(
Uri
observatoryUri
)
{
_sendEvent
(
'test.startedProcess'
,
<
String
,
dynamic
>{
'observatoryUri'
:
observatoryUri
.
toString
()});
<
String
,
dynamic
>{
'observatoryUri'
:
observatoryUri
?
.
toString
()});
_parent
?.
handleStartedDevice
(
observatoryUri
);
}
...
...
packages/flutter_tools/test/general.shard/test/event_printer_test.dart
View file @
a341da6e
...
...
@@ -11,15 +11,48 @@ import 'package:mockito/mockito.dart';
import
'../../src/common.dart'
;
void
main
(
)
{
testWithoutContext
(
'EventPrinter handles a null parent'
,
()
{
final
EventPrinter
eventPrinter
=
EventPrinter
(
out:
StringBuffer
());
final
_Device
device
=
_Device
();
group
(
EventPrinter
,
()
{
final
Uri
observatoryUri
=
Uri
.
parse
(
'http://localhost:1234'
);
EventPrinter
eventPrinter
;
StringBuffer
output
;
expect
(()
=>
eventPrinter
.
handleFinishedTest
(
device
),
returnsNormally
);
expect
(()
=>
eventPrinter
.
handleStartedDevice
(
observatoryUri
),
returnsNormally
);
expect
(()
=>
eventPrinter
.
handleTestCrashed
(
device
),
returnsNormally
);
expect
(()
=>
eventPrinter
.
handleTestTimedOut
(
device
),
returnsNormally
);
setUp
(()
{
output
=
StringBuffer
();
eventPrinter
=
EventPrinter
(
out:
output
);
});
testWithoutContext
(
'handles a null parent'
,
()
{
final
_Device
device
=
_Device
();
expect
(()
=>
eventPrinter
.
handleFinishedTest
(
device
),
returnsNormally
);
expect
(()
=>
eventPrinter
.
handleStartedDevice
(
observatoryUri
),
returnsNormally
);
expect
(()
=>
eventPrinter
.
handleTestCrashed
(
device
),
returnsNormally
);
expect
(()
=>
eventPrinter
.
handleTestTimedOut
(
device
),
returnsNormally
);
});
group
(
'handleStartedDevice'
,
()
{
testWithoutContext
(
'with non-null observatory'
,
()
{
eventPrinter
.
handleStartedDevice
(
observatoryUri
);
expect
(
output
.
toString
(),
'
\n
'
'[{"event":"test.startedProcess","params":{"observatoryUri":"http://localhost:1234"}}]'
'
\n
'
,
);
});
testWithoutContext
(
'with null observatory'
,
()
{
eventPrinter
.
handleStartedDevice
(
null
);
expect
(
output
.
toString
(),
'
\n
'
'[{"event":"test.startedProcess","params":{"observatoryUri":null}}]'
'
\n
'
,
);
});
});
});
}
...
...
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