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
12b7355d
Unverified
Commit
12b7355d
authored
Aug 29, 2020
by
Ming Lyu (CareF)
Committed by
GitHub
Aug 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A benchmark test case for measuring scroll smoothness (#61998)
parent
1d7838a8
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
397 additions
and
3 deletions
+397
-3
settings.gradle
dev/benchmarks/complex_layout/android/settings.gradle
+10
-0
main.dart
dev/benchmarks/complex_layout/lib/main.dart
+1
-0
pubspec.yaml
dev/benchmarks/complex_layout/pubspec.yaml
+3
-2
measure_scroll_smoothness.dart
...hmarks/complex_layout/test/measure_scroll_smoothness.dart
+296
-0
measure_scroll_smoothness_test.dart
...ex_layout/test_driver/measure_scroll_smoothness_test.dart
+17
-0
complex_layout_android__scroll_smoothness.dart
.../bin/tasks/complex_layout_android__scroll_smoothness.dart
+14
-0
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+48
-0
manifest.yaml
dev/devicelab/manifest.yaml
+8
-0
binding.dart
packages/flutter_test/lib/src/binding.dart
+0
-1
No files found.
dev/benchmarks/complex_layout/android/settings.gradle
View file @
12b7355d
...
...
@@ -3,3 +3,13 @@
// found in the LICENSE file.
include
':app'
def
localPropertiesFile
=
new
File
(
rootProject
.
projectDir
,
"local.properties"
)
def
properties
=
new
Properties
()
assert
localPropertiesFile
.
exists
()
localPropertiesFile
.
withReader
(
"UTF-8"
)
{
reader
->
properties
.
load
(
reader
)
}
def
flutterSdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
assert
flutterSdkPath
!=
null
,
"flutter.sdk not set in local.properties"
apply
from:
"$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
dev/benchmarks/complex_layout/lib/main.dart
View file @
12b7355d
...
...
@@ -109,6 +109,7 @@ class ComplexLayoutState extends State<ComplexLayout> {
Expanded
(
child:
ListView
.
builder
(
key:
const
Key
(
'complex-scroll'
),
// this key is used by the driver test
controller:
ScrollController
(),
// So that the scroll offset can be tracked
itemBuilder:
(
BuildContext
context
,
int
index
)
{
if
(
index
%
2
==
0
)
return
FancyImageItem
(
index
,
key:
PageStorageKey
<
int
>(
index
));
...
...
dev/benchmarks/complex_layout/pubspec.yaml
View file @
12b7355d
...
...
@@ -3,7 +3,7 @@ description: A benchmark of a relatively complex layout.
environment
:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk
:
"
>=2.
0.0-dev.68.0
<3.0.0"
sdk
:
"
>=2.
2.2
<3.0.0"
dependencies
:
flutter
:
...
...
@@ -46,6 +46,7 @@ dev_dependencies:
flutter_test
:
sdk
:
flutter
test
:
1.16.0-nullsafety.1
e2e
:
0.7.0
_fe_analyzer_shared
:
7.0.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
analyzer
:
0.39.17
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -90,4 +91,4 @@ flutter:
-
packages/flutter_gallery_assets/people/square/ali.png
-
packages/flutter_gallery_assets/places/india_chettinad_silk_maker.png
# PUBSPEC CHECKSUM:
6832
# PUBSPEC CHECKSUM:
047d
dev/benchmarks/complex_layout/test/measure_scroll_smoothness.dart
0 → 100644
View file @
12b7355d
This diff is collapsed.
Click to expand it.
dev/benchmarks/complex_layout/test_driver/measure_scroll_smoothness_test.dart
0 → 100644
View file @
12b7355d
// Copyright 2014 The Flutter 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:e2e/e2e_driver.dart'
as
driver
;
Future
<
void
>
main
()
=>
driver
.
e2eDriver
(
timeout:
const
Duration
(
minutes:
5
),
responseDataCallback:
(
Map
<
String
,
dynamic
>
data
)
async
{
await
driver
.
writeResponseData
(
data
,
testOutputFilename:
'scroll_smoothness_test'
,
);
}
);
dev/devicelab/bin/tasks/complex_layout_android__scroll_smoothness.dart
0 → 100644
View file @
12b7355d
// Copyright 2014 The Flutter 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_devicelab/tasks/perf_tests.dart'
;
import
'package:flutter_devicelab/framework/adb.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
await
task
(
createsScrollSmoothnessPerfTest
());
}
dev/devicelab/lib/tasks/perf_tests.dart
View file @
12b7355d
...
...
@@ -298,6 +298,54 @@ TaskFunction createsMultiWidgetConstructPerfE2ETest() {
).
run
;
}
TaskFunction
createsScrollSmoothnessPerfTest
(
)
{
final
String
testDirectory
=
'
${flutterDirectory.path}
/dev/benchmarks/complex_layout'
;
const
String
testTarget
=
'test/measure_scroll_smoothness.dart'
;
return
()
{
return
inDirectory
<
TaskResult
>(
testDirectory
,
()
async
{
final
Device
device
=
await
devices
.
workingDevice
;
await
device
.
unlock
();
final
String
deviceId
=
device
.
deviceId
;
await
flutter
(
'packages'
,
options:
<
String
>[
'get'
]);
await
flutter
(
'drive'
,
options:
<
String
>[
'-v'
,
'--verbose-system-logs'
,
'--profile'
,
'-t'
,
testTarget
,
'-d'
,
deviceId
,
]);
final
Map
<
String
,
dynamic
>
data
=
json
.
decode
(
file
(
'
$testDirectory
/build/scroll_smoothness_test.json'
).
readAsStringSync
(),
)
as
Map
<
String
,
dynamic
>;
final
Map
<
String
,
dynamic
>
result
=
<
String
,
dynamic
>{};
void
addResult
(
dynamic
data
,
String
suffix
)
{
assert
(
data
is
Map
<
String
,
dynamic
>);
const
List
<
String
>
metricKeys
=
<
String
>[
'janky_count'
,
'average_abs_jerk'
,
'dropped_frame_count'
,
];
for
(
final
String
key
in
metricKeys
)
{
result
[
key
+
suffix
]
=
data
[
key
];
}
}
addResult
(
data
[
'resample on with 90Hz input'
],
'_with_resampler_90Hz'
);
addResult
(
data
[
'resample on with 59Hz input'
],
'_with_resampler_59Hz'
);
addResult
(
data
[
'resample off with 90Hz input'
],
'_without_resampler_90Hz'
);
addResult
(
data
[
'resample off with 59Hz input'
],
'_without_resampler_59Hz'
);
return
TaskResult
.
success
(
result
,
benchmarkScoreKeys:
result
.
keys
.
toList
(),
);
});
};
}
TaskFunction
createFramePolicyIntegrationTest
(
)
{
final
String
testDirectory
=
'
${flutterDirectory.path}
/dev/benchmarks/macrobenchmarks'
;
...
...
dev/devicelab/manifest.yaml
View file @
12b7355d
...
...
@@ -114,6 +114,14 @@ tasks:
# Android on-device tests
complex_layout_android__scroll_smoothness
:
description
:
>
Measures the smoothness of scrolling of the Complex Layout sample app on
Android.
stage
:
devicelab
required_agent_capabilities
:
[
"
linux/android"
]
flaky
:
true
complex_layout_scroll_perf__timeline_summary
:
description
:
>
Measures the runtime performance of the Complex Layout sample app on
...
...
packages/flutter_test/lib/src/binding.dart
View file @
12b7355d
...
...
@@ -1504,7 +1504,6 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
renderView
.
_pointers
[
event
.
pointer
].
decay
=
_kPointerDecay
;
_handleViewNeedsPaint
();
}
else
if
(
event
.
down
)
{
assert
(
event
is
PointerDownEvent
);
renderView
.
_pointers
[
event
.
pointer
]
=
_LiveTestPointerRecord
(
event
.
pointer
,
event
.
position
,
...
...
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