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
7aa8c2ab
Unverified
Commit
7aa8c2ab
authored
Aug 31, 2020
by
Jonah Williams
Committed by
GitHub
Aug 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[null-safety] remove mockito from scrollbar test (#64493)
More work towards #62886
parent
15d18b9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
scrollbar_test.dart
packages/flutter/test/widgets/scrollbar_test.dart
+16
-4
No files found.
packages/flutter/test/widgets/scrollbar_test.dart
View file @
7aa8c2ab
...
...
@@ -7,7 +7,8 @@
import
'package:flutter/src/physics/utils.dart'
show
nearEqual
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:mockito/mockito.dart'
;
import
'../flutter_test_alternative.dart'
show
Fake
;
const
Color
_kScrollbarColor
=
Color
(
0xFF123456
);
const
double
_kThickness
=
2.5
;
...
...
@@ -39,14 +40,25 @@ ScrollbarPainter _buildPainter({
)..
update
(
scrollMetrics
,
scrollMetrics
.
axisDirection
);
}
class
_DrawRectOnceCanvas
extends
Mock
implements
Canvas
{
}
class
_DrawRectOnceCanvas
extends
Fake
implements
Canvas
{
List
<
Rect
>
rects
=
<
Rect
>[];
@override
void
drawRect
(
Rect
rect
,
Paint
paint
)
{
rects
.
add
(
rect
);
}
}
void
main
(
)
{
final
_DrawRectOnceCanvas
testCanvas
=
_DrawRectOnceCanvas
();
ScrollbarPainter
painter
;
Rect
captureRect
()
=>
verify
(
testCanvas
.
drawRect
(
captureAny
,
any
)).
captured
.
single
as
Rect
;
tearDown
(()
=>
painter
=
null
);
Rect
captureRect
()
=>
testCanvas
.
rects
.
removeLast
();
tearDown
(()
{
painter
=
null
;
testCanvas
.
rects
.
clear
();
});
final
ScrollMetrics
defaultMetrics
=
FixedScrollMetrics
(
minScrollExtent:
0
,
...
...
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