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
896e5b33
Unverified
Commit
896e5b33
authored
May 03, 2022
by
fzyzcjy
Committed by
GitHub
May 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Test-only) Add tests for new `ImageFilter.dilate`/`ImageFilter.erode` in flutter engine (#101036)
parent
b4f8d7c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
image_filter_test.dart
packages/flutter/test/widgets/image_filter_test.dart
+32
-0
No files found.
packages/flutter/test/widgets/image_filter_test.dart
View file @
896e5b33
...
...
@@ -9,6 +9,7 @@
import
'dart:typed_data'
;
import
'dart:ui'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
@@ -29,6 +30,37 @@ void main() {
);
});
testWidgets
(
'Image filter - dilate'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
child:
ImageFiltered
(
imageFilter:
ImageFilter
.
dilate
(
radiusX:
10.0
,
radiusY:
10.0
),
child:
const
Placeholder
(),
),
),
);
await
expectLater
(
find
.
byType
(
ImageFiltered
),
matchesGoldenFile
(
'image_filter_dilate.png'
),
);
},
skip:
kIsWeb
);
// https://github.com/flutter/flutter/issues/101874
testWidgets
(
'Image filter - erode'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
child:
ImageFiltered
(
// Do not erode too much, otherwise we will see nothing left.
imageFilter:
ImageFilter
.
erode
(
radiusX:
1.0
,
radiusY:
1.0
),
child:
const
Placeholder
(
strokeWidth:
4
),
),
),
);
await
expectLater
(
find
.
byType
(
ImageFiltered
),
matchesGoldenFile
(
'image_filter_erode.png'
),
);
},
skip:
kIsWeb
);
// https://github.com/flutter/flutter/issues/101874
testWidgets
(
'Image filter - matrix'
,
(
WidgetTester
tester
)
async
{
final
ImageFilter
matrix
=
ImageFilter
.
matrix
(
Float64List
.
fromList
(<
double
>[
0.5
,
0.0
,
0.0
,
0.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