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
e1e300bb
Unverified
Commit
e1e300bb
authored
May 06, 2020
by
Kate Lovett
Committed by
GitHub
May 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip Audit - Painting Library (#55793)
parent
ba6b3f50
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
51 additions
and
59 deletions
+51
-59
beveled_rectangle_border_test.dart
.../flutter/test/painting/beveled_rectangle_border_test.dart
+2
-2
border_rtl_test.dart
packages/flutter/test/painting/border_rtl_test.dart
+10
-10
circle_border_test.dart
packages/flutter/test/painting/circle_border_test.dart
+1
-1
continous_rectangle_border_test.dart
...lutter/test/painting/continous_rectangle_border_test.dart
+9
-14
gradient_test.dart
packages/flutter/test/painting/gradient_test.dart
+2
-2
image_provider_test.dart
packages/flutter/test/painting/image_provider_test.dart
+7
-7
image_resolution_test.dart
packages/flutter/test/painting/image_resolution_test.dart
+2
-2
notched_shapes_test.dart
packages/flutter/test/painting/notched_shapes_test.dart
+1
-1
rounded_rectangle_border_test.dart
.../flutter/test/painting/rounded_rectangle_border_test.dart
+1
-1
stadium_border_test.dart
packages/flutter/test/painting/stadium_border_test.dart
+1
-1
text_painter_rtl_test.dart
packages/flutter/test/painting/text_painter_rtl_test.dart
+1
-3
text_painter_test.dart
packages/flutter/test/painting/text_painter_test.dart
+11
-12
text_style_test.dart
packages/flutter/test/painting/text_style_test.dart
+3
-3
No files found.
packages/flutter/test/painting/beveled_rectangle_border_test.dart
View file @
e1e300bb
...
@@ -42,7 +42,7 @@ void main() {
...
@@ -42,7 +42,7 @@ void main() {
const
BorderSide
side
=
BorderSide
(
width:
4.0
);
const
BorderSide
side
=
BorderSide
(
width:
4.0
);
expect
(
const
BeveledRectangleBorder
(
side:
side
).
getOuterPath
(
rect1
),
looksLikeRect1
);
expect
(
const
BeveledRectangleBorder
(
side:
side
).
getOuterPath
(
rect1
),
looksLikeRect1
);
expect
(
const
BeveledRectangleBorder
(
side:
side
).
getInnerPath
(
rect1
),
looksLikeInnerPath
);
expect
(
const
BeveledRectangleBorder
(
side:
side
).
getInnerPath
(
rect1
),
looksLikeInnerPath
);
}
,
skip:
isBrowser
);
});
test
(
'BeveledRectangleBorder non-zero BorderRadius'
,
()
{
test
(
'BeveledRectangleBorder non-zero BorderRadius'
,
()
{
const
Rect
rect
=
Rect
.
fromLTRB
(
10.0
,
20.0
,
30.0
,
40.0
);
const
Rect
rect
=
Rect
.
fromLTRB
(
10.0
,
20.0
,
30.0
,
40.0
);
...
@@ -55,6 +55,6 @@ void main() {
...
@@ -55,6 +55,6 @@ void main() {
);
);
expect
(
border
.
getOuterPath
(
rect
),
looksLikeRect
);
expect
(
border
.
getOuterPath
(
rect
),
looksLikeRect
);
expect
(
border
.
getInnerPath
(
rect
),
looksLikeRect
);
expect
(
border
.
getInnerPath
(
rect
),
looksLikeRect
);
}
,
skip:
isBrowser
);
});
}
}
packages/flutter/test/painting/border_rtl_test.dart
View file @
e1e300bb
...
@@ -349,14 +349,14 @@ void main() {
...
@@ -349,14 +349,14 @@ void main() {
],
],
),
),
);
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional constructor'
,
()
{
test
(
'BorderDirectional constructor'
,
()
{
expect
(()
=>
BorderDirectional
(
top:
nonconst
(
null
)),
throwsAssertionError
);
expect
(()
=>
BorderDirectional
(
top:
nonconst
(
null
)),
throwsAssertionError
);
expect
(()
=>
BorderDirectional
(
start:
nonconst
(
null
)),
throwsAssertionError
);
expect
(()
=>
BorderDirectional
(
start:
nonconst
(
null
)),
throwsAssertionError
);
expect
(()
=>
BorderDirectional
(
end:
nonconst
(
null
)),
throwsAssertionError
);
expect
(()
=>
BorderDirectional
(
end:
nonconst
(
null
)),
throwsAssertionError
);
expect
(()
=>
BorderDirectional
(
bottom:
nonconst
(
null
)),
throwsAssertionError
);
expect
(()
=>
BorderDirectional
(
bottom:
nonconst
(
null
)),
throwsAssertionError
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional.merge'
,
()
{
test
(
'BorderDirectional.merge'
,
()
{
const
BorderSide
magenta3
=
BorderSide
(
color:
Color
(
0xFFFF00FF
),
width:
3.0
);
const
BorderSide
magenta3
=
BorderSide
(
color:
Color
(
0xFFFF00FF
),
width:
3.0
);
...
@@ -395,7 +395,7 @@ void main() {
...
@@ -395,7 +395,7 @@ void main() {
),
),
throwsAssertionError
,
throwsAssertionError
,
);
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional.dimensions'
,
()
{
test
(
'BorderDirectional.dimensions'
,
()
{
expect
(
expect
(
...
@@ -407,7 +407,7 @@ void main() {
...
@@ -407,7 +407,7 @@ void main() {
).
dimensions
,
).
dimensions
,
const
EdgeInsetsDirectional
.
fromSTEB
(
2.0
,
3.0
,
7.0
,
5.0
),
const
EdgeInsetsDirectional
.
fromSTEB
(
2.0
,
3.0
,
7.0
,
5.0
),
);
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional.isUniform'
,
()
{
test
(
'BorderDirectional.isUniform'
,
()
{
expect
(
expect
(
...
@@ -477,7 +477,7 @@ void main() {
...
@@ -477,7 +477,7 @@ void main() {
const
BorderDirectional
().
isUniform
,
const
BorderDirectional
().
isUniform
,
true
,
true
,
);
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional.add - all directional'
,
()
{
test
(
'BorderDirectional.add - all directional'
,
()
{
const
BorderSide
magenta3
=
BorderSide
(
color:
Color
(
0xFFFF00FF
),
width:
3.0
);
const
BorderSide
magenta3
=
BorderSide
(
color:
Color
(
0xFFFF00FF
),
width:
3.0
);
...
@@ -513,7 +513,7 @@ void main() {
...
@@ -513,7 +513,7 @@ void main() {
expect
(
bZ
+
bZ
,
bZ
);
expect
(
bZ
+
bZ
,
bZ
);
expect
(
b0
+
bZ
,
bZ
);
expect
(
b0
+
bZ
,
bZ
);
expect
(
bZ
+
b0
,
bZ
);
expect
(
bZ
+
b0
,
bZ
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional.add'
,
()
{
test
(
'BorderDirectional.add'
,
()
{
const
BorderSide
side1
=
BorderSide
(
color:
Color
(
0x11111111
));
const
BorderSide
side1
=
BorderSide
(
color:
Color
(
0x11111111
));
...
@@ -565,7 +565,7 @@ void main() {
...
@@ -565,7 +565,7 @@ void main() {
expect
((
borderDirectionalWithStart
+
borderWithoutSides
).
toString
(),
'
${const BorderDirectional(start: side1, top: doubleSide2, bottom: doubleSide2)}
'
);
expect
((
borderDirectionalWithStart
+
borderWithoutSides
).
toString
(),
'
${const BorderDirectional(start: side1, top: doubleSide2, bottom: doubleSide2)}
'
);
expect
((
borderDirectionalWithEnd
+
borderWithoutSides
).
toString
(),
'
${const BorderDirectional(end: side1, top: doubleSide2, bottom: doubleSide2)}
'
);
expect
((
borderDirectionalWithEnd
+
borderWithoutSides
).
toString
(),
'
${const BorderDirectional(end: side1, top: doubleSide2, bottom: doubleSide2)}
'
);
expect
((
borderDirectionalWithoutSides
+
borderWithoutSides
).
toString
(),
'
${const Border(top: doubleSide2, bottom: doubleSide2)}
'
);
expect
((
borderDirectionalWithoutSides
+
borderWithoutSides
).
toString
(),
'
${const Border(top: doubleSide2, bottom: doubleSide2)}
'
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional.scale'
,
()
{
test
(
'BorderDirectional.scale'
,
()
{
const
BorderSide
magenta3
=
BorderSide
(
color:
Color
(
0xFFFF00FF
),
width:
3.0
);
const
BorderSide
magenta3
=
BorderSide
(
color:
Color
(
0xFFFF00FF
),
width:
3.0
);
...
@@ -579,7 +579,7 @@ void main() {
...
@@ -579,7 +579,7 @@ void main() {
expect
(
bY0
.
scale
(
3.0
),
bY0
);
expect
(
bY0
.
scale
(
3.0
),
bY0
);
const
BorderDirectional
bY2
=
BorderDirectional
(
top:
yellow2
);
const
BorderDirectional
bY2
=
BorderDirectional
(
top:
yellow2
);
expect
(
bY2
.
scale
(
0.0
),
bY0
);
expect
(
bY2
.
scale
(
0.0
),
bY0
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional.lerp'
,
()
{
test
(
'BorderDirectional.lerp'
,
()
{
const
BorderDirectional
directionalWithTop10
=
BorderDirectional
(
top:
BorderSide
(
width:
10.0
));
const
BorderDirectional
directionalWithTop10
=
BorderDirectional
(
top:
BorderSide
(
width:
10.0
));
...
@@ -653,7 +653,7 @@ void main() {
...
@@ -653,7 +653,7 @@ void main() {
},
},
paintsAssertion
,
// no TextDirection
paintsAssertion
,
// no TextDirection
);
);
}
,
skip:
isBrowser
);
});
test
(
'BorderDirectional hashCode'
,
()
{
test
(
'BorderDirectional hashCode'
,
()
{
final
BorderSide
side
=
BorderSide
(
width:
nonconst
(
2.0
));
final
BorderSide
side
=
BorderSide
(
width:
nonconst
(
2.0
));
...
@@ -703,5 +703,5 @@ void main() {
...
@@ -703,5 +703,5 @@ void main() {
expect
(
decoration2
.
padding
,
const
EdgeInsetsDirectional
.
fromSTEB
(
2.0
,
0.0
,
0.0
,
0.0
));
expect
(
decoration2
.
padding
,
const
EdgeInsetsDirectional
.
fromSTEB
(
2.0
,
0.0
,
0.0
,
0.0
));
expect
(
decoration2
.
scale
(
2.0
),
decoration4
);
expect
(
decoration2
.
scale
(
2.0
),
decoration4
);
expect
(
BoxDecoration
.
lerp
(
decoration2
,
decoration6
,
0.5
),
decoration4
);
expect
(
BoxDecoration
.
lerp
(
decoration2
,
decoration6
,
0.5
),
decoration4
);
}
,
skip:
isBrowser
);
});
}
}
packages/flutter/test/painting/circle_border_test.dart
View file @
e1e300bb
...
@@ -26,5 +26,5 @@ void main() {
...
@@ -26,5 +26,5 @@ void main() {
paints
paints
..
circle
(
x:
25.0
,
y:
40.0
,
radius:
10.0
,
strokeWidth:
10.0
),
..
circle
(
x:
25.0
,
y:
40.0
,
radius:
10.0
,
strokeWidth:
10.0
),
);
);
}
,
skip:
isBrowser
);
});
}
}
packages/flutter/test/painting/continous_rectangle_border_test.dart
View file @
e1e300bb
...
@@ -42,7 +42,7 @@ void main() {
...
@@ -42,7 +42,7 @@ void main() {
const
BorderSide
side
=
BorderSide
(
width:
4.0
);
const
BorderSide
side
=
BorderSide
(
width:
4.0
);
expect
(
const
ContinuousRectangleBorder
(
side:
side
).
getOuterPath
(
rect1
),
looksLikeRect1
);
expect
(
const
ContinuousRectangleBorder
(
side:
side
).
getOuterPath
(
rect1
),
looksLikeRect1
);
expect
(
const
ContinuousRectangleBorder
(
side:
side
).
getInnerPath
(
rect1
),
looksLikeInnerPath
);
expect
(
const
ContinuousRectangleBorder
(
side:
side
).
getInnerPath
(
rect1
),
looksLikeInnerPath
);
}
,
skip:
isBrowser
);
});
test
(
'ContinuousRectangleBorder non-zero BorderRadius'
,
()
{
test
(
'ContinuousRectangleBorder non-zero BorderRadius'
,
()
{
const
Rect
rect
=
Rect
.
fromLTRB
(
10.0
,
20.0
,
30.0
,
40.0
);
const
Rect
rect
=
Rect
.
fromLTRB
(
10.0
,
20.0
,
30.0
,
40.0
);
...
@@ -55,7 +55,7 @@ void main() {
...
@@ -55,7 +55,7 @@ void main() {
);
);
expect
(
border
.
getOuterPath
(
rect
),
looksLikeRect
);
expect
(
border
.
getOuterPath
(
rect
),
looksLikeRect
);
expect
(
border
.
getInnerPath
(
rect
),
looksLikeRect
);
expect
(
border
.
getInnerPath
(
rect
),
looksLikeRect
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'Golden test even radii'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Golden test even radii'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
...
@@ -73,7 +73,7 @@ void main() {
...
@@ -73,7 +73,7 @@ void main() {
find
.
byType
(
RepaintBoundary
),
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_even_radii.png'
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_even_radii.png'
),
);
);
}
,
skip:
isBrowser
);
});
testWidgets
(
'Golden test varying radii'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Golden test varying radii'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
...
@@ -96,8 +96,7 @@ void main() {
...
@@ -96,8 +96,7 @@ void main() {
find
.
byType
(
RepaintBoundary
),
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_varying_radii.png'
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_varying_radii.png'
),
);
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
});
},
skip:
isBrowser
);
testWidgets
(
'Golden test topLeft radii'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Golden test topLeft radii'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
...
@@ -117,8 +116,7 @@ void main() {
...
@@ -117,8 +116,7 @@ void main() {
find
.
byType
(
RepaintBoundary
),
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_topLeft_radii.png'
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_topLeft_radii.png'
),
);
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
});
},
skip:
isBrowser
);
testWidgets
(
'Golden test topRight radii'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Golden test topRight radii'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
...
@@ -138,8 +136,7 @@ void main() {
...
@@ -138,8 +136,7 @@ void main() {
find
.
byType
(
RepaintBoundary
),
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_topRight_radii.png'
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_topRight_radii.png'
),
);
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
});
},
skip:
isBrowser
);
testWidgets
(
'Golden test bottomLeft radii'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Golden test bottomLeft radii'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
...
@@ -159,8 +156,7 @@ void main() {
...
@@ -159,8 +156,7 @@ void main() {
find
.
byType
(
RepaintBoundary
),
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_bottomLeft_radii.png'
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_bottomLeft_radii.png'
),
);
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
});
},
skip:
isBrowser
);
testWidgets
(
'Golden test bottomRight radii'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Golden test bottomRight radii'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
...
@@ -180,8 +176,7 @@ void main() {
...
@@ -180,8 +176,7 @@ void main() {
find
.
byType
(
RepaintBoundary
),
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_bottomRight_radii.png'
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_bottomRight_radii.png'
),
);
);
// TODO(Piinks): Remove skip once web goldens are supported, https://github.com/flutter/flutter/issues/40297
});
},
skip:
isBrowser
);
testWidgets
(
'Golden test large radii'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Golden test large radii'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
RepaintBoundary
(
await
tester
.
pumpWidget
(
RepaintBoundary
(
...
@@ -199,6 +194,6 @@ void main() {
...
@@ -199,6 +194,6 @@ void main() {
find
.
byType
(
RepaintBoundary
),
find
.
byType
(
RepaintBoundary
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_large_radii.png'
),
matchesGoldenFile
(
'continuous_rectangle_border.golden_test_large_radii.png'
),
);
);
}
,
skip:
isBrowser
);
});
}
}
packages/flutter/test/painting/gradient_test.dart
View file @
e1e300bb
...
@@ -817,7 +817,7 @@ void main() {
...
@@ -817,7 +817,7 @@ void main() {
for
(
final
Gradient
gradient
in
gradients45
)
{
for
(
final
Gradient
gradient
in
gradients45
)
{
testWidgets
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
await
runTest
(
tester
,
gradient
,
45
);
await
runTest
(
tester
,
gradient
,
45
);
},
skip:
isBrowser
);
//
TODO(yjbanov): web does not support golden tests yet: https://github.com/flutter/flutter/issues/40297
},
skip:
isBrowser
);
//
https://github.com/flutter/flutter/issues/41389
}
}
});
});
...
@@ -825,7 +825,7 @@ void main() {
...
@@ -825,7 +825,7 @@ void main() {
for
(
final
Gradient
gradient
in
gradients90
)
{
for
(
final
Gradient
gradient
in
gradients90
)
{
testWidgets
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'
$gradient
'
,
(
WidgetTester
tester
)
async
{
await
runTest
(
tester
,
gradient
,
90
);
await
runTest
(
tester
,
gradient
,
90
);
},
skip:
isBrowser
);
//
TODO(yjbanov): web does not support golden tests yet: https://github.com/flutter/flutter/issues/40297
},
skip:
isBrowser
);
//
https://github.com/flutter/flutter/issues/41389
}
}
});
});
});
});
...
...
packages/flutter/test/painting/image_provider_test.dart
View file @
e1e300bb
...
@@ -65,7 +65,7 @@ void main() {
...
@@ -65,7 +65,7 @@ void main() {
expect
(
imageCache
.
statusForKey
(
provider
).
untracked
,
true
);
expect
(
imageCache
.
statusForKey
(
provider
).
untracked
,
true
);
expect
(
imageCache
.
pendingImageCount
,
0
);
expect
(
imageCache
.
pendingImageCount
,
0
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56314
test
(
'AssetImageProvider - evicts on null load'
,
()
async
{
test
(
'AssetImageProvider - evicts on null load'
,
()
async
{
final
Completer
<
StateError
>
error
=
Completer
<
StateError
>();
final
Completer
<
StateError
>
error
=
Completer
<
StateError
>();
...
@@ -87,7 +87,7 @@ void main() {
...
@@ -87,7 +87,7 @@ void main() {
expect
(
imageCache
.
statusForKey
(
provider
).
untracked
,
true
);
expect
(
imageCache
.
statusForKey
(
provider
).
untracked
,
true
);
expect
(
imageCache
.
pendingImageCount
,
0
);
expect
(
imageCache
.
pendingImageCount
,
0
);
}
,
skip:
isBrowser
);
});
test
(
'ImageProvider can evict images'
,
()
async
{
test
(
'ImageProvider can evict images'
,
()
async
{
final
Uint8List
bytes
=
Uint8List
.
fromList
(
kTransparentImage
);
final
Uint8List
bytes
=
Uint8List
.
fromList
(
kTransparentImage
);
...
@@ -286,7 +286,7 @@ void main() {
...
@@ -286,7 +286,7 @@ void main() {
.
having
((
NetworkImageLoadException
e
)
=>
e
.
statusCode
,
'statusCode'
,
errorStatusCode
)
.
having
((
NetworkImageLoadException
e
)
=>
e
.
statusCode
,
'statusCode'
,
errorStatusCode
)
.
having
((
NetworkImageLoadException
e
)
=>
e
.
uri
,
'uri'
,
Uri
.
base
.
resolve
(
requestUrl
)),
.
having
((
NetworkImageLoadException
e
)
=>
e
.
uri
,
'uri'
,
Uri
.
base
.
resolve
(
requestUrl
)),
);
);
},
skip:
isBrowser
);
// Browser implementation does not use HTTP client but a <img> tag.
},
skip:
isBrowser
);
// Browser implementation does not use HTTP client but a
n
<img> tag.
test
(
'Disallows null urls'
,
()
{
test
(
'Disallows null urls'
,
()
{
expect
(()
{
expect
(()
{
...
@@ -317,7 +317,7 @@ void main() {
...
@@ -317,7 +317,7 @@ void main() {
debugNetworkImageHttpClientProvider
=
()
=>
client2
;
debugNetworkImageHttpClientProvider
=
()
=>
client2
;
await
loadNetworkImage
();
await
loadNetworkImage
();
expect
(
capturedErrors
,
<
dynamic
>[
'client1'
,
'client2'
]);
expect
(
capturedErrors
,
<
dynamic
>[
'client1'
,
'client2'
]);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// Browser implementation does not use HTTP client but an <img> tag.
test
(
'Propagates http client errors during resolve()'
,
()
async
{
test
(
'Propagates http client errors during resolve()'
,
()
async
{
when
(
httpClient
.
getUrl
(
any
)).
thenThrow
(
Error
());
when
(
httpClient
.
getUrl
(
any
)).
thenThrow
(
Error
());
...
@@ -395,7 +395,7 @@ void main() {
...
@@ -395,7 +395,7 @@ void main() {
expect
(
events
[
i
].
cumulativeBytesLoaded
,
math
.
min
((
i
+
1
)
*
chunkSize
,
kTransparentImage
.
length
));
expect
(
events
[
i
].
cumulativeBytesLoaded
,
math
.
min
((
i
+
1
)
*
chunkSize
,
kTransparentImage
.
length
));
expect
(
events
[
i
].
expectedTotalBytes
,
kTransparentImage
.
length
);
expect
(
events
[
i
].
expectedTotalBytes
,
kTransparentImage
.
length
);
}
}
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56317
test
(
'NetworkImage is evicted from cache on SocketException'
,
()
async
{
test
(
'NetworkImage is evicted from cache on SocketException'
,
()
async
{
final
MockHttpClient
mockHttpClient
=
MockHttpClient
();
final
MockHttpClient
mockHttpClient
=
MockHttpClient
();
...
@@ -443,7 +443,7 @@ void main() {
...
@@ -443,7 +443,7 @@ void main() {
const
ImageConfiguration
resizeConfig
=
ImageConfiguration
(
size:
resizeDims
);
const
ImageConfiguration
resizeConfig
=
ImageConfiguration
(
size:
resizeDims
);
final
Size
resizedImageSize
=
await
_resolveAndGetSize
(
resizedImage
,
configuration:
resizeConfig
);
final
Size
resizedImageSize
=
await
_resolveAndGetSize
(
resizedImage
,
configuration:
resizeConfig
);
expect
(
resizedImageSize
,
resizeDims
);
expect
(
resizedImageSize
,
resizeDims
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56312
test
(
'ResizeImage does not resize when no size is passed'
,
()
async
{
test
(
'ResizeImage does not resize when no size is passed'
,
()
async
{
final
Uint8List
bytes
=
Uint8List
.
fromList
(
kTransparentImage
);
final
Uint8List
bytes
=
Uint8List
.
fromList
(
kTransparentImage
);
...
@@ -456,7 +456,7 @@ void main() {
...
@@ -456,7 +456,7 @@ void main() {
final
MemoryImage
resizedImage
=
MemoryImage
(
bytes
);
final
MemoryImage
resizedImage
=
MemoryImage
(
bytes
);
final
Size
resizedImageSize
=
await
_resolveAndGetSize
(
resizedImage
);
final
Size
resizedImageSize
=
await
_resolveAndGetSize
(
resizedImage
);
expect
(
resizedImageSize
,
const
Size
(
1
,
1
));
expect
(
resizedImageSize
,
const
Size
(
1
,
1
));
}
,
skip:
isBrowser
);
});
test
(
'ResizeImage stores values'
,
()
async
{
test
(
'ResizeImage stores values'
,
()
async
{
final
Uint8List
bytes
=
Uint8List
.
fromList
(
kTransparentImage
);
final
Uint8List
bytes
=
Uint8List
.
fromList
(
kTransparentImage
);
...
...
packages/flutter/test/painting/image_resolution_test.dart
View file @
e1e300bb
...
@@ -145,7 +145,7 @@ void main() {
...
@@ -145,7 +145,7 @@ void main() {
expect
(
bundleKey
.
scale
,
1.0
);
expect
(
bundleKey
.
scale
,
1.0
);
}));
}));
});
});
}
,
skip:
isBrowser
);
});
group
(
'Regression - When assets available are 1.0 and 3.0 check devices with a range of scales'
,
()
{
group
(
'Regression - When assets available are 1.0 and 3.0 check devices with a range of scales'
,
()
{
const
String
mainAssetPath
=
'assets/normalFolder/normalFile.png'
;
const
String
mainAssetPath
=
'assets/normalFolder/normalFile.png'
;
...
@@ -201,6 +201,6 @@ void main() {
...
@@ -201,6 +201,6 @@ void main() {
test
(
'Typical case 4.0'
,
()
{
test
(
'Typical case 4.0'
,
()
{
_buildBundleAndTestVariantLogic
(
4.0
,
3.0
,
variantPath
);
_buildBundleAndTestVariantLogic
(
4.0
,
3.0
,
variantPath
);
});
});
}
,
skip:
isBrowser
);
});
}
}
packages/flutter/test/painting/notched_shapes_test.dart
View file @
e1e300bb
...
@@ -81,7 +81,7 @@ void main() {
...
@@ -81,7 +81,7 @@ void main() {
sampleSize:
100
,
sampleSize:
100
,
),
),
);
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/44572
test
(
'AutomaticNotchedShape - no guest'
,
()
{
test
(
'AutomaticNotchedShape - no guest'
,
()
{
expect
(
expect
(
...
...
packages/flutter/test/painting/rounded_rectangle_border_test.dart
View file @
e1e300bb
...
@@ -91,5 +91,5 @@ void main() {
...
@@ -91,5 +91,5 @@ void main() {
expect
(
direct50
,
indirect50
);
expect
(
direct50
,
indirect50
);
expect
(
direct50
.
hashCode
,
indirect50
.
hashCode
);
expect
(
direct50
.
hashCode
,
indirect50
.
hashCode
);
expect
(
direct50
.
toString
(),
indirect50
.
toString
());
expect
(
direct50
.
toString
(),
indirect50
.
toString
());
}
,
skip:
isBrowser
);
});
}
}
packages/flutter/test/painting/stadium_border_test.dart
View file @
e1e300bb
...
@@ -84,7 +84,7 @@ void main() {
...
@@ -84,7 +84,7 @@ void main() {
expect
(
direct50
,
indirect50
);
expect
(
direct50
,
indirect50
);
expect
(
direct50
.
hashCode
,
indirect50
.
hashCode
);
expect
(
direct50
.
hashCode
,
indirect50
.
hashCode
);
expect
(
direct50
.
toString
(),
indirect50
.
toString
());
expect
(
direct50
.
toString
(),
indirect50
.
toString
());
}
,
skip:
isBrowser
);
});
test
(
'StadiumBorder and RoundedRectBorder'
,
()
{
test
(
'StadiumBorder and RoundedRectBorder'
,
()
{
const
StadiumBorder
stadium
=
StadiumBorder
(
side:
BorderSide
.
none
);
const
StadiumBorder
stadium
=
StadiumBorder
(
side:
BorderSide
.
none
);
...
...
packages/flutter/test/painting/text_painter_rtl_test.dart
View file @
e1e300bb
...
@@ -322,9 +322,7 @@ void main() {
...
@@ -322,9 +322,7 @@ void main() {
TextBox
.
fromLTRBD
(
0.0
,
10.0
,
10.0
,
20.0
,
TextDirection
.
rtl
),
// Alef
TextBox
.
fromLTRBD
(
0.0
,
10.0
,
10.0
,
20.0
,
TextDirection
.
rtl
),
// Alef
],
],
);
);
},
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/32238
// Ahem-based tests don't yet quite work on Windows or some MacOS environments
skip:
!
isLinux
);
test
(
'TextPainter - line wrap mid-word'
,
()
{
test
(
'TextPainter - line wrap mid-word'
,
()
{
final
TextPainter
painter
=
TextPainter
()
final
TextPainter
painter
=
TextPainter
()
...
...
packages/flutter/test/painting/text_painter_test.dart
View file @
e1e300bb
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
@@ -32,7 +31,7 @@ void main() {
...
@@ -32,7 +31,7 @@ void main() {
painter
.
layout
();
painter
.
layout
();
caretOffset
=
painter
.
getOffsetForCaret
(
ui
.
TextPosition
(
offset:
text
.
length
),
ui
.
Rect
.
zero
);
caretOffset
=
painter
.
getOffsetForCaret
(
ui
.
TextPosition
(
offset:
text
.
length
),
ui
.
Rect
.
zero
);
expect
(
caretOffset
.
dx
,
painter
.
width
);
expect
(
caretOffset
.
dx
,
painter
.
width
);
}
,
skip:
isBrowser
);
});
test
(
'TextPainter null text test'
,
()
{
test
(
'TextPainter null text test'
,
()
{
final
TextPainter
painter
=
TextPainter
()
final
TextPainter
painter
=
TextPainter
()
...
@@ -57,7 +56,7 @@ void main() {
...
@@ -57,7 +56,7 @@ void main() {
expect
(
caretOffset
.
dx
,
0
);
expect
(
caretOffset
.
dx
,
0
);
caretOffset
=
painter
.
getOffsetForCaret
(
const
ui
.
TextPosition
(
offset:
1
),
ui
.
Rect
.
zero
);
caretOffset
=
painter
.
getOffsetForCaret
(
const
ui
.
TextPosition
(
offset:
1
),
ui
.
Rect
.
zero
);
expect
(
caretOffset
.
dx
,
0
);
expect
(
caretOffset
.
dx
,
0
);
}
,
skip:
isBrowser
);
});
test
(
'TextPainter caret emoji test'
,
()
{
test
(
'TextPainter caret emoji test'
,
()
{
final
TextPainter
painter
=
TextPainter
()
final
TextPainter
painter
=
TextPainter
()
...
@@ -121,7 +120,7 @@ void main() {
...
@@ -121,7 +120,7 @@ void main() {
expect
(
caretOffset
.
dx
,
112
);
// 🇸
expect
(
caretOffset
.
dx
,
112
);
// 🇸
caretOffset
=
painter
.
getOffsetForCaret
(
const
ui
.
TextPosition
(
offset:
22
),
ui
.
Rect
.
zero
);
caretOffset
=
painter
.
getOffsetForCaret
(
const
ui
.
TextPosition
(
offset:
22
),
ui
.
Rect
.
zero
);
expect
(
caretOffset
.
dx
,
112
);
// 🇸
expect
(
caretOffset
.
dx
,
112
);
// 🇸
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56308
test
(
'TextPainter caret center space test'
,
()
{
test
(
'TextPainter caret center space test'
,
()
{
final
TextPainter
painter
=
TextPainter
()
final
TextPainter
painter
=
TextPainter
()
...
@@ -143,7 +142,7 @@ void main() {
...
@@ -143,7 +142,7 @@ void main() {
expect
(
caretOffset
.
dx
,
35
);
expect
(
caretOffset
.
dx
,
35
);
caretOffset
=
painter
.
getOffsetForCaret
(
const
ui
.
TextPosition
(
offset:
2
),
ui
.
Rect
.
zero
);
caretOffset
=
painter
.
getOffsetForCaret
(
const
ui
.
TextPosition
(
offset:
2
),
ui
.
Rect
.
zero
);
expect
(
caretOffset
.
dx
,
49
);
expect
(
caretOffset
.
dx
,
49
);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56308
test
(
'TextPainter error test'
,
()
{
test
(
'TextPainter error test'
,
()
{
final
TextPainter
painter
=
TextPainter
(
textDirection:
TextDirection
.
ltr
);
final
TextPainter
painter
=
TextPainter
(
textDirection:
TextDirection
.
ltr
);
...
@@ -171,7 +170,7 @@ void main() {
...
@@ -171,7 +170,7 @@ void main() {
);
);
painter
.
layout
();
painter
.
layout
();
expect
(
painter
.
size
,
const
Size
(
123.0
,
123.0
));
expect
(
painter
.
size
,
const
Size
(
123.0
,
123.0
));
}
,
skip:
isBrowser
);
});
test
(
'TextPainter textScaleFactor test'
,
()
{
test
(
'TextPainter textScaleFactor test'
,
()
{
final
TextPainter
painter
=
TextPainter
(
final
TextPainter
painter
=
TextPainter
(
...
@@ -188,7 +187,7 @@ void main() {
...
@@ -188,7 +187,7 @@ void main() {
);
);
painter
.
layout
();
painter
.
layout
();
expect
(
painter
.
size
,
const
Size
(
20.0
,
20.0
));
expect
(
painter
.
size
,
const
Size
(
20.0
,
20.0
));
}
,
skip:
isBrowser
);
});
test
(
'TextPainter default text height is 14 pixels'
,
()
{
test
(
'TextPainter default text height is 14 pixels'
,
()
{
final
TextPainter
painter
=
TextPainter
(
final
TextPainter
painter
=
TextPainter
(
...
@@ -198,7 +197,7 @@ void main() {
...
@@ -198,7 +197,7 @@ void main() {
painter
.
layout
();
painter
.
layout
();
expect
(
painter
.
preferredLineHeight
,
14.0
);
expect
(
painter
.
preferredLineHeight
,
14.0
);
expect
(
painter
.
size
,
const
Size
(
14.0
,
14.0
));
expect
(
painter
.
size
,
const
Size
(
14.0
,
14.0
));
}
,
skip:
isBrowser
);
});
test
(
'TextPainter sets paragraph size from root'
,
()
{
test
(
'TextPainter sets paragraph size from root'
,
()
{
final
TextPainter
painter
=
TextPainter
(
final
TextPainter
painter
=
TextPainter
(
...
@@ -208,7 +207,7 @@ void main() {
...
@@ -208,7 +207,7 @@ void main() {
painter
.
layout
();
painter
.
layout
();
expect
(
painter
.
preferredLineHeight
,
100.0
);
expect
(
painter
.
preferredLineHeight
,
100.0
);
expect
(
painter
.
size
,
const
Size
(
100.0
,
100.0
));
expect
(
painter
.
size
,
const
Size
(
100.0
,
100.0
));
}
,
skip:
isBrowser
);
});
test
(
'TextPainter intrinsic dimensions'
,
()
{
test
(
'TextPainter intrinsic dimensions'
,
()
{
const
TextStyle
style
=
TextStyle
(
const
TextStyle
style
=
TextStyle
(
...
@@ -635,7 +634,7 @@ void main() {
...
@@ -635,7 +634,7 @@ void main() {
);
);
expect
(
caretOffset
.
dx
,
closeTo
(
0.0
,
0.0001
));
expect
(
caretOffset
.
dx
,
closeTo
(
0.0
,
0.0001
));
expect
(
caretOffset
.
dy
,
closeTo
(
0.0
,
0.0001
));
expect
(
caretOffset
.
dy
,
closeTo
(
0.0
,
0.0001
));
}
,
skip:
isBrowser
);
});
test
(
'TextPainter widget span'
,
()
{
test
(
'TextPainter widget span'
,
()
{
final
TextPainter
painter
=
TextPainter
()
final
TextPainter
painter
=
TextPainter
()
...
@@ -729,7 +728,7 @@ void main() {
...
@@ -729,7 +728,7 @@ void main() {
expect
(
painter
.
inlinePlaceholderBoxes
[
11
],
const
TextBox
.
fromLTRBD
(
250
,
30
,
300
,
60
,
TextDirection
.
ltr
));
expect
(
painter
.
inlinePlaceholderBoxes
[
11
],
const
TextBox
.
fromLTRBD
(
250
,
30
,
300
,
60
,
TextDirection
.
ltr
));
expect
(
painter
.
inlinePlaceholderBoxes
[
12
],
const
TextBox
.
fromLTRBD
(
300
,
30
,
351
,
60
,
TextDirection
.
ltr
));
expect
(
painter
.
inlinePlaceholderBoxes
[
12
],
const
TextBox
.
fromLTRBD
(
300
,
30
,
351
,
60
,
TextDirection
.
ltr
));
expect
(
painter
.
inlinePlaceholderBoxes
[
13
],
const
TextBox
.
fromLTRBD
(
351
,
30
,
401
,
60
,
TextDirection
.
ltr
));
expect
(
painter
.
inlinePlaceholderBoxes
[
13
],
const
TextBox
.
fromLTRBD
(
351
,
30
,
401
,
60
,
TextDirection
.
ltr
));
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/42086
// Null values are valid. See https://github.com/flutter/flutter/pull/48346#issuecomment-584839221
// Null values are valid. See https://github.com/flutter/flutter/pull/48346#issuecomment-584839221
test
(
'TextPainter set TextHeightBehavior null test'
,
()
{
test
(
'TextPainter set TextHeightBehavior null test'
,
()
{
...
@@ -832,5 +831,5 @@ void main() {
...
@@ -832,5 +831,5 @@ void main() {
ui
.
Rect
.
zero
,
ui
.
Rect
.
zero
,
);
);
expect
(
caretHeight
,
50.0
);
expect
(
caretHeight
,
50.0
);
},
skip:
kIsWeb
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56308
}
}
packages/flutter/test/painting/text_style_test.dart
View file @
e1e300bb
...
@@ -178,7 +178,7 @@ void main() {
...
@@ -178,7 +178,7 @@ void main() {
expect
(
ps2
,
equals
(
ui
.
ParagraphStyle
(
textAlign:
TextAlign
.
center
,
fontWeight:
FontWeight
.
w800
,
fontSize:
10.0
,
height:
100.0
)));
expect
(
ps2
,
equals
(
ui
.
ParagraphStyle
(
textAlign:
TextAlign
.
center
,
fontWeight:
FontWeight
.
w800
,
fontSize:
10.0
,
height:
100.0
)));
final
ui
.
ParagraphStyle
ps5
=
s5
.
getParagraphStyle
();
final
ui
.
ParagraphStyle
ps5
=
s5
.
getParagraphStyle
();
expect
(
ps5
,
equals
(
ui
.
ParagraphStyle
(
fontWeight:
FontWeight
.
w700
,
fontSize:
12.0
,
height:
123.0
)));
expect
(
ps5
,
equals
(
ui
.
ParagraphStyle
(
fontWeight:
FontWeight
.
w700
,
fontSize:
12.0
,
height:
123.0
)));
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56307
test
(
'TextStyle with text direction'
,
()
{
test
(
'TextStyle with text direction'
,
()
{
...
@@ -208,7 +208,7 @@ void main() {
...
@@ -208,7 +208,7 @@ void main() {
const
TextStyle
s10
=
TextStyle
(
fontFamilyFallback:
<
String
>[],
package:
'p'
);
const
TextStyle
s10
=
TextStyle
(
fontFamilyFallback:
<
String
>[],
package:
'p'
);
expect
(
s10
.
fontFamilyFallback
,
<
String
>[]);
expect
(
s10
.
fontFamilyFallback
,
<
String
>[]);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/56307
test
(
'TextStyle font family fallback'
,
()
{
test
(
'TextStyle font family fallback'
,
()
{
const
TextStyle
s1
=
TextStyle
(
fontFamilyFallback:
<
String
>[
'Roboto'
,
'test'
]);
const
TextStyle
s1
=
TextStyle
(
fontFamilyFallback:
<
String
>[
'Roboto'
,
'test'
]);
...
@@ -238,7 +238,7 @@ void main() {
...
@@ -238,7 +238,7 @@ void main() {
expect
(
s2
.
apply
().
fontFamilyFallback
,
const
<
String
>[
'Roboto'
,
'test'
]);
expect
(
s2
.
apply
().
fontFamilyFallback
,
const
<
String
>[
'Roboto'
,
'test'
]);
expect
(
s2
.
apply
(
fontFamily:
'bar'
).
fontFamily
,
'bar'
);
expect
(
s2
.
apply
(
fontFamily:
'bar'
).
fontFamily
,
'bar'
);
expect
(
s2
.
apply
(
fontFamilyFallback:
const
<
String
>[
'Banana'
]).
fontFamilyFallback
,
const
<
String
>[
'Banana'
]);
expect
(
s2
.
apply
(
fontFamilyFallback:
const
<
String
>[
'Banana'
]).
fontFamilyFallback
,
const
<
String
>[
'Banana'
]);
},
skip:
isBrowser
);
},
skip:
isBrowser
);
// https://github.com/flutter/flutter/issues/32233
test
(
'TextStyle.debugLabel'
,
()
{
test
(
'TextStyle.debugLabel'
,
()
{
const
TextStyle
unknown
=
TextStyle
();
const
TextStyle
unknown
=
TextStyle
();
...
...
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