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
a2b704b8
Commit
a2b704b8
authored
Apr 14, 2016
by
Eric Seidel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3313 from eseidelGoogle/gallery_drive_perf
Add a basic scrolling test for the Gallery home page.
parents
f3a4f722
7ee0ee72
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
pubspec.yaml
examples/material_gallery/pubspec.yaml
+2
-0
scroll_perf.dart
examples/material_gallery/test_driver/scroll_perf.dart
+11
-0
scroll_perf_test.dart
examples/material_gallery/test_driver/scroll_perf_test.dart
+52
-0
No files found.
examples/material_gallery/pubspec.yaml
View file @
a2b704b8
...
@@ -16,3 +16,5 @@ dev_dependencies:
...
@@ -16,3 +16,5 @@ dev_dependencies:
test
:
any
# flutter_test provides the version constraints
test
:
any
# flutter_test provides the version constraints
flutter_test
:
flutter_test
:
path
:
../../packages/flutter_test
path
:
../../packages/flutter_test
flutter_driver
:
path
:
../../packages/flutter_driver
examples/material_gallery/test_driver/scroll_perf.dart
0 → 100644
View file @
a2b704b8
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:material_gallery/main.dart'
as
app
;
void
main
(
)
{
enableFlutterDriverExtension
();
app
.
main
();
}
examples/material_gallery/test_driver/scroll_perf_test.dart
0 → 100644
View file @
a2b704b8
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:test/test.dart'
;
void
main
(
)
{
group
(
'scrolling performance test'
,
()
{
FlutterDriver
driver
;
setUpAll
(()
async
{
driver
=
await
FlutterDriver
.
connect
();
});
tearDownAll
(()
async
{
if
(
driver
!=
null
)
driver
.
close
();
});
test
(
'measure'
,
()
async
{
Timeline
timeline
=
await
driver
.
traceAction
(()
async
{
// Find the scrollable stock list
ObjectRef
stockList
=
await
driver
.
findByValueKey
(
'Gallery List'
);
expect
(
stockList
,
isNotNull
);
await
driver
.
tap
(
await
driver
.
findByText
(
'Demos'
));
await
driver
.
tap
(
await
driver
.
findByText
(
'Components'
));
await
driver
.
tap
(
await
driver
.
findByText
(
'Style'
));
// TODO(eseidel): These are very artifical scrolls, we should use better
// https://github.com/flutter/flutter/issues/3316
// Scroll down
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
await
driver
.
scroll
(
stockList
,
0.0
,
-
300.0
,
new
Duration
(
milliseconds:
300
));
await
new
Future
<
Null
>.
delayed
(
new
Duration
(
milliseconds:
500
));
}
// Scroll up
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
await
driver
.
scroll
(
stockList
,
0.0
,
300.0
,
new
Duration
(
milliseconds:
300
));
await
new
Future
<
Null
>.
delayed
(
new
Duration
(
milliseconds:
500
));
}
});
new
TimelineSummary
.
summarize
(
timeline
)
..
writeSummaryToFile
(
'home_scroll_perf'
,
pretty:
true
)
..
writeTimelineToFile
(
'home_scroll_perf'
,
pretty:
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