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
3fcc1069
Unverified
Commit
3fcc1069
authored
Aug 23, 2018
by
Hans Muller
Committed by
GitHub
Aug 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the memory_nav benchmark a little more robust (#20938)
parent
be601c26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
memory_nav.dart
examples/flutter_gallery/test_memory/memory_nav.dart
+15
-1
No files found.
examples/flutter_gallery/test_memory/memory_nav.dart
View file @
3fcc1069
...
...
@@ -17,6 +17,11 @@ Future<void> endOfAnimation() async {
}
while
(
SchedulerBinding
.
instance
.
hasScheduledFrame
);
}
Rect
boundsFor
(
WidgetController
controller
,
Finder
item
)
{
final
RenderBox
box
=
controller
.
renderObject
<
RenderBox
>(
item
);
return
box
.
localToGlobal
(
Offset
.
zero
)
&
box
.
size
;
}
Future
<
void
>
main
()
async
{
MaterialPageRoute
.
debugEnableFadingRoutes
=
true
;
// ignore: deprecated_member_use
final
Completer
<
void
>
ready
=
new
Completer
<
void
>();
...
...
@@ -59,12 +64,21 @@ Future<void> main() async {
await
new
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
20
));
}
while
(!
demoItem
.
precache
());
// Ensure that the center of the "Text fields" item is visible
// because that's where we're going to tap
final
Rect
demoItemBounds
=
boundsFor
(
controller
,
demoItem
);
final
Rect
demoListBounds
=
boundsFor
(
controller
,
demoList
);
if
(!
demoListBounds
.
contains
(
demoItemBounds
.
center
))
{
await
controller
.
drag
(
demoList
,
new
Offset
(
0.0
,
demoListBounds
.
center
.
dy
-
demoItemBounds
.
center
.
dy
));
await
endOfAnimation
();
}
for
(
int
iteration
=
0
;
iteration
<
15
;
iteration
+=
1
)
{
debugPrint
(
'Tapping... (iteration
$iteration
)'
);
await
controller
.
tap
(
demoItem
);
await
endOfAnimation
();
debugPrint
(
'Backing out...'
);
await
controller
.
tap
(
find
.
byTooltip
(
'Back'
)
.
last
);
await
controller
.
tap
(
find
.
byTooltip
(
'Back'
));
await
endOfAnimation
();
}
...
...
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