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
0367d4f5
Unverified
Commit
0367d4f5
authored
Aug 03, 2020
by
Darren Austin
Committed by
GitHub
Aug 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test lifecycle clean up for screen size and semantics. (#62761)
parent
26f976f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
date_picker_test.dart
packages/flutter/test/material/date_picker_test.dart
+5
-10
date_picker_test.dart
...flutter_localizations/test/material/date_picker_test.dart
+2
-0
No files found.
packages/flutter/test/material/date_picker_test.dart
View file @
0367d4f5
...
...
@@ -884,6 +884,7 @@ void main() {
group
(
'Semantics'
,
()
{
testWidgets
(
'calendar day mode'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
semantics
=
tester
.
ensureSemantics
();
addTearDown
(
semantics
.
dispose
);
await
prepareDatePicker
(
tester
,
(
Future
<
DateTime
>
date
)
async
{
// Header
...
...
@@ -1096,12 +1097,11 @@ void main() {
isFocusable:
true
,
));
});
semantics
.
dispose
();
});
testWidgets
(
'calendar year mode'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
semantics
=
tester
.
ensureSemantics
();
addTearDown
(
semantics
.
dispose
);
initialCalendarMode
=
DatePickerMode
.
year
;
await
prepareDatePicker
(
tester
,
(
Future
<
DateTime
>
date
)
async
{
...
...
@@ -1153,14 +1153,12 @@ void main() {
hasEnabledState:
true
,
isFocusable:
true
,
));
});
semantics
.
dispose
();
});
testWidgets
(
'input mode'
,
(
WidgetTester
tester
)
async
{
final
SemanticsHandle
semantics
=
tester
.
ensureSemantics
();
addTearDown
(
semantics
.
dispose
);
initialEntryMode
=
DatePickerEntryMode
.
input
;
await
prepareDatePicker
(
tester
,
(
Future
<
DateTime
>
date
)
async
{
...
...
@@ -1211,10 +1209,7 @@ void main() {
hasEnabledState:
true
,
isFocusable:
true
,
));
});
semantics
.
dispose
();
});
});
...
...
@@ -1416,9 +1411,9 @@ void main() {
Future
<
void
>
_showPicker
(
WidgetTester
tester
,
Size
size
,
[
double
textScaleFactor
=
1.0
])
async
{
tester
.
binding
.
window
.
physicalSizeTestValue
=
size
;
addTearDown
(
tester
.
binding
.
window
.
clearPhysicalSizeTestValue
);
tester
.
binding
.
window
.
devicePixelRatioTestValue
=
1.0
;
tester
.
binding
.
window
.
clearPhysicalSizeTestValue
();
tester
.
binding
.
window
.
clearDevicePixelRatioTestValue
();
addTearDown
(
tester
.
binding
.
window
.
clearDevicePixelRatioTestValue
);
await
prepareDatePicker
(
tester
,
(
Future
<
DateTime
>
date
)
async
{
await
tester
.
tap
(
find
.
text
(
'OK'
));
});
...
...
packages/flutter_localizations/test/material/date_picker_test.dart
View file @
0367d4f5
...
...
@@ -232,7 +232,9 @@ void main() {
Future
<
void
>
_showPicker
(
WidgetTester
tester
,
Locale
locale
,
Size
size
)
async
{
tester
.
binding
.
window
.
physicalSizeTestValue
=
size
;
addTearDown
(
tester
.
binding
.
window
.
clearPhysicalSizeTestValue
);
tester
.
binding
.
window
.
devicePixelRatioTestValue
=
1.0
;
addTearDown
(
tester
.
binding
.
window
.
clearDevicePixelRatioTestValue
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Builder
(
...
...
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