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
6c21e436
Unverified
Commit
6c21e436
authored
Jan 05, 2022
by
Jim Graham
Committed by
GitHub
Jan 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stabilize the way we navigate multiple pages for E2E macrobenchmarks (#96157)
parent
4bb3a8af
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
67 additions
and
20 deletions
+67
-20
common.dart
dev/benchmarks/macrobenchmarks/lib/common.dart
+1
-0
opacity_peephole.dart
dev/benchmarks/macrobenchmarks/lib/src/opacity_peephole.dart
+1
-1
opacity_peephole_col_of_rows_perf_e2e.dart
...enchmarks/test/opacity_peephole_col_of_rows_perf_e2e.dart
+5
-2
opacity_peephole_fade_transition_text_perf_e2e.dart
.../test/opacity_peephole_fade_transition_text_perf_e2e.dart
+5
-2
opacity_peephole_grid_of_opacity_perf_e2e.dart
...marks/test/opacity_peephole_grid_of_opacity_perf_e2e.dart
+5
-2
opacity_peephole_one_rect_perf_e2e.dart
...robenchmarks/test/opacity_peephole_one_rect_perf_e2e.dart
+5
-2
opacity_peephole_opacity_of_grid_perf_e2e.dart
...marks/test/opacity_peephole_opacity_of_grid_perf_e2e.dart
+5
-2
util.dart
dev/benchmarks/macrobenchmarks/test/util.dart
+40
-9
No files found.
dev/benchmarks/macrobenchmarks/lib/common.dart
View file @
6c21e436
...
...
@@ -34,5 +34,6 @@ const String kOpacityPeepholeOpacityOfColOfRowsRouteName = '$kOpacityPeepholeRou
const
String
kOpacityPeepholeFadeTransitionTextRouteName
=
'
$kOpacityPeepholeRouteName
/fade_transition_text'
;
const
String
kScrollableName
=
'/macrobenchmark_listview'
;
const
String
kOpacityScrollableName
=
'
$kOpacityPeepholeRouteName
/listview'
;
const
String
kStackSizeKey
=
'stack_size'
;
dev/benchmarks/macrobenchmarks/lib/src/opacity_peephole.dart
View file @
6c21e436
...
...
@@ -17,7 +17,7 @@ class OpacityPeepholePage extends StatelessWidget {
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Opacity Peephole tests'
)),
body:
ListView
(
key:
const
Key
(
'
${kOpacityPeepholeRouteName}
_listview'
),
key:
const
Key
(
kOpacityScrollableName
),
children:
<
Widget
>[
for
(
OpacityPeepholeCase
variant
in
allOpacityPeepholeCases
)
ElevatedButton
(
...
...
dev/benchmarks/macrobenchmarks/test/opacity_peephole_col_of_rows_perf_e2e.dart
View file @
6c21e436
...
...
@@ -7,9 +7,12 @@ import 'package:macrobenchmarks/common.dart';
import
'util.dart'
;
void
main
(
)
{
macroPerfTestE2E
(
macroPerfTest
MultiPage
E2E
(
'opacity_peephole_col_of_rows_perf'
,
kOpacityPeepholeOpacityOfColOfRowsRouteName
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
kOpacityPeepholeRouteName
),
ScrollableButtonRoute
(
kOpacityScrollableName
,
kOpacityPeepholeOpacityOfColOfRowsRouteName
)
],
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
...
...
dev/benchmarks/macrobenchmarks/test/opacity_peephole_fade_transition_text_perf_e2e.dart
View file @
6c21e436
...
...
@@ -7,9 +7,12 @@ import 'package:macrobenchmarks/common.dart';
import
'util.dart'
;
void
main
(
)
{
macroPerfTestE2E
(
macroPerfTest
MultiPage
E2E
(
'opacity_peephole_fade_transition_text_perf'
,
kOpacityPeepholeFadeTransitionTextRouteName
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
kOpacityPeepholeRouteName
),
ScrollableButtonRoute
(
kOpacityScrollableName
,
kOpacityPeepholeFadeTransitionTextRouteName
)
],
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
...
...
dev/benchmarks/macrobenchmarks/test/opacity_peephole_grid_of_opacity_perf_e2e.dart
View file @
6c21e436
...
...
@@ -7,9 +7,12 @@ import 'package:macrobenchmarks/common.dart';
import
'util.dart'
;
void
main
(
)
{
macroPerfTestE2E
(
macroPerfTest
MultiPage
E2E
(
'opacity_peephole_grid_of_opacity_perf'
,
kOpacityPeepholeGridOfOpacityRouteName
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
kOpacityPeepholeRouteName
),
ScrollableButtonRoute
(
kOpacityScrollableName
,
kOpacityPeepholeGridOfOpacityRouteName
)
],
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
...
...
dev/benchmarks/macrobenchmarks/test/opacity_peephole_one_rect_perf_e2e.dart
View file @
6c21e436
...
...
@@ -7,9 +7,12 @@ import 'package:macrobenchmarks/common.dart';
import
'util.dart'
;
void
main
(
)
{
macroPerfTestE2E
(
macroPerfTest
MultiPage
E2E
(
'opacity_peephole_one_rect_perf'
,
kOpacityPeepholeOneRectRouteName
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
kOpacityPeepholeRouteName
),
ScrollableButtonRoute
(
kOpacityScrollableName
,
kOpacityPeepholeOneRectRouteName
)
],
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
...
...
dev/benchmarks/macrobenchmarks/test/opacity_peephole_opacity_of_grid_perf_e2e.dart
View file @
6c21e436
...
...
@@ -7,9 +7,12 @@ import 'package:macrobenchmarks/common.dart';
import
'util.dart'
;
void
main
(
)
{
macroPerfTestE2E
(
macroPerfTest
MultiPage
E2E
(
'opacity_peephole_opacity_of_grid_perf'
,
kOpacityPeepholeOpacityOfGridRouteName
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
kOpacityPeepholeRouteName
),
ScrollableButtonRoute
(
kOpacityScrollableName
,
kOpacityPeepholeOpacityOfGridRouteName
)
],
pageDelay:
const
Duration
(
seconds:
1
),
duration:
const
Duration
(
seconds:
10
),
);
...
...
dev/benchmarks/macrobenchmarks/test/util.dart
View file @
6c21e436
...
...
@@ -5,10 +5,18 @@
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:integration_test/integration_test.dart'
;
import
'package:macrobenchmarks/common.dart'
;
import
'package:macrobenchmarks/main.dart'
as
app
;
typedef
ControlCallback
=
Future
<
void
>
Function
(
WidgetController
controller
);
class
ScrollableButtonRoute
{
ScrollableButtonRoute
(
this
.
listViewKey
,
this
.
buttonKey
);
final
String
listViewKey
;
final
String
buttonKey
;
}
void
macroPerfTestE2E
(
String
testName
,
String
routeName
,
{
...
...
@@ -17,6 +25,19 @@ void macroPerfTestE2E(
ControlCallback
?
body
,
ControlCallback
?
setup
,
})
{
macroPerfTestMultiPageE2E
(
testName
,
<
ScrollableButtonRoute
>[
ScrollableButtonRoute
(
kScrollableName
,
routeName
),
]);
}
void
macroPerfTestMultiPageE2E
(
String
testName
,
List
<
ScrollableButtonRoute
>
routes
,
{
Duration
?
pageDelay
,
Duration
duration
=
const
Duration
(
seconds:
3
),
ControlCallback
?
body
,
ControlCallback
?
setup
,
})
{
final
WidgetsBinding
_binding
=
IntegrationTestWidgetsFlutterBinding
.
ensureInitialized
();
assert
(
_binding
is
IntegrationTestWidgetsFlutterBinding
);
final
IntegrationTestWidgetsFlutterBinding
binding
=
_binding
as
IntegrationTestWidgetsFlutterBinding
;
...
...
@@ -33,16 +54,26 @@ void macroPerfTestE2E(
// See: https://github.com/flutter/flutter/issues/19434
await
tester
.
binding
.
delayed
(
const
Duration
(
microseconds:
250
));
expect
(
routeName
,
startsWith
(
'/'
));
int
i
=
0
;
while
(
i
<
routeName
.
length
)
{
i
=
routeName
.
indexOf
(
'/'
,
i
+
1
);
if
(
i
<
0
)
{
i
=
routeName
.
length
;
}
final
Finder
button
=
find
.
byKey
(
ValueKey
<
String
>(
routeName
.
substring
(
0
,
i
)),
skipOffstage:
false
);
await
tester
.
scrollUntilVisible
(
button
,
50
);
for
(
final
ScrollableButtonRoute
route
in
routes
)
{
expect
(
route
.
listViewKey
,
startsWith
(
'/'
));
expect
(
route
.
buttonKey
,
startsWith
(
'/'
));
// Make sure each list view page is settled
await
tester
.
pumpAndSettle
();
final
Finder
listView
=
find
.
byKey
(
ValueKey
<
String
>(
route
.
listViewKey
));
// ListView is not a Scrollable, but it contains one
final
Finder
scrollable
=
find
.
descendant
(
of:
listView
,
matching:
find
.
byType
(
Scrollable
));
// scrollable should find one widget as soon as the page is loaded
expect
(
scrollable
,
findsOneWidget
);
final
Finder
button
=
find
.
byKey
(
ValueKey
<
String
>(
route
.
buttonKey
),
skipOffstage:
false
);
// button may or may not find a widget right away until we scroll to it
await
tester
.
scrollUntilVisible
(
button
,
50
,
scrollable:
scrollable
);
// After scrolling, button should find one Widget
expect
(
button
,
findsOneWidget
);
// Allow scrolling to settle
await
tester
.
pumpAndSettle
();
await
tester
.
tap
(
button
);
// Cannot be pumpAndSettle because some tests have infinite animation.
...
...
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