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
417449e2
Unverified
Commit
417449e2
authored
Oct 30, 2019
by
Jonah Williams
Committed by
GitHub
Oct 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deflake flutter tool logger test (#43800)
parent
e0094eee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+4
-4
logger_test.dart
...es/flutter_tools/test/general.shard/base/logger_test.dart
+7
-0
No files found.
packages/flutter_tools/lib/src/base/logger.dart
View file @
417449e2
...
...
@@ -359,12 +359,12 @@ class BufferLogger extends Logger {
class
VerboseLogger
extends
Logger
{
VerboseLogger
(
this
.
parent
)
:
assert
(
terminal
!=
null
)
{
stopwatch
.
start
();
_
stopwatch
.
start
();
}
final
Logger
parent
;
Stopwatch
stopwatch
=
Stopwatch
();
final
Stopwatch
_stopwatch
=
context
.
get
<
Stopwatch
>()
??
Stopwatch
();
@override
bool
get
isVerbose
=>
true
;
...
...
@@ -438,8 +438,8 @@ class VerboseLogger extends Logger {
return
;
}
final
int
millis
=
stopwatch
.
elapsedMilliseconds
;
stopwatch
.
reset
();
final
int
millis
=
_
stopwatch
.
elapsedMilliseconds
;
_
stopwatch
.
reset
();
String
prefix
;
const
int
prefixWidth
=
8
;
...
...
packages/flutter_tools/test/general.shard/base/logger_test.dart
View file @
417449e2
...
...
@@ -24,6 +24,11 @@ void main() {
final
String
resetColor
=
RegExp
.
escape
(
AnsiTerminal
.
resetColor
);
group
(
'AppContext'
,
()
{
FakeStopwatch
fakeStopWatch
;
setUp
(()
{
fakeStopWatch
=
FakeStopwatch
();
});
testUsingContext
(
'error'
,
()
async
{
final
BufferLogger
mockLogger
=
BufferLogger
();
final
VerboseLogger
verboseLogger
=
VerboseLogger
(
mockLogger
);
...
...
@@ -39,6 +44,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
OutputPreferences:
()
=>
OutputPreferences
(
showColor:
false
),
Platform:
_kNoAnsiPlatform
,
Stopwatch:
()
=>
fakeStopWatch
,
});
testUsingContext
(
'ANSI colored errors'
,
()
async
{
...
...
@@ -60,6 +66,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
OutputPreferences:
()
=>
OutputPreferences
(
showColor:
true
),
Platform:
()
=>
FakePlatform
()..
stdoutSupportsAnsi
=
true
,
Stopwatch:
()
=>
fakeStopWatch
,
});
});
...
...
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