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
9d724d4c
Unverified
Commit
9d724d4c
authored
Jun 11, 2019
by
Jonah Williams
Committed by
GitHub
Jun 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compatibility pass on flutter/widgets tests for JavaScript compilation. (8) (#33377)
parent
d9c19629
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
102 additions
and
92 deletions
+102
-92
test.dart
dev/bots/test.dart
+1
-0
text_input.dart
packages/flutter/lib/src/services/text_input.dart
+7
-0
actions_test.dart
packages/flutter/test/widgets/actions_test.dart
+1
-1
app_title_test.dart
packages/flutter/test/widgets/app_title_test.dart
+1
-1
backdrop_filter_test.dart
packages/flutter/test/widgets/backdrop_filter_test.dart
+1
-1
baseline_test.dart
packages/flutter/test/widgets/baseline_test.dart
+3
-3
basic_test.dart
packages/flutter/test/widgets/basic_test.dart
+2
-2
clip_test.dart
packages/flutter/test/widgets/clip_test.dart
+13
-13
custom_painter_test.dart
packages/flutter/test/widgets/custom_painter_test.dart
+1
-1
draggable_scrollable_sheet_test.dart
...flutter/test/widgets/draggable_scrollable_sheet_test.dart
+8
-8
draggable_test.dart
packages/flutter/test/widgets/draggable_test.dart
+1
-2
editable_text_cursor_test.dart
packages/flutter/test/widgets/editable_text_cursor_test.dart
+5
-5
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+13
-13
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+1
-0
invert_colors_test.dart
packages/flutter/test/widgets/invert_colors_test.dart
+2
-2
keep_alive_test.dart
packages/flutter/test/widgets/keep_alive_test.dart
+1
-0
list_view_test.dart
packages/flutter/test/widgets/list_view_test.dart
+1
-1
list_wheel_scroll_view_test.dart
...ges/flutter/test/widgets/list_wheel_scroll_view_test.dart
+2
-2
opacity_test.dart
packages/flutter/test/widgets/opacity_test.dart
+2
-2
physical_model_test.dart
packages/flutter/test/widgets/physical_model_test.dart
+3
-3
platform_view_test.dart
packages/flutter/test/widgets/platform_view_test.dart
+1
-1
scrollable_fling_test.dart
packages/flutter/test/widgets/scrollable_fling_test.dart
+2
-2
scrollable_of_test.dart
packages/flutter/test/widgets/scrollable_of_test.dart
+2
-2
scrollable_semantics_test.dart
packages/flutter/test/widgets/scrollable_semantics_test.dart
+1
-1
semantics_clipping_test.dart
packages/flutter/test/widgets/semantics_clipping_test.dart
+2
-2
semantics_test.dart
packages/flutter/test/widgets/semantics_test.dart
+1
-1
semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart
...eTestSemanticsExpressionForCurrentSemanticsTree_test.dart
+1
-0
shader_mask_test.dart
packages/flutter/test/widgets/shader_mask_test.dart
+2
-2
shadow_test.dart
packages/flutter/test/widgets/shadow_test.dart
+2
-2
shape_decoration_test.dart
packages/flutter/test/widgets/shape_decoration_test.dart
+1
-1
simple_semantics_test.dart
packages/flutter/test/widgets/simple_semantics_test.dart
+2
-2
slivers_appbar_floating_pinned_test.dart
...ter/test/widgets/slivers_appbar_floating_pinned_test.dart
+1
-1
text_test.dart
packages/flutter/test/widgets/text_test.dart
+7
-7
transformed_scrollable_test.dart
...ges/flutter/test/widgets/transformed_scrollable_test.dart
+1
-1
visibility_test.dart
packages/flutter/test/widgets/visibility_test.dart
+1
-1
widget_inspector_test.dart
packages/flutter/test/widgets/widget_inspector_test.dart
+5
-5
wrap_test.dart
packages/flutter/test/widgets/wrap_test.dart
+1
-1
No files found.
dev/bots/test.dart
View file @
9d724d4c
...
...
@@ -348,6 +348,7 @@ Future<void> _runWebTests() async {
'test/services/'
,
'test/painting/'
,
'test/scheduler/'
,
'test/widgets/'
,
'test/semantics/'
,
]);
}
...
...
packages/flutter/lib/src/services/text_input.dart
View file @
9d724d4c
...
...
@@ -15,6 +15,9 @@ import 'text_editing.dart';
export
'dart:ui'
show
TextAffinity
;
// Whether we're compiled to JavaScript in a web browser.
const
bool
_kIsBrowser
=
identical
(
0
,
0.0
);
/// The type of information for which to optimize the text input control.
///
/// On Android, behavior may vary across device and keyboard provider.
...
...
@@ -825,6 +828,10 @@ class TextInput {
static
bool
_debugEnsureInputActionWorksOnPlatform
(
TextInputAction
inputAction
)
{
assert
(()
{
if
(
_kIsBrowser
)
{
// TODO(flutterweb): what makes sense here?
return
true
;
}
if
(
Platform
.
isIOS
)
{
assert
(
_iOSSupportedInputActions
.
contains
(
inputAction
),
...
...
packages/flutter/test/widgets/actions_test.dart
View file @
9d724d4c
...
...
@@ -286,6 +286,6 @@ void main() {
expect
(
description
[
0
],
equalsIgnoringHashCodes
(
'dispatcher: ActionDispatcher#00000'
));
expect
(
description
[
1
],
equals
(
'actions: {[<
\'
bar
\'
>]: Closure: () => TestAction}'
));
});
}
,
skip:
isBrowser
);
});
}
packages/flutter/test/widgets/app_title_test.dart
View file @
9d724d4c
...
...
@@ -55,6 +55,6 @@ void main() {
await
tester
.
pump
();
expect
(
tester
.
widget
<
Title
>(
find
.
byType
(
Title
)).
title
,
'en_US'
);
expect
(
tester
.
widget
<
Title
>(
find
.
byType
(
Title
)).
color
,
kTitleColor
);
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/backdrop_filter_test.dart
View file @
9d724d4c
...
...
@@ -46,5 +46,5 @@ void main() {
matchesGoldenFile
(
'backdrop_filter_test.cull_rect.1.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/baseline_test.dart
View file @
9d724d4c
...
...
@@ -19,7 +19,7 @@ void main() {
),
);
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
text
(
'X'
)).
size
,
const
Size
(
100.0
,
100.0
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Baseline - position test'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -40,7 +40,7 @@ void main() {
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
text
(
'X'
)).
size
,
const
Size
(
100.0
,
100.0
));
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
byType
(
Baseline
)).
size
,
within
<
Size
>(
from:
const
Size
(
100.0
,
200.0
),
distance:
0.001
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Chip caches baseline'
,
(
WidgetTester
tester
)
async
{
int
calls
=
0
;
...
...
@@ -65,7 +65,7 @@ void main() {
tester
.
renderObject
<
RenderBaselineDetector
>(
find
.
byType
(
BaselineDetector
)).
dirty
();
await
tester
.
pump
();
expect
(
calls
,
2
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'ListTile caches baseline'
,
(
WidgetTester
tester
)
async
{
int
calls
=
0
;
...
...
packages/flutter/test/widgets/basic_test.dart
View file @
9d724d4c
...
...
@@ -51,7 +51,7 @@ void main() {
expect
(
tester
.
hitTestOnBinding
(
const
Offset
(
100.0
,
300.0
)),
hits
(
renderPhysicalShape
));
expect
(
tester
.
hitTestOnBinding
(
const
Offset
(
100.0
,
299.0
)),
doesNotHit
(
renderPhysicalShape
));
expect
(
tester
.
hitTestOnBinding
(
const
Offset
(
100.0
,
301.0
)),
doesNotHit
(
renderPhysicalShape
));
});
}
,
skip:
isBrowser
);
});
...
...
@@ -202,7 +202,7 @@ void main() {
tester
.
getTopLeft
(
find
.
byKey
(
key2
)).
dy
,
closeTo
(
aboveBaseline1
-
aboveBaseline2
,
.
001
),
);
});
}
,
skip:
isBrowser
);
});
test
(
'UnconstrainedBox toString'
,
()
{
...
...
packages/flutter/test/widgets/clip_test.dart
View file @
9d724d4c
...
...
@@ -358,7 +358,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.ClipRect.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'ClipRect save, overlay, and antialiasing'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -398,7 +398,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.ClipRectOverlay.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'ClipRRect painting'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -447,7 +447,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.ClipRRect.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'ClipOval painting'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -490,7 +490,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.ClipOval.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'ClipPath painting'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -538,7 +538,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.ClipPath.1.png'
),
);
});
}
,
skip:
isBrowser
);
Center
genPhysicalModel
(
Clip
clipBehavior
)
{
return
Center
(
...
...
@@ -583,7 +583,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalModel.antiAlias.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'PhysicalModel painting with Clip.hardEdge'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
genPhysicalModel
(
Clip
.
hardEdge
));
...
...
@@ -591,7 +591,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalModel.hardEdge.1.png'
),
);
});
}
,
skip:
isBrowser
);
// There will be bleeding edges on the rect edges, but there shouldn't be any bleeding edges on the
// round corners.
...
...
@@ -601,7 +601,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalModel.antiAliasWithSaveLayer.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Default PhysicalModel painting'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -643,7 +643,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalModel.default.1.png'
),
);
});
}
,
skip:
isBrowser
);
Center
genPhysicalShape
(
Clip
clipBehavior
)
{
return
Center
(
...
...
@@ -692,7 +692,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalShape.antiAlias.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'PhysicalShape painting with Clip.hardEdge'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
genPhysicalShape
(
Clip
.
hardEdge
));
...
...
@@ -700,7 +700,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalShape.hardEdge.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'PhysicalShape painting with Clip.antiAliasWithSaveLayer'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
genPhysicalShape
(
Clip
.
antiAliasWithSaveLayer
));
...
...
@@ -708,7 +708,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalShape.antiAliasWithSaveLayer.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'PhysicalShape painting'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -754,7 +754,7 @@ void main() {
find
.
byType
(
RepaintBoundary
).
first
,
matchesGoldenFile
(
'clip.PhysicalShape.default.1.png'
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'ClipPath.shape'
,
(
WidgetTester
tester
)
async
{
final
List
<
String
>
logs
=
<
String
>[];
...
...
packages/flutter/test/widgets/custom_painter_test.dart
View file @
9d724d4c
...
...
@@ -493,7 +493,7 @@ void _defineTests() {
);
expect
(
semantics
,
hasSemantics
(
expectedSemantics
,
ignoreRect:
true
,
ignoreTransform:
true
));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
group
(
'diffing'
,
()
{
testWidgets
(
'complains about duplicate keys'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart
View file @
9d724d4c
...
...
@@ -101,7 +101,7 @@ void main() {
expect
(
find
.
text
(
'Item 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 21'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 31'
),
findsOneWidget
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Can be dragged down when not full height'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_boilerplate
(
null
));
...
...
@@ -114,7 +114,7 @@ void main() {
expect
(
find
.
text
(
'Item 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 21'
),
findsNothing
);
expect
(
find
.
text
(
'Item 36'
),
findsNothing
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Can be dragged down when list is shorter than full height'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_boilerplate
(
null
,
itemCount:
30
,
initialChildSize:
.
25
));
...
...
@@ -131,7 +131,7 @@ void main() {
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'Item 1'
).
hitTestable
(),
findsOneWidget
);
expect
(
find
.
text
(
'Item 29'
).
hitTestable
(),
findsNothing
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Can be dragged up and cover its container and scroll in single motion, and then dragged back down'
,
(
WidgetTester
tester
)
async
{
int
taps
=
0
;
...
...
@@ -160,7 +160,7 @@ void main() {
expect
(
find
.
text
(
'Item 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 18'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 36'
),
findsNothing
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Can be flung up gently'
,
(
WidgetTester
tester
)
async
{
int
taps
=
0
;
...
...
@@ -183,7 +183,7 @@ void main() {
expect
(
find
.
text
(
'Item 21'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 36'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 70'
),
findsNothing
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Can be flung up'
,
(
WidgetTester
tester
)
async
{
int
taps
=
0
;
...
...
@@ -204,7 +204,7 @@ void main() {
expect
(
find
.
text
(
'Item 1'
),
findsNothing
);
expect
(
find
.
text
(
'Item 21'
),
findsNothing
);
expect
(
find
.
text
(
'Item 70'
),
findsOneWidget
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Can be flung down when not full height'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_boilerplate
(
null
));
...
...
@@ -217,7 +217,7 @@ void main() {
expect
(
find
.
text
(
'Item 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 21'
),
findsNothing
);
expect
(
find
.
text
(
'Item 36'
),
findsNothing
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Can be flung up and then back down'
,
(
WidgetTester
tester
)
async
{
int
taps
=
0
;
...
...
@@ -256,7 +256,7 @@ void main() {
expect
(
find
.
text
(
'Item 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'Item 21'
),
findsNothing
);
expect
(
find
.
text
(
'Item 70'
),
findsNothing
);
});
}
,
skip:
isBrowser
);
debugDefaultTargetPlatformOverride
=
null
;
});
...
...
packages/flutter/test/widgets/draggable_test.dart
View file @
9d724d4c
...
...
@@ -2085,8 +2085,7 @@ void main() {
],
),
ignoreTransform:
true
,
ignoreRect:
true
));
semantics
.
dispose
();
});
},
skip:
isBrowser
);
}
Future
<
void
>
_testLongPressDraggableHapticFeedback
({
WidgetTester
tester
,
bool
hapticFeedbackOnStart
,
int
expectedHapticFeedbackCount
})
async
{
...
...
packages/flutter/test/widgets/editable_text_cursor_test.dart
View file @
9d724d4c
...
...
@@ -445,7 +445,7 @@ void main() {
await
tester
.
pumpAndSettle
();
expect
(
controller
.
selection
.
baseOffset
,
10
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Updating the floating cursor correctly moves the cursor'
,
(
WidgetTester
tester
)
async
{
const
String
text
=
'hello world this is fun and cool and awesome!'
;
...
...
@@ -501,7 +501,7 @@ void main() {
await
tester
.
pumpAndSettle
();
// The cursor has been set.
expect
(
controller
.
selection
.
baseOffset
,
10
);
});
}
,
skip:
isBrowser
);
// Regression test for https://github.com/flutter/flutter/pull/30475.
testWidgets
(
'Trying to select with the floating cursor does not crash'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -567,7 +567,7 @@ void main() {
offset:
const
Offset
(-
250
,
20
)));
editableTextState
.
updateFloatingCursor
(
RawFloatingCursorPoint
(
state:
FloatingCursorDragState
.
End
));
await
tester
.
pumpAndSettle
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'autofocus sets cursor to the end of text'
,
(
WidgetTester
tester
)
async
{
const
String
text
=
'hello world'
;
...
...
@@ -599,7 +599,7 @@ void main() {
expect
(
focusNode
.
hasFocus
,
true
);
expect
(
controller
.
selection
.
isCollapsed
,
true
);
expect
(
controller
.
selection
.
baseOffset
,
text
.
length
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Floating cursor is painted on iOS'
,
(
WidgetTester
tester
)
async
{
debugDefaultTargetPlatformOverride
=
TargetPlatform
.
iOS
;
...
...
@@ -687,7 +687,7 @@ void main() {
editableTextState
.
updateFloatingCursor
(
RawFloatingCursorPoint
(
state:
FloatingCursorDragState
.
End
));
await
tester
.
pumpAndSettle
();
debugDefaultTargetPlatformOverride
=
null
;
});
}
,
skip:
isBrowser
);
testWidgets
(
'cursor layout iOS'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
<
EditableTextState
>
editableTextKey
=
GlobalKey
<
EditableTextState
>();
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
9d724d4c
...
...
@@ -129,7 +129,7 @@ void main() {
equals
(
'TextInputType.text'
));
expect
(
tester
.
testTextInput
.
setClientArgs
[
'inputAction'
],
equals
(
'TextInputAction.done'
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Keyboard is configured for "unspecified" action when explicitly requested'
,
(
WidgetTester
tester
)
async
{
await
_desiredKeyboardActionIsRequested
(
...
...
@@ -161,7 +161,7 @@ void main() {
action:
TextInputAction
.
send
,
serializedActionName:
'TextInputAction.send'
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Keyboard is configured for "go" action when explicitly requested'
,
(
WidgetTester
tester
)
async
{
await
_desiredKeyboardActionIsRequested
(
...
...
@@ -185,7 +185,7 @@ void main() {
action:
TextInputAction
.
send
,
serializedActionName:
'TextInputAction.send'
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Keyboard is configured for "next" action when explicitly requested'
,
(
WidgetTester
tester
)
async
{
await
_desiredKeyboardActionIsRequested
(
...
...
@@ -193,7 +193,7 @@ void main() {
action:
TextInputAction
.
next
,
serializedActionName:
'TextInputAction.next'
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Keyboard is configured for "previous" action when explicitly requested'
,
(
WidgetTester
tester
)
async
{
await
_desiredKeyboardActionIsRequested
(
...
...
@@ -201,7 +201,7 @@ void main() {
action:
TextInputAction
.
previous
,
serializedActionName:
'TextInputAction.previous'
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Keyboard is configured for "continue" action when explicitly requested'
,
(
WidgetTester
tester
)
async
{
await
_desiredKeyboardActionIsRequested
(
...
...
@@ -209,7 +209,7 @@ void main() {
action:
TextInputAction
.
continueAction
,
serializedActionName:
'TextInputAction.continueAction'
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Keyboard is configured for "join" action when explicitly requested'
,
(
WidgetTester
tester
)
async
{
await
_desiredKeyboardActionIsRequested
(
...
...
@@ -217,7 +217,7 @@ void main() {
action:
TextInputAction
.
join
,
serializedActionName:
'TextInputAction.join'
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Keyboard is configured for "route" action when explicitly requested'
,
(
WidgetTester
tester
)
async
{
await
_desiredKeyboardActionIsRequested
(
...
...
@@ -1170,7 +1170,7 @@ void main() {
expect
(
controller
.
selection
.
extentOffset
,
9
);
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'can extend selection with a11y means - character'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -1271,7 +1271,7 @@ void main() {
expect
(
controller
.
selection
.
extentOffset
,
2
);
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'can extend selection with a11y means - word'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -1373,7 +1373,7 @@ void main() {
expect
(
controller
.
selection
.
extentOffset
,
9
);
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'password fields have correct semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -2046,7 +2046,7 @@ void main() {
// at all. Again, both handles should be invisible.
scrollable
.
controller
.
jumpTo
(
0
);
await
verifyVisibility
(
HandlePositionInViewport
.
rightEdge
,
false
,
HandlePositionInViewport
.
rightEdge
,
false
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'text selection handle visibility RTL'
,
(
WidgetTester
tester
)
async
{
// Text with two separate words to select.
...
...
@@ -2103,7 +2103,7 @@ void main() {
expect
(
state
.
selectionOverlay
.
handlesAreVisible
,
isTrue
);
expect
(
controller
.
selection
.
base
.
offset
,
0
);
expect
(
controller
.
selection
.
extent
.
offset
,
5
);
});
}
,
skip:
isBrowser
);
// Regression test for https://github.com/flutter/flutter/issues/31287
testWidgets
(
'iOS text selection handle visibility'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -2273,7 +2273,7 @@ void main() {
await
verifyVisibility
(
HandlePositionInViewport
.
rightEdge
,
false
,
HandlePositionInViewport
.
rightEdge
,
false
);
debugDefaultTargetPlatformOverride
=
null
;
});
}
,
skip:
isBrowser
);
}
class
MockTextSelectionControls
extends
Mock
implements
TextSelectionControls
{
...
...
packages/flutter/test/widgets/image_resolution_test.dart
View file @
9d724d4c
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
// asset bundle behaves differently.
import
'dart:async'
;
import
'dart:typed_data'
;
import
'dart:ui'
as
ui
show
Image
,
ImageByteFormat
;
...
...
packages/flutter/test/widgets/invert_colors_test.dart
View file @
9d724d4c
...
...
@@ -23,7 +23,7 @@ void main() {
matchesGoldenFile
(
'invert_colors_test.0.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'InvertColors and ColorFilter'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
RepaintBoundary
(
...
...
@@ -42,7 +42,7 @@ void main() {
matchesGoldenFile
(
'invert_colors_test.1.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
}
// Draws a rectangle sized by the parent widget with [color], [colorFilter],
...
...
packages/flutter/test/widgets/keep_alive_test.dart
View file @
9d724d4c
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
// diagnostics use Platform.operatingSystem.
import
'dart:io'
show
Platform
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
packages/flutter/test/widgets/list_view_test.dart
View file @
9d724d4c
...
...
@@ -212,7 +212,7 @@ void main() {
await
tester
.
pumpWidget
(
_StatefulListView
((
int
i
)
=>
i
%
3
==
0
));
await
checkAndScroll
(
'0:true'
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'ListView can build out of underflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/widgets/list_wheel_scroll_view_test.dart
View file @
9d724d4c
...
...
@@ -538,7 +538,7 @@ void main() {
matchesGoldenFile
(
'list_wheel_scroll_view.center_child.magnified.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Default middle transform'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -593,7 +593,7 @@ void main() {
matchesGoldenFile
(
'list_wheel_scroll_view.curved_wheel.left.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Scrolling, diameterRatio, perspective all changes matrix'
,
(
WidgetTester
tester
)
async
{
final
ScrollController
controller
=
ScrollController
(
initialScrollOffset:
200.0
);
...
...
packages/flutter/test/widgets/opacity_test.dart
View file @
9d724d4c
...
...
@@ -180,7 +180,7 @@ void main() {
matchesGoldenFile
(
'opacity_test.offset.1.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'empty opacity does not crash'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
...
...
@@ -190,5 +190,5 @@ void main() {
// The following line will send the layer to engine and cause crash if an
// empty opacity layer is sent.
await
element
.
renderObject
.
layer
.
toImage
(
const
Rect
.
fromLTRB
(
0.0
,
0.0
,
1.0
,
1.0
));
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/physical_model_test.dart
View file @
9d724d4c
...
...
@@ -113,7 +113,7 @@ void main() {
matchesGoldenFile
(
'physical_model_overflow.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
group
(
'PhysicalModelLayer checks elevation'
,
()
{
Future
<
void
>
_testStackChildren
(
...
...
@@ -278,7 +278,7 @@ void main() {
await
_testStackChildren
(
tester
,
children
,
expectedErrorCount:
0
);
expect
(
find
.
byType
(
Material
),
findsNWidgets
(
2
));
});
}
,
skip:
isBrowser
);
// Tests:
//
...
...
@@ -485,7 +485,7 @@ void main() {
await
_testStackChildren
(
tester
,
children
,
expectedErrorCount:
0
);
expect
(
find
.
byType
(
Material
),
findsNWidgets
(
2
));
});
}
,
skip:
isBrowser
);
// Tests:
//
...
...
packages/flutter/test/widgets/platform_view_test.dart
View file @
9d724d4c
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'dart:async'
;
import
'dart:typed_data'
;
...
...
packages/flutter/test/widgets/scrollable_fling_test.dart
View file @
9d724d4c
...
...
@@ -83,7 +83,7 @@ void main() {
await
tester
.
tap
(
find
.
byType
(
Scrollable
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
50
));
expect
(
log
,
equals
(<
String
>[
'tap 21'
,
'tap 35'
]));
});
}
,
skip:
isBrowser
);
testWidgets
(
'fling and wait and tap'
,
(
WidgetTester
tester
)
async
{
final
List
<
String
>
log
=
<
String
>[];
...
...
@@ -110,5 +110,5 @@ void main() {
await
tester
.
tap
(
find
.
byType
(
Scrollable
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
50
));
expect
(
log
,
equals
(<
String
>[
'tap 21'
,
'tap 48'
]));
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/scrollable_of_test.dart
View file @
9d724d4c
...
...
@@ -24,7 +24,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> {
_position
?.
removeListener
(
listener
);
_position
=
Scrollable
.
of
(
context
)?.
position
;
_position
?.
addListener
(
listener
);
widget
.
log
(
'didChangeDependencies
${_position?.pixels}
'
);
widget
.
log
(
'didChangeDependencies
${_position?.pixels
?.toStringAsFixed(1)
}
'
);
}
@override
...
...
@@ -37,7 +37,7 @@ class _ScrollPositionListenerState extends State<ScrollPositionListener> {
Widget
build
(
BuildContext
context
)
=>
widget
.
child
;
void
listener
()
{
widget
.
log
(
'listener
${_position?.pixels}
'
);
widget
.
log
(
'listener
${_position?.pixels
?.toStringAsFixed(1)
}
'
);
}
}
...
...
packages/flutter/test/widgets/scrollable_semantics_test.dart
View file @
9d724d4c
...
...
@@ -259,7 +259,7 @@ void main() {
));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'correct scrollProgress for unbound'
,
(
WidgetTester
tester
)
async
{
semantics
=
SemanticsTester
(
tester
);
...
...
packages/flutter/test/widgets/semantics_clipping_test.dart
View file @
9d724d4c
...
...
@@ -63,7 +63,7 @@ void main() {
));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'SemanticsNode is not removed if out of bounds and merged into something within bounds'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -124,5 +124,5 @@ void main() {
));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/semantics_test.dart
View file @
9d724d4c
...
...
@@ -536,7 +536,7 @@ void main() {
expect
(
semantics
,
hasSemantics
(
expectedSemantics
,
ignoreId:
true
));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'Actions can be replaced without triggering semantics update'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
packages/flutter/test/widgets/semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart
View file @
9d724d4c
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'dart:async'
;
import
'dart:io'
;
...
...
packages/flutter/test/widgets/shader_mask_test.dart
View file @
9d724d4c
...
...
@@ -21,7 +21,7 @@ void main() {
testWidgets
(
'Can be constructed'
,
(
WidgetTester
tester
)
async
{
final
Widget
child
=
Container
(
width:
100.0
,
height:
100.0
);
await
tester
.
pumpWidget
(
ShaderMask
(
child:
child
,
shaderCallback:
createShader
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Bounds rect includes offset'
,
(
WidgetTester
tester
)
async
{
Rect
shaderBounds
;
...
...
@@ -45,5 +45,5 @@ void main() {
// The shader bounds rectangle should reflect the position of the centered SizedBox.
expect
(
shaderBounds
,
equals
(
const
Rect
.
fromLTWH
(
200.0
,
100.0
,
400.0
,
400.0
)));
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/shadow_test.dart
View file @
9d724d4c
...
...
@@ -34,7 +34,7 @@ void main() {
skip:
!
isLinux
);
// shadows render differently on different platforms
debugDisableShadows
=
true
;
});
}
,
skip:
isBrowser
);
testWidgets
(
'Shadows on ShapeDecoration'
,
(
WidgetTester
tester
)
async
{
debugDisableShadows
=
false
;
...
...
@@ -95,7 +95,7 @@ void main() {
skip:
!
isLinux
,
);
// shadows render differently on different platforms
debugDisableShadows
=
true
;
});
}
,
skip:
isBrowser
);
testWidgets
(
'Shadows with PhysicalShape'
,
(
WidgetTester
tester
)
async
{
debugDisableShadows
=
false
;
...
...
packages/flutter/test/widgets/shape_decoration_test.dart
View file @
9d724d4c
...
...
@@ -59,7 +59,7 @@ Future<void> main() async {
..
rect
(
color:
Colors
.
black
)
..
rect
(
color:
Colors
.
white
),
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'TestBorder and Directionality - 1'
,
(
WidgetTester
tester
)
async
{
final
List
<
String
>
log
=
<
String
>[];
...
...
packages/flutter/test/widgets/simple_semantics_test.dart
View file @
9d724d4c
...
...
@@ -34,7 +34,7 @@ void main() {
)));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'Simple tree is simple - material'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -78,5 +78,5 @@ void main() {
)));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart
View file @
9d724d4c
...
...
@@ -66,7 +66,7 @@ void main() {
// initial position of E was 200 + 56 + cSize.height + cSize.height + 500
// we've scrolled that up by 600.0, meaning it's at that minus 600 now:
expect
(
tester
.
getTopLeft
(
find
.
text
(
'E'
)),
Offset
(
0.0
,
200.0
+
56.0
+
cSize
.
height
*
2.0
+
500.0
-
600.0
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Does not crash when there is less than minExtent remainingPaintExtent'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/21887.
...
...
packages/flutter/test/widgets/text_test.dart
View file @
9d724d4c
...
...
@@ -55,7 +55,7 @@ void main() {
final
Size
largeSize
=
tester
.
getSize
(
find
.
byType
(
RichText
));
expect
(
largeSize
.
width
,
105.0
);
expect
(
largeSize
.
height
,
equals
(
21.0
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Text respects textScaleFactor with explicit font size'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
Center
(
...
...
@@ -83,7 +83,7 @@ void main() {
final
Size
largeSize
=
tester
.
getSize
(
find
.
byType
(
RichText
));
expect
(
largeSize
.
width
,
anyOf
(
131.0
,
130.0
));
expect
(
largeSize
.
height
,
equals
(
26.0
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Text throws a nice error message if there
\'
s no Directionality'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
Text
(
'Hello'
));
...
...
@@ -227,7 +227,7 @@ void main() {
);
expect
(
semantics
,
hasSemantics
(
expectedSemantics
,
ignoreTransform:
true
,
ignoreId:
true
,
ignoreRect:
true
));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'recognizers split semantic node - bidi'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -356,7 +356,7 @@ void main() {
);
expect
(
semantics
,
hasSemantics
(
expectedSemantics
,
ignoreTransform:
true
,
ignoreId:
true
,
ignoreRect:
true
));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'inline widgets semantic nodes scale'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
...
...
@@ -427,7 +427,7 @@ void main() {
);
expect
(
semantics
,
hasSemantics
(
expectedSemantics
,
ignoreTransform:
true
,
ignoreId:
true
,));
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
testWidgets
(
'Overflow is clipping correctly - short text with overflow: clip'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
...
...
@@ -447,7 +447,7 @@ void main() {
);
expect
(
find
.
byType
(
Text
),
paints
..
clipRect
(
rect:
const
Rect
.
fromLTWH
(
0
,
0
,
50
,
50
)));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Overflow is clipping correctly - short text with overflow: ellipsis'
,
(
WidgetTester
tester
)
async
{
await
_pumpTextWidget
(
...
...
@@ -534,7 +534,7 @@ void main() {
final
Size
textSizeLongestLine
=
tester
.
getSize
(
find
.
byType
(
Text
));
expect
(
textSizeLongestLine
.
width
,
equals
(
630.0
));
expect
(
textSizeLongestLine
.
height
,
equals
(
fontHeight
*
2
));
});
}
,
skip:
isBrowser
);
}
Future
<
void
>
_pumpTextWidget
({
WidgetTester
tester
,
String
text
,
TextOverflow
overflow
})
{
...
...
packages/flutter/test/widgets/transformed_scrollable_test.dart
View file @
9d724d4c
...
...
@@ -214,5 +214,5 @@ void main() {
// coordinate space of the screen, the scroll view actually moved far more
// pixels in its local coordinate system due to the perspective transform.
expect
(
controller
.
offset
,
greaterThan
(
100
));
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/visibility_test.dart
View file @
9d724d4c
...
...
@@ -309,5 +309,5 @@ void main() {
log
.
clear
();
semantics
.
dispose
();
});
}
,
skip:
isBrowser
);
}
packages/flutter/test/widgets/widget_inspector_test.dart
View file @
9d724d4c
...
...
@@ -930,7 +930,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService {
expect
(
json
.
decode
(
service
.
getSelectedWidget
(
null
,
'my-group'
)),
contains
(
'createdByLocalProject'
));
service
.
setSelection
(
richText
,
'my-group'
);
expect
(
json
.
decode
(
service
.
getSelectedWidget
(
null
,
'my-group'
)),
contains
(
'createdByLocalProject'
));
},
skip:
!
WidgetInspectorService
.
instance
.
isWidgetCreationTracked
());
// Test requires --track-widget-creation flag.
},
skip:
!
WidgetInspectorService
.
instance
.
isWidgetCreationTracked
()
||
isBrowser
);
// Test requires --track-widget-creation flag.
test
(
'ext.flutter.inspector.disposeGroup'
,
()
async
{
final
Object
a
=
Object
();
...
...
@@ -1490,7 +1490,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService {
expect
(
await
service
.
testExtension
(
'getSelectedWidget'
,
<
String
,
String
>{
'objectGroup'
:
'my-group'
}),
contains
(
'createdByLocalProject'
));
service
.
setSelection
(
richText
,
'my-group'
);
expect
(
await
service
.
testExtension
(
'getSelectedWidget'
,
<
String
,
String
>{
'objectGroup'
:
'my-group'
}),
contains
(
'createdByLocalProject'
));
},
skip:
!
WidgetInspectorService
.
instance
.
isWidgetCreationTracked
());
// Test requires --track-widget-creation flag.
},
skip:
!
WidgetInspectorService
.
instance
.
isWidgetCreationTracked
()
||
isBrowser
);
// Test requires --track-widget-creation flag.
testWidgets
(
'ext.flutter.inspector.trackRebuildDirtyWidgets'
,
(
WidgetTester
tester
)
async
{
service
.
rebuildCount
=
0
;
...
...
@@ -2152,7 +2152,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService {
matchesGoldenFile
(
'inspector.sizedBox_debugPaint_margin.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Screenshot of composited transforms - only offsets'
,
(
WidgetTester
tester
)
async
{
// Composited transforms are challenging to take screenshots of as the
...
...
@@ -2250,7 +2250,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService {
matchesGoldenFile
(
'inspector.composited_transform.only_offsets_target.png'
),
skip:
!
isLinux
,
);
});
}
,
skip:
isBrowser
);
testWidgets
(
'Screenshot composited transforms - with rotations'
,
(
WidgetTester
tester
)
async
{
final
LayerLink
link
=
LayerLink
();
...
...
@@ -2360,7 +2360,7 @@ class TestWidgetInspectorService extends Object with WidgetInspectorService {
expect
(
identical
(
key2
.
currentContext
.
findRenderObject
(),
box2
),
isTrue
);
expect
(
box1
.
localToGlobal
(
Offset
.
zero
),
equals
(
position1
));
expect
(
box2
.
localToGlobal
(
Offset
.
zero
),
equals
(
position2
));
});
}
,
skip:
isBrowser
);
}
}
...
...
packages/flutter/test/widgets/wrap_test.dart
View file @
9d724d4c
...
...
@@ -827,7 +827,7 @@ void main() {
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
text
(
'X'
)).
size
,
const
Size
(
100.0
,
100.0
));
expect
(
tester
.
renderObject
<
RenderBox
>(
find
.
byType
(
Baseline
)).
size
,
within
<
Size
>(
from:
const
Size
(
100.0
,
200.0
),
distance:
0.001
));
});
}
,
skip:
isBrowser
);
testWidgets
(
'Spacing with slight overflow'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
Wrap
(
...
...
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