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
20f029e3
Unverified
Commit
20f029e3
authored
May 03, 2022
by
Phil Quitslund
Committed by
GitHub
May 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[devicelab, flutter_test, ...] rename local functions with `_`s (#102833)
parent
adb8b607
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
101 deletions
+101
-101
microbenchmarks.dart
dev/devicelab/lib/tasks/microbenchmarks.dart
+18
-18
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+14
-14
date_picker_test.dart
...flutter_localizations/test/material/date_picker_test.dart
+5
-5
accessibility.dart
packages/flutter_test/lib/src/accessibility.dart
+2
-2
event_simulation.dart
packages/flutter_test/lib/src/event_simulation.dart
+9
-9
accessibility_test.dart
packages/flutter_test/test/accessibility_test.dart
+53
-53
No files found.
dev/devicelab/lib/tasks/microbenchmarks.dart
View file @
20f029e3
...
...
@@ -21,8 +21,8 @@ TaskFunction createMicrobenchmarkTask() {
await
device
.
unlock
();
await
device
.
clearLogs
();
Future
<
Map
<
String
,
double
>>
_
runMicrobench
(
String
benchmarkPath
)
async
{
Future
<
Map
<
String
,
double
>>
_
run
()
async
{
Future
<
Map
<
String
,
double
>>
runMicrobench
(
String
benchmarkPath
)
async
{
Future
<
Map
<
String
,
double
>>
run
()
async
{
print
(
'Running
$benchmarkPath
'
);
final
Directory
appDir
=
dir
(
path
.
join
(
flutterDirectory
.
path
,
'dev/benchmarks/microbenchmarks'
));
...
...
@@ -45,25 +45,25 @@ TaskFunction createMicrobenchmarkTask() {
return
readJsonResults
(
flutterProcess
);
}
return
_
run
();
return
run
();
}
final
Map
<
String
,
double
>
allResults
=
<
String
,
double
>{
...
await
_
runMicrobench
(
'lib/stocks/layout_bench.dart'
),
...
await
_
runMicrobench
(
'lib/stocks/build_bench.dart'
),
...
await
_
runMicrobench
(
'lib/geometry/matrix_utils_transform_bench.dart'
),
...
await
_
runMicrobench
(
'lib/geometry/rrect_contains_bench.dart'
),
...
await
_
runMicrobench
(
'lib/gestures/velocity_tracker_bench.dart'
),
...
await
_
runMicrobench
(
'lib/gestures/gesture_detector_bench.dart'
),
...
await
_
runMicrobench
(
'lib/stocks/animation_bench.dart'
),
...
await
_
runMicrobench
(
'lib/language/compute_bench.dart'
),
...
await
_
runMicrobench
(
'lib/language/sync_star_bench.dart'
),
...
await
_
runMicrobench
(
'lib/language/sync_star_semantics_bench.dart'
),
...
await
_
runMicrobench
(
'lib/foundation/all_elements_bench.dart'
),
...
await
_
runMicrobench
(
'lib/foundation/change_notifier_bench.dart'
),
...
await
_
runMicrobench
(
'lib/foundation/standard_method_codec_bench.dart'
),
...
await
_
runMicrobench
(
'lib/foundation/standard_message_codec_bench.dart'
),
...
await
_
runMicrobench
(
'lib/foundation/timeline_bench.dart'
),
...
await
runMicrobench
(
'lib/stocks/layout_bench.dart'
),
...
await
runMicrobench
(
'lib/stocks/build_bench.dart'
),
...
await
runMicrobench
(
'lib/geometry/matrix_utils_transform_bench.dart'
),
...
await
runMicrobench
(
'lib/geometry/rrect_contains_bench.dart'
),
...
await
runMicrobench
(
'lib/gestures/velocity_tracker_bench.dart'
),
...
await
runMicrobench
(
'lib/gestures/gesture_detector_bench.dart'
),
...
await
runMicrobench
(
'lib/stocks/animation_bench.dart'
),
...
await
runMicrobench
(
'lib/language/compute_bench.dart'
),
...
await
runMicrobench
(
'lib/language/sync_star_bench.dart'
),
...
await
runMicrobench
(
'lib/language/sync_star_semantics_bench.dart'
),
...
await
runMicrobench
(
'lib/foundation/all_elements_bench.dart'
),
...
await
runMicrobench
(
'lib/foundation/change_notifier_bench.dart'
),
...
await
runMicrobench
(
'lib/foundation/standard_method_codec_bench.dart'
),
...
await
runMicrobench
(
'lib/foundation/standard_message_codec_bench.dart'
),
...
await
runMicrobench
(
'lib/foundation/timeline_bench.dart'
),
};
return
TaskResult
.
success
(
allResults
,
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
20f029e3
...
...
@@ -2636,7 +2636,7 @@ void main() {
}
group
(
'SliverAppBar'
,
()
{
Widget
_
buildSliverApp
({
Widget
buildSliverApp
({
required
double
contentHeight
,
bool
reverse
=
false
,
bool
includeFlexibleSpace
=
false
,
...
...
@@ -2674,7 +2674,7 @@ void main() {
testWidgets
(
'backgroundColor'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildSliverApp
(
contentHeight:
1200.0
)
buildSliverApp
(
contentHeight:
1200.0
)
);
expect
(
getAppBarBackgroundColor
(
tester
),
defaultColor
);
...
...
@@ -2699,7 +2699,7 @@ void main() {
testWidgets
(
'backgroundColor with FlexibleSpace'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildSliverApp
(
contentHeight:
1200.0
,
includeFlexibleSpace:
true
)
buildSliverApp
(
contentHeight:
1200.0
,
includeFlexibleSpace:
true
)
);
expect
(
getAppBarBackgroundColor
(
tester
),
defaultColor
);
...
...
@@ -2724,7 +2724,7 @@ void main() {
testWidgets
(
'backgroundColor - reverse'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildSliverApp
(
contentHeight:
1200.0
,
reverse:
true
)
buildSliverApp
(
contentHeight:
1200.0
,
reverse:
true
)
);
expect
(
getAppBarBackgroundColor
(
tester
),
defaultColor
);
...
...
@@ -2749,7 +2749,7 @@ void main() {
testWidgets
(
'backgroundColor with FlexibleSpace - reverse'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildSliverApp
(
buildSliverApp
(
contentHeight:
1200.0
,
reverse:
true
,
includeFlexibleSpace:
true
,
...
...
@@ -2778,7 +2778,7 @@ void main() {
testWidgets
(
'backgroundColor - not triggered in reverse for short content'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildSliverApp
(
contentHeight:
200
,
reverse:
true
)
buildSliverApp
(
contentHeight:
200
,
reverse:
true
)
);
// In reverse, the content here is not long enough to scroll under the app
...
...
@@ -2797,7 +2797,7 @@ void main() {
testWidgets
(
'backgroundColor with FlexibleSpace - not triggered in reverse for short content'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildSliverApp
(
buildSliverApp
(
contentHeight:
200
,
reverse:
true
,
includeFlexibleSpace:
true
,
...
...
@@ -2820,7 +2820,7 @@ void main() {
});
group
(
'AppBar'
,
()
{
Widget
_
buildAppBar
({
Widget
buildAppBar
({
required
double
contentHeight
,
bool
reverse
=
false
,
bool
includeFlexibleSpace
=
false
...
...
@@ -2851,7 +2851,7 @@ void main() {
testWidgets
(
'backgroundColor'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildAppBar
(
contentHeight:
1200.0
)
buildAppBar
(
contentHeight:
1200.0
)
);
expect
(
getAppBarBackgroundColor
(
tester
),
defaultColor
);
...
...
@@ -2876,7 +2876,7 @@ void main() {
testWidgets
(
'backgroundColor with FlexibleSpace'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildAppBar
(
contentHeight:
1200.0
,
includeFlexibleSpace:
true
)
buildAppBar
(
contentHeight:
1200.0
,
includeFlexibleSpace:
true
)
);
expect
(
getAppBarBackgroundColor
(
tester
),
defaultColor
);
...
...
@@ -2901,7 +2901,7 @@ void main() {
testWidgets
(
'backgroundColor - reverse'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildAppBar
(
contentHeight:
1200.0
,
reverse:
true
)
buildAppBar
(
contentHeight:
1200.0
,
reverse:
true
)
);
await
tester
.
pump
();
...
...
@@ -2929,7 +2929,7 @@ void main() {
testWidgets
(
'backgroundColor with FlexibleSpace - reverse'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildAppBar
(
buildAppBar
(
contentHeight:
1200.0
,
reverse:
true
,
includeFlexibleSpace:
true
,
...
...
@@ -3027,7 +3027,7 @@ void main() {
testWidgets
(
'backgroundColor - not triggered in reverse for short content'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildAppBar
(
buildAppBar
(
contentHeight:
200.0
,
reverse:
true
,
)
...
...
@@ -3050,7 +3050,7 @@ void main() {
testWidgets
(
'backgroundColor with FlexibleSpace - not triggered in reverse for short content'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_
buildAppBar
(
buildAppBar
(
contentHeight:
200.0
,
reverse:
true
,
includeFlexibleSpace:
true
,
...
...
packages/flutter_localizations/test/material/date_picker_test.dart
View file @
20f029e3
...
...
@@ -226,7 +226,7 @@ void main() {
const
Size
kCommonScreenSizePortrait
=
Size
(
1070
,
1770
);
const
Size
kCommonScreenSizeLandscape
=
Size
(
1770
,
1070
);
Future
<
void
>
_
showPicker
(
WidgetTester
tester
,
Locale
locale
,
Size
size
)
async
{
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
;
...
...
@@ -260,22 +260,22 @@ void main() {
// Regression test for https://github.com/flutter/flutter/issues/20171
testWidgets
(
'common screen size - portrait - Chinese'
,
(
WidgetTester
tester
)
async
{
await
_
showPicker
(
tester
,
const
Locale
(
'zh'
,
'CN'
),
kCommonScreenSizePortrait
);
await
showPicker
(
tester
,
const
Locale
(
'zh'
,
'CN'
),
kCommonScreenSizePortrait
);
expect
(
tester
.
takeException
(),
isNull
);
});
testWidgets
(
'common screen size - landscape - Chinese'
,
(
WidgetTester
tester
)
async
{
await
_
showPicker
(
tester
,
const
Locale
(
'zh'
,
'CN'
),
kCommonScreenSizeLandscape
);
await
showPicker
(
tester
,
const
Locale
(
'zh'
,
'CN'
),
kCommonScreenSizeLandscape
);
expect
(
tester
.
takeException
(),
isNull
);
});
testWidgets
(
'common screen size - portrait - Japanese'
,
(
WidgetTester
tester
)
async
{
await
_
showPicker
(
tester
,
const
Locale
(
'ja'
,
'JA'
),
kCommonScreenSizePortrait
);
await
showPicker
(
tester
,
const
Locale
(
'ja'
,
'JA'
),
kCommonScreenSizePortrait
);
expect
(
tester
.
takeException
(),
isNull
);
});
testWidgets
(
'common screen size - landscape - Japanese'
,
(
WidgetTester
tester
)
async
{
await
_
showPicker
(
tester
,
const
Locale
(
'ja'
,
'JA'
),
kCommonScreenSizeLandscape
);
await
showPicker
(
tester
,
const
Locale
(
'ja'
,
'JA'
),
kCommonScreenSizeLandscape
);
expect
(
tester
.
takeException
(),
isNull
);
});
});
...
...
packages/flutter_test/lib/src/accessibility.dart
View file @
20f029e3
...
...
@@ -638,7 +638,7 @@ Map<Color, int> _colorsWithinRect(
final
Map
<
int
,
int
>
rgbaToCount
=
<
int
,
int
>{};
int
_
getPixel
(
ByteData
data
,
int
x
,
int
y
)
{
int
getPixel
(
ByteData
data
,
int
x
,
int
y
)
{
final
int
offset
=
(
y
*
width
+
x
)
*
4
;
return
data
.
getUint32
(
offset
);
}
...
...
@@ -646,7 +646,7 @@ Map<Color, int> _colorsWithinRect(
for
(
int
x
=
leftX
;
x
<
rightX
;
x
++)
{
for
(
int
y
=
topY
;
y
<
bottomY
;
y
++)
{
rgbaToCount
.
update
(
_
getPixel
(
data
,
x
,
y
),
getPixel
(
data
,
x
,
y
),
(
int
count
)
=>
count
+
1
,
ifAbsent:
()
=>
1
,
);
...
...
packages/flutter_test/lib/src/event_simulation.dart
View file @
20f029e3
...
...
@@ -757,7 +757,7 @@ class KeyEventSimulator {
PhysicalKeyboardKey
?
physicalKey
,
String
?
character
,
})
async
{
Future
<
bool
>
_
simulateByRawEvent
()
{
Future
<
bool
>
simulateByRawEvent
()
{
return
_simulateKeyEventByRawEvent
(()
{
platform
??=
_defaultPlatform
;
return
getKeyData
(
key
,
platform:
platform
!,
physicalKey:
physicalKey
,
character:
character
);
...
...
@@ -765,7 +765,7 @@ class KeyEventSimulator {
}
switch
(
_transitMode
)
{
case
KeyDataTransitMode
.
rawKeyData
:
return
_
simulateByRawEvent
();
return
simulateByRawEvent
();
case
KeyDataTransitMode
.
keyDataThenRawKeyData
:
final
LogicalKeyboardKey
logicalKey
=
_getKeySynonym
(
key
);
final
bool
resultByKeyEvent
=
ServicesBinding
.
instance
.
keyEventManager
.
handleKeyData
(
...
...
@@ -778,7 +778,7 @@ class KeyEventSimulator {
synthesized:
false
,
),
);
return
(
await
_
simulateByRawEvent
())
||
resultByKeyEvent
;
return
(
await
simulateByRawEvent
())
||
resultByKeyEvent
;
}
}
...
...
@@ -802,7 +802,7 @@ class KeyEventSimulator {
String
?
platform
,
PhysicalKeyboardKey
?
physicalKey
,
})
async
{
Future
<
bool
>
_
simulateByRawEvent
()
{
Future
<
bool
>
simulateByRawEvent
()
{
return
_simulateKeyEventByRawEvent
(()
{
platform
??=
_defaultPlatform
;
return
getKeyData
(
key
,
platform:
platform
!,
isDown:
false
,
physicalKey:
physicalKey
);
...
...
@@ -810,7 +810,7 @@ class KeyEventSimulator {
}
switch
(
_transitMode
)
{
case
KeyDataTransitMode
.
rawKeyData
:
return
_
simulateByRawEvent
();
return
simulateByRawEvent
();
case
KeyDataTransitMode
.
keyDataThenRawKeyData
:
final
LogicalKeyboardKey
logicalKey
=
_getKeySynonym
(
key
);
final
bool
resultByKeyEvent
=
ServicesBinding
.
instance
.
keyEventManager
.
handleKeyData
(
...
...
@@ -823,7 +823,7 @@ class KeyEventSimulator {
synthesized:
false
,
),
);
return
(
await
_
simulateByRawEvent
())
||
resultByKeyEvent
;
return
(
await
simulateByRawEvent
())
||
resultByKeyEvent
;
}
}
...
...
@@ -848,7 +848,7 @@ class KeyEventSimulator {
PhysicalKeyboardKey
?
physicalKey
,
String
?
character
,
})
async
{
Future
<
bool
>
_
simulateByRawEvent
()
{
Future
<
bool
>
simulateByRawEvent
()
{
return
_simulateKeyEventByRawEvent
(()
{
platform
??=
_defaultPlatform
;
return
getKeyData
(
key
,
platform:
platform
!,
physicalKey:
physicalKey
,
character:
character
);
...
...
@@ -856,7 +856,7 @@ class KeyEventSimulator {
}
switch
(
_transitMode
)
{
case
KeyDataTransitMode
.
rawKeyData
:
return
_
simulateByRawEvent
();
return
simulateByRawEvent
();
case
KeyDataTransitMode
.
keyDataThenRawKeyData
:
final
LogicalKeyboardKey
logicalKey
=
_getKeySynonym
(
key
);
final
bool
resultByKeyEvent
=
ServicesBinding
.
instance
.
keyEventManager
.
handleKeyData
(
...
...
@@ -869,7 +869,7 @@ class KeyEventSimulator {
synthesized:
false
,
),
);
return
(
await
_
simulateByRawEvent
())
||
resultByKeyEvent
;
return
(
await
simulateByRawEvent
())
||
resultByKeyEvent
;
}
}
}
...
...
packages/flutter_test/test/accessibility_test.dart
View file @
20f029e3
This diff is collapsed.
Click to expand it.
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