Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
MBulli
2023-10-11 20:09:09 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
652a7cc12d38f99e8731a906bf6520224bcbbd7d
652a7cc1
1 parent
db30f063
Fixed scan_window_test.dart formatting
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
15 deletions
test/scan_window_test.dart
test/scan_window_test.dart
View file @
652a7cc
...
...
@@ -19,38 +19,50 @@ void main() {
);
test
(
'wl tp: BoxFit.none'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
none
,
const
Rect
.
fromLTRB
(
0.275
,
0.4
,
0.725
,
0.6
));
ctx
.
testScanWindow
(
BoxFit
.
none
,
const
Rect
.
fromLTRB
(
0.275
,
0.4
,
0.725
,
0.6
));
});
test
(
'wl tp: BoxFit.fill'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
fill
,
const
Rect
.
fromLTRB
(
0.25
,
0.25
,
0.75
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
fill
,
const
Rect
.
fromLTRB
(
0.25
,
0.25
,
0.75
,
0.75
));
});
test
(
'wl tp: BoxFit.fitHeight'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
fitHeight
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
fitHeight
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
});
test
(
'wl tp: BoxFit.fitWidth'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
fitWidth
,
const
Rect
.
fromLTRB
(
0.25
,
0.38888888888888895
,
0.75
,
0.6111111111111112
));
ctx
.
testScanWindow
(
BoxFit
.
fitWidth
,
const
Rect
.
fromLTRB
(
0.25
,
0.38888888888888895
,
0.75
,
0.6111111111111112
));
});
test
(
'wl tp: BoxFit.cover'
,
()
{
// equal to fitWidth
ctx
.
testScanWindow
(
BoxFit
.
cover
,
const
Rect
.
fromLTRB
(
0.25
,
0.38888888888888895
,
0.75
,
0.6111111111111112
));
ctx
.
testScanWindow
(
BoxFit
.
cover
,
const
Rect
.
fromLTRB
(
0.25
,
0.38888888888888895
,
0.75
,
0.6111111111111112
));
});
test
(
'wl tp: BoxFit.contain'
,
()
{
// equal to fitHeigth
ctx
.
testScanWindow
(
BoxFit
.
contain
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
contain
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
});
test
(
'wl tp: BoxFit.scaleDown'
,
()
{
// equal to fitHeigth, contain
ctx
.
testScanWindow
(
BoxFit
.
scaleDown
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
scaleDown
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
});
});
group
(
'Widget (landscape) smaller than texture and texture (landscape)'
,
()
{
group
(
'Widget (landscape) smaller than texture and texture (landscape)'
,
()
{
const
textureSize
=
Size
(
640.0
,
480.0
);
const
widgetSize
=
Size
(
320.0
,
120.0
);
final
ctx
=
ScanWindowTestContext
(
...
...
@@ -65,34 +77,41 @@ void main() {
);
test
(
'wl tl: BoxFit.none'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
none
,
const
Rect
.
fromLTRB
(
0.375
,
0.4375
,
0.625
,
0.5625
));
ctx
.
testScanWindow
(
BoxFit
.
none
,
const
Rect
.
fromLTRB
(
0.375
,
0.4375
,
0.625
,
0.5625
));
});
test
(
'wl tl: BoxFit.fill'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
fill
,
const
Rect
.
fromLTRB
(
0.25
,
0.25
,
0.75
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
fill
,
const
Rect
.
fromLTRB
(
0.25
,
0.25
,
0.75
,
0.75
));
});
test
(
'wl tl: BoxFit.fitHeight'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
fitHeight
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
fitHeight
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
});
test
(
'wl tl: BoxFit.fitWidth'
,
()
{
ctx
.
testScanWindow
(
BoxFit
.
fitWidth
,
const
Rect
.
fromLTRB
(
0.25
,
0.375
,
0.75
,
0.625
));
ctx
.
testScanWindow
(
BoxFit
.
fitWidth
,
const
Rect
.
fromLTRB
(
0.25
,
0.375
,
0.75
,
0.625
));
});
test
(
'wl tl: BoxFit.cover'
,
()
{
// equal to fitWidth
ctx
.
testScanWindow
(
BoxFit
.
cover
,
const
Rect
.
fromLTRB
(
0.25
,
0.375
,
0.75
,
0.625
));
ctx
.
testScanWindow
(
BoxFit
.
cover
,
const
Rect
.
fromLTRB
(
0.25
,
0.375
,
0.75
,
0.625
));
});
test
(
'wl tl: BoxFit.contain'
,
()
{
// equal to fitHeigth
ctx
.
testScanWindow
(
BoxFit
.
contain
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
contain
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
});
test
(
'wl tl: BoxFit.scaleDown'
,
()
{
// equal to fitHeigth, contain
ctx
.
testScanWindow
(
BoxFit
.
scaleDown
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
ctx
.
testScanWindow
(
BoxFit
.
scaleDown
,
const
Rect
.
fromLTRB
(
0.0
,
0.25
,
1.0
,
0.75
));
});
});
});
...
...
Please
register
or
login
to post a comment