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
ab2d0323
Unverified
Commit
ab2d0323
authored
Nov 06, 2018
by
Jonah Williams
Committed by
GitHub
Nov 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup accessibility test skips in gallery (#23977)
parent
48c00dc7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
47 additions
and
36 deletions
+47
-36
backdrop_demo.dart
...ples/flutter_gallery/lib/demo/material/backdrop_demo.dart
+1
-0
bottom_app_bar_demo.dart
...lutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
+6
-5
buttons_demo.dart
examples/flutter_gallery/lib/demo/material/buttons_demo.dart
+15
-14
cards_demo.dart
examples/flutter_gallery/lib/demo/material/cards_demo.dart
+6
-3
tabs_fab_demo.dart
...ples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
+1
-1
text_form_field_demo.dart
...utter_gallery/lib/demo/material/text_form_field_demo.dart
+4
-1
demo.dart
examples/flutter_gallery/lib/gallery/demo.dart
+1
-1
accessibility_test.dart
examples/flutter_gallery/test/accessibility_test.dart
+9
-9
accessibility.dart
packages/flutter_test/lib/src/accessibility.dart
+4
-2
No files found.
examples/flutter_gallery/lib/demo/material/backdrop_demo.dart
View file @
ab2d0323
...
...
@@ -395,6 +395,7 @@ class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderSt
onPressed:
_toggleBackdropPanelVisibility
,
icon:
AnimatedIcon
(
icon:
AnimatedIcons
.
close_menu
,
semanticLabel:
'close'
,
progress:
_controller
.
view
,
),
),
...
...
examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
View file @
ab2d0323
...
...
@@ -33,7 +33,7 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
label:
'circular floating action button'
,
value:
FloatingActionButton
(
onPressed:
_showSnackbar
,
child:
Icon
(
Icons
.
add
),
child:
Icon
(
Icons
.
add
,
semanticLabel:
'Action'
),
backgroundColor:
Colors
.
orange
,
),
);
...
...
@@ -43,7 +43,7 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
label:
'diamond shape floating action button'
,
value:
_DiamondFab
(
onPressed:
_showSnackbar
,
child:
Icon
(
Icons
.
add
),
child:
Icon
(
Icons
.
add
,
semanticLabel:
'Action'
),
),
);
...
...
@@ -147,7 +147,7 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
actions:
<
Widget
>[
MaterialDemoDocumentationButton
(
BottomAppBarDemo
.
routeName
),
IconButton
(
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
),
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
,
semanticLabel:
'Update shape'
),
onPressed:
()
{
setState
(()
{
_fabShape
=
_fabShape
==
kCircularFab
?
kDiamondFab
:
kCircularFab
;
...
...
@@ -349,7 +349,7 @@ class _DemoBottomAppBar extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
final
List
<
Widget
>
rowContents
=
<
Widget
>
[
IconButton
(
icon:
const
Icon
(
Icons
.
menu
),
icon:
const
Icon
(
Icons
.
menu
,
semanticLabel:
'Show bottom sheet'
),
onPressed:
()
{
showModalBottomSheet
<
void
>(
context:
context
,
...
...
@@ -367,7 +367,7 @@ class _DemoBottomAppBar extends StatelessWidget {
rowContents
.
addAll
(<
Widget
>
[
IconButton
(
icon:
const
Icon
(
Icons
.
search
),
icon:
const
Icon
(
Icons
.
search
,
semanticLabel:
'show search action'
,
),
onPressed:
()
{
Scaffold
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
'This is a dummy search action.'
)),
...
...
@@ -379,6 +379,7 @@ class _DemoBottomAppBar extends StatelessWidget {
Theme
.
of
(
context
).
platform
==
TargetPlatform
.
iOS
?
Icons
.
more_horiz
:
Icons
.
more_vert
,
semanticLabel:
'Show menu actions'
,
),
onPressed:
()
{
Scaffold
.
of
(
context
).
showSnackBar
(
...
...
examples/flutter_gallery/lib/demo/material/buttons_demo.dart
View file @
ab2d0323
...
...
@@ -120,7 +120,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
demos:
demos
,
actions:
<
Widget
>[
IconButton
(
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
),
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
,
semanticLabel:
'Update shape'
),
onPressed:
()
{
setState
(()
{
_buttonShape
=
_buttonShape
==
null
?
const
StadiumBorder
()
:
null
;
...
...
@@ -141,13 +141,13 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
RaisedButton
(
child:
const
Text
(
'RAISED BUTTON'
),
child:
const
Text
(
'RAISED BUTTON'
,
semanticsLabel:
'RAISED BUTTON 1'
),
onPressed:
()
{
// Perform some action
},
),
const
RaisedButton
(
child:
Text
(
'DISABLED'
),
child:
Text
(
'DISABLED'
,
semanticsLabel:
'DISABLED BUTTON 1'
),
onPressed:
null
,
),
],
...
...
@@ -157,14 +157,14 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
children:
<
Widget
>[
RaisedButton
.
icon
(
icon:
const
Icon
(
Icons
.
add
,
size:
18.0
),
label:
const
Text
(
'RAISED BUTTON'
),
label:
const
Text
(
'RAISED BUTTON'
,
semanticsLabel:
'RAISED BUTTON 2'
),
onPressed:
()
{
// Perform some action
},
),
RaisedButton
.
icon
(
icon:
const
Icon
(
Icons
.
add
,
size:
18.0
),
label:
const
Text
(
'DISABLED'
),
label:
const
Text
(
'DISABLED'
,
semanticsLabel:
'DISABLED BUTTON 2'
),
onPressed:
null
,
),
],
...
...
@@ -184,13 +184,13 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
FlatButton
(
child:
const
Text
(
'FLAT BUTTON'
),
child:
const
Text
(
'FLAT BUTTON'
,
semanticsLabel:
'FLAT BUTTON 1'
),
onPressed:
()
{
// Perform some action
},
),
const
FlatButton
(
child:
Text
(
'DISABLED'
),
child:
Text
(
'DISABLED'
,
semanticsLabel:
'DISABLED BUTTON 3'
,
),
onPressed:
null
,
),
],
...
...
@@ -200,14 +200,14 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
children:
<
Widget
>[
FlatButton
.
icon
(
icon:
const
Icon
(
Icons
.
add_circle_outline
,
size:
18.0
),
label:
const
Text
(
'FLAT BUTTON'
),
label:
const
Text
(
'FLAT BUTTON'
,
semanticsLabel:
'FLAT BUTTON 2'
),
onPressed:
()
{
// Perform some action
},
),
FlatButton
.
icon
(
icon:
const
Icon
(
Icons
.
add_circle_outline
,
size:
18.0
),
label:
const
Text
(
'DISABLED'
),
label:
const
Text
(
'DISABLED'
,
semanticsLabel:
'DISABLED BUTTON 4'
),
onPressed:
null
,
),
],
...
...
@@ -227,13 +227,13 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
OutlineButton
(
child:
const
Text
(
'OUTLINE BUTTON'
),
child:
const
Text
(
'OUTLINE BUTTON'
,
semanticsLabel:
'OUTLINE BUTTON 1'
),
onPressed:
()
{
// Perform some action
},
),
const
OutlineButton
(
child:
Text
(
'DISABLED'
),
child:
Text
(
'DISABLED'
,
semanticsLabel:
'DISABLED BUTTON 5'
),
onPressed:
null
,
),
],
...
...
@@ -243,14 +243,14 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
children:
<
Widget
>[
OutlineButton
.
icon
(
icon:
const
Icon
(
Icons
.
add
,
size:
18.0
),
label:
const
Text
(
'OUTLINE BUTTON'
),
label:
const
Text
(
'OUTLINE BUTTON'
,
semanticsLabel:
'OUTLINE BUTTON 2'
),
onPressed:
()
{
// Perform some action
},
),
OutlineButton
.
icon
(
icon:
const
Icon
(
Icons
.
add
,
size:
18.0
),
label:
const
Text
(
'DISABLED'
),
label:
const
Text
(
'DISABLED'
,
semanticsLabel:
'DISABLED BUTTON 6'
),
onPressed:
null
,
),
],
...
...
@@ -360,7 +360,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
const
IconButton
(
icon:
Icon
(
Icons
.
thumb_up
,
semanticLabel:
'Thumbs up'
,
semanticLabel:
'Thumbs
not
up'
,
),
onPressed:
null
,
)
...
...
@@ -379,6 +379,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
onPressed:
()
{
// Perform some action
},
tooltip:
'floating action button'
,
),
);
}
...
...
examples/flutter_gallery/lib/demo/material/cards_demo.dart
View file @
ab2d0323
...
...
@@ -133,12 +133,12 @@ class TravelDestinationItem extends StatelessWidget {
alignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
FlatButton
(
child:
const
Text
(
'SHARE
'
),
child:
Text
(
'SHARE'
,
semanticsLabel:
'Share
${destination.title}
'
),
textColor:
Colors
.
amber
.
shade500
,
onPressed:
()
{
/* do nothing */
},
),
FlatButton
(
child:
const
Text
(
'EXPLORE
'
),
child:
Text
(
'EXPLORE'
,
semanticsLabel:
'Explore
${destination.title}
'
),
textColor:
Colors
.
amber
.
shade500
,
onPressed:
()
{
/* do nothing */
},
),
...
...
@@ -172,7 +172,10 @@ class _CardsDemoState extends State<CardsDemo> {
actions:
<
Widget
>[
MaterialDemoDocumentationButton
(
CardsDemo
.
routeName
),
IconButton
(
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
),
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
,
semanticLabel:
'update shape'
,
),
onPressed:
()
{
setState
(()
{
_shape
=
_shape
!=
null
?
null
:
const
RoundedRectangleBorder
(
...
...
examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
View file @
ab2d0323
...
...
@@ -141,7 +141,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
actions:
<
Widget
>[
MaterialDemoDocumentationButton
(
TabsFabDemo
.
routeName
),
IconButton
(
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
),
icon:
const
Icon
(
Icons
.
sentiment_very_satisfied
,
semanticLabel:
'Toggle extended buttons'
),
onPressed:
()
{
setState
(()
{
_extendedButtons
=
!
_extendedButtons
;
...
...
examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart
View file @
ab2d0323
...
...
@@ -72,7 +72,10 @@ class _PasswordFieldState extends State<PasswordField> {
_obscureText
=
!
_obscureText
;
});
},
child:
Icon
(
_obscureText
?
Icons
.
visibility
:
Icons
.
visibility_off
),
child:
Icon
(
_obscureText
?
Icons
.
visibility
:
Icons
.
visibility_off
,
semanticLabel:
_obscureText
?
'show password'
:
'hide password'
,
),
),
),
);
...
...
examples/flutter_gallery/lib/gallery/demo.dart
View file @
ab2d0323
...
...
@@ -78,7 +78,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
Builder
(
builder:
(
BuildContext
context
)
{
return
IconButton
(
icon:
const
Icon
(
Icons
.
library_books
),
icon:
const
Icon
(
Icons
.
library_books
,
semanticLabel:
'Show documentation'
),
onPressed:
()
=>
_showApiDocumentation
(
context
),
);
},
...
...
examples/flutter_gallery/test/accessibility_test.dart
View file @
ab2d0323
...
...
@@ -243,14 +243,14 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
home:
BackdropDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
labeledTapTargetGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
});
testWidgets
(
'bottom_app_bar_demo'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
BottomAppBarDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
labeledTapTargetGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
});
testWidgets
(
'bottom_navigation_demo'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
...
...
@@ -264,14 +264,14 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
home:
ButtonsDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
labeledTapTargetGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
});
testWidgets
(
'cards_demo'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
CardsDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
labeledTapTargetGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
});
testWidgets
(
'chip_demo'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
...
...
@@ -446,14 +446,14 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
home:
TabsFabDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
labeledTapTargetGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
});
testWidgets
(
'text_form_field_demo'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
TextFormFieldDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
labeledTapTargetGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
});
testWidgets
(
'tooltip_demo'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
...
...
@@ -503,7 +503,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
theme
,
home:
BottomAppBarDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
// https://github.com/flutter/flutter/issues/21651
}
);
testWidgets
(
'bottom_navigation_demo
$themeName
'
,
(
WidgetTester
tester
)
async
{
final
AutomatedTestWidgetsFlutterBinding
binding
=
tester
.
binding
;
...
...
@@ -521,7 +521,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
theme
,
home:
ButtonsDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
// https://github.com/flutter/flutter/issues/21647
}
);
testWidgets
(
'cards_demo
$themeName
'
,
(
WidgetTester
tester
)
async
{
final
AutomatedTestWidgetsFlutterBinding
binding
=
tester
.
binding
;
...
...
@@ -530,7 +530,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
theme
,
home:
CardsDemo
()));
await
expectLater
(
tester
,
meetsGuideline
(
textContrastGuideline
));
handle
.
dispose
();
}
,
skip:
true
);
// https://github.com/flutter/flutter/issues/21651
}
);
testWidgets
(
'chip_demo
$themeName
'
,
(
WidgetTester
tester
)
async
{
final
AutomatedTestWidgetsFlutterBinding
binding
=
tester
.
binding
;
...
...
packages/flutter_test/lib/src/accessibility.dart
View file @
ab2d0323
...
...
@@ -142,7 +142,7 @@ class LabeledTapTargetGuideline extends AccessibilityGuideline {
result
+=
traverse
(
child
);
return
true
;
});
if
(
node
.
isMergedIntoParent
)
if
(
node
.
isMergedIntoParent
||
node
.
isInvisible
||
node
.
hasFlag
(
ui
.
SemanticsFlag
.
isHidden
)
)
return
result
;
final
SemanticsData
data
=
node
.
getSemanticsData
();
// Skip node if it has no actions, or is marked as hidden.
...
...
@@ -203,9 +203,11 @@ class MinimumTextContrastGuideline extends AccessibilityGuideline {
});
Future
<
Evaluation
>
evaluateNode
(
SemanticsNode
node
)
async
{
Evaluation
result
=
const
Evaluation
.
pass
();
if
(
node
.
isInvisible
||
node
.
isMergedIntoParent
||
node
.
hasFlag
(
ui
.
SemanticsFlag
.
isHidden
))
return
result
;
final
SemanticsData
data
=
node
.
getSemanticsData
();
final
List
<
SemanticsNode
>
children
=
<
SemanticsNode
>[];
Evaluation
result
=
const
Evaluation
.
pass
();
node
.
visitChildren
((
SemanticsNode
child
)
{
children
.
add
(
child
);
return
true
;
...
...
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