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
59859df1
Unverified
Commit
59859df1
authored
Mar 04, 2022
by
Jonah Williams
Committed by
GitHub
Mar 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Windows performance benchmark (#99564)
parent
4b902c79
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
154 additions
and
3 deletions
+154
-3
.ci.yaml
.ci.yaml
+11
-0
TESTOWNERS
TESTOWNERS
+1
-0
windows_home_scroll_perf__timeline_summary.dart
...bin/tasks/windows_home_scroll_perf__timeline_summary.dart
+12
-0
devices.dart
dev/devicelab/lib/framework/devices.dart
+87
-1
perf_tests.dart
dev/devicelab/lib/tasks/perf_tests.dart
+6
-0
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+4
-1
drive_test.dart
...lutter_tools/test/commands.shard/hermetic/drive_test.dart
+33
-1
No files found.
.ci.yaml
View file @
59859df1
...
@@ -4403,6 +4403,17 @@ targets:
...
@@ -4403,6 +4403,17 @@ targets:
-
bin/**
-
bin/**
-
.ci.yaml
-
.ci.yaml
-
name
:
Windows windows_home_scroll_perf__timeline_summary
recipe
:
devicelab/devicelab_drone
bringup
:
true
timeout
:
60
properties
:
tags
:
>
["devicelab","hostonly"]
task_name
:
windows_home_scroll_perf__timeline_summary
benchmark
:
"
true"
scheduler
:
luci
-
name
:
Windows_android basic_material_app_win__compile
-
name
:
Windows_android basic_material_app_win__compile
recipe
:
devicelab/devicelab_drone
recipe
:
devicelab/devicelab_drone
presubmit
:
false
presubmit
:
false
...
...
TESTOWNERS
View file @
59859df1
...
@@ -199,6 +199,7 @@
...
@@ -199,6 +199,7 @@
/dev/devicelab/bin/tasks/module_test_ios.dart @jmagman @flutter/tool
/dev/devicelab/bin/tasks/module_test_ios.dart @jmagman @flutter/tool
/dev/devicelab/bin/tasks/plugin_lint_mac.dart @stuartmorgan @flutter/plugin
/dev/devicelab/bin/tasks/plugin_lint_mac.dart @stuartmorgan @flutter/plugin
/dev/devicelab/bin/tasks/entrypoint_dart_registrant.dart @aaclarke @flutter/plugin
/dev/devicelab/bin/tasks/entrypoint_dart_registrant.dart @aaclarke @flutter/plugin
/dev/devicelab/bin/tasks/windows_home_scroll_perf__timeline_summary.dart @jonahwilliams @flutter/engine
## Host only framework tests
## Host only framework tests
# Linux analyze
# Linux analyze
...
...
dev/devicelab/bin/tasks/windows_home_scroll_perf__timeline_summary.dart
0 → 100644
View file @
59859df1
// 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
'package:flutter_devicelab/framework/devices.dart'
;
import
'package:flutter_devicelab/framework/framework.dart'
;
import
'package:flutter_devicelab/tasks/perf_tests.dart'
;
Future
<
void
>
main
()
async
{
deviceOperatingSystem
=
DeviceOperatingSystem
.
windows
;
await
task
(
createHomeScrollPerfTest
());
}
dev/devicelab/lib/framework/devices.dart
View file @
59859df1
...
@@ -52,7 +52,7 @@ String? _findMatchId(List<String> idList, String idPattern) {
...
@@ -52,7 +52,7 @@ String? _findMatchId(List<String> idList, String idPattern) {
DeviceDiscovery
get
devices
=>
DeviceDiscovery
();
DeviceDiscovery
get
devices
=>
DeviceDiscovery
();
/// Device operating system the test is configured to test.
/// Device operating system the test is configured to test.
enum
DeviceOperatingSystem
{
android
,
androidArm
,
androidArm64
,
ios
,
fuchsia
,
fake
}
enum
DeviceOperatingSystem
{
android
,
androidArm
,
androidArm64
,
ios
,
fuchsia
,
fake
,
windows
}
/// Device OS to test on.
/// Device OS to test on.
DeviceOperatingSystem
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
DeviceOperatingSystem
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
...
@@ -71,6 +71,8 @@ abstract class DeviceDiscovery {
...
@@ -71,6 +71,8 @@ abstract class DeviceDiscovery {
return
IosDeviceDiscovery
();
return
IosDeviceDiscovery
();
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fuchsia
:
return
FuchsiaDeviceDiscovery
();
return
FuchsiaDeviceDiscovery
();
case
DeviceOperatingSystem
.
windows
:
return
WindowsDeviceDiscovery
();
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fake
:
print
(
'Looking for fake devices! You should not see this in release builds.'
);
print
(
'Looking for fake devices! You should not see this in release builds.'
);
return
FakeDeviceDiscovery
();
return
FakeDeviceDiscovery
();
...
@@ -332,6 +334,41 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
...
@@ -332,6 +334,41 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
}
}
}
}
class
WindowsDeviceDiscovery
implements
DeviceDiscovery
{
factory
WindowsDeviceDiscovery
()
{
return
_instance
??=
WindowsDeviceDiscovery
.
_
();
}
WindowsDeviceDiscovery
.
_
();
static
WindowsDeviceDiscovery
?
_instance
;
static
const
WindowsDevice
_device
=
WindowsDevice
();
@override
Future
<
Map
<
String
,
HealthCheckResult
>>
checkDevices
()
async
{
return
<
String
,
HealthCheckResult
>{};
}
@override
Future
<
void
>
chooseWorkingDevice
()
async
{
}
@override
Future
<
void
>
chooseWorkingDeviceById
(
String
deviceId
)
async
{
}
@override
Future
<
List
<
String
>>
discoverDevices
()
async
{
return
<
String
>[
'windows'
];
}
@override
Future
<
void
>
performPreflightTasks
()
async
{
}
@override
Future
<
Device
>
get
workingDevice
async
=>
_device
;
}
class
FuchsiaDeviceDiscovery
implements
DeviceDiscovery
{
class
FuchsiaDeviceDiscovery
implements
DeviceDiscovery
{
factory
FuchsiaDeviceDiscovery
()
{
factory
FuchsiaDeviceDiscovery
()
{
return
_instance
??=
FuchsiaDeviceDiscovery
.
_
();
return
_instance
??=
FuchsiaDeviceDiscovery
.
_
();
...
@@ -943,6 +980,55 @@ class IosDevice extends Device {
...
@@ -943,6 +980,55 @@ class IosDevice extends Device {
}
}
}
}
class
WindowsDevice
extends
Device
{
const
WindowsDevice
();
@override
String
get
deviceId
=>
'windows'
;
@override
Future
<
Map
<
String
,
dynamic
>>
getMemoryStats
(
String
packageName
)
async
{
return
<
String
,
dynamic
>{};
}
@override
Future
<
void
>
home
()
async
{
}
@override
Future
<
bool
>
isAsleep
()
async
{
return
false
;
}
@override
Future
<
bool
>
isAwake
()
async
{
return
true
;
}
@override
Stream
<
String
>
get
logcat
=>
const
Stream
<
String
>.
empty
();
@override
Future
<
void
>
reboot
()
async
{
}
@override
Future
<
void
>
sendToSleep
()
async
{
}
@override
Future
<
void
>
stop
(
String
packageName
)
async
{
}
@override
Future
<
void
>
tap
(
int
x
,
int
y
)
async
{
}
@override
Future
<
void
>
togglePower
()
async
{
}
@override
Future
<
void
>
unlock
()
async
{
}
@override
Future
<
void
>
wakeUp
()
async
{
}
}
/// Fuchsia device.
/// Fuchsia device.
class
FuchsiaDevice
extends
Device
{
class
FuchsiaDevice
extends
Device
{
const
FuchsiaDevice
({
required
this
.
deviceId
});
const
FuchsiaDevice
({
required
this
.
deviceId
});
...
...
dev/devicelab/lib/tasks/perf_tests.dart
View file @
59859df1
...
@@ -615,6 +615,7 @@ class StartupTest {
...
@@ -615,6 +615,7 @@ class StartupTest {
]);
]);
applicationBinaryPath
=
_findIosAppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
applicationBinaryPath
=
_findIosAppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
break
;
break
;
case
DeviceOperatingSystem
.
windows
:
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fake
:
break
;
break
;
...
@@ -730,6 +731,7 @@ class DevtoolsStartupTest {
...
@@ -730,6 +731,7 @@ class DevtoolsStartupTest {
]);
]);
applicationBinaryPath
=
_findIosAppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
applicationBinaryPath
=
_findIosAppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
break
;
break
;
case
DeviceOperatingSystem
.
windows
:
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fake
:
break
;
break
;
...
@@ -1307,6 +1309,8 @@ class CompileTest {
...
@@ -1307,6 +1309,8 @@ class CompileTest {
if
(
reportPackageContentSizes
)
if
(
reportPackageContentSizes
)
metrics
.
addAll
(
await
getSizesFromApk
(
apkPath
));
metrics
.
addAll
(
await
getSizesFromApk
(
apkPath
));
break
;
break
;
case
DeviceOperatingSystem
.
windows
:
throw
Exception
(
'Unsupported option for Windows devices'
);
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fuchsia
:
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fake
:
...
@@ -1343,6 +1347,8 @@ class CompileTest {
...
@@ -1343,6 +1347,8 @@ class CompileTest {
options
.
insert
(
0
,
'apk'
);
options
.
insert
(
0
,
'apk'
);
options
.
add
(
'--target-platform=android-arm64'
);
options
.
add
(
'--target-platform=android-arm64'
);
break
;
break
;
case
DeviceOperatingSystem
.
windows
:
throw
Exception
(
'Unsupported option for Windows devices'
);
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fuchsia
:
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
case
DeviceOperatingSystem
.
fake
:
case
DeviceOperatingSystem
.
fake
:
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
59859df1
...
@@ -214,7 +214,7 @@ class DriveCommand extends RunCommandBase {
...
@@ -214,7 +214,7 @@ class DriveCommand extends RunCommandBase {
throwToolExit
(
null
);
throwToolExit
(
null
);
}
}
if
(
screenshot
!=
null
&&
!
device
.
supportsScreenshot
)
{
if
(
screenshot
!=
null
&&
!
device
.
supportsScreenshot
)
{
throwToolExit
(
'Screenshot not supported for
${device.name}
.'
);
_logger
.
printError
(
'Screenshot not supported for
${device.name}
.'
);
}
}
final
bool
web
=
device
is
WebServerDevice
||
device
is
ChromiumDevice
;
final
bool
web
=
device
is
WebServerDevice
||
device
is
ChromiumDevice
;
...
@@ -359,6 +359,9 @@ class DriveCommand extends RunCommandBase {
...
@@ -359,6 +359,9 @@ class DriveCommand extends RunCommandBase {
}
}
Future
<
void
>
_takeScreenshot
(
Device
device
)
async
{
Future
<
void
>
_takeScreenshot
(
Device
device
)
async
{
if
(!
device
.
supportsScreenshot
)
{
return
;
}
try
{
try
{
final
Directory
outputDirectory
=
_fileSystem
.
directory
(
screenshot
)
final
Directory
outputDirectory
=
_fileSystem
.
directory
(
screenshot
)
..
createSync
(
recursive:
true
);
..
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart
View file @
59859df1
...
@@ -45,6 +45,38 @@ void main() {
...
@@ -45,6 +45,38 @@ void main() {
Cache
.
enableLocking
();
Cache
.
enableLocking
();
});
});
testUsingContext
(
'warns if screenshot is not supported but continues test'
,
()
async
{
final
DriveCommand
command
=
DriveCommand
(
fileSystem:
fileSystem
,
logger:
logger
,
platform:
platform
);
fileSystem
.
file
(
'lib/main.dart'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'test_driver/main_test.dart'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'pubspec.yaml'
).
createSync
();
fileSystem
.
directory
(
'drive_screenshots'
).
createSync
();
final
Device
screenshotDevice
=
ThrowingScreenshotDevice
()
..
supportsScreenshot
=
false
;
fakeDeviceManager
.
devices
=
<
Device
>[
screenshotDevice
];
await
expectLater
(()
=>
createTestCommandRunner
(
command
).
run
(
<
String
>[
'drive'
,
'--no-pub'
,
'-d'
,
screenshotDevice
.
id
,
'--screenshot'
,
'drive_screenshots'
,
]),
throwsToolExit
(
message:
'cannot start app'
),
);
expect
(
logger
.
errorText
,
contains
(
'Screenshot not supported for FakeDevice'
));
expect
(
logger
.
statusText
,
isEmpty
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
Pub:
()
=>
FakePub
(),
DeviceManager:
()
=>
fakeDeviceManager
,
});
testUsingContext
(
'takes screenshot and rethrows on drive exception'
,
()
async
{
testUsingContext
(
'takes screenshot and rethrows on drive exception'
,
()
async
{
final
DriveCommand
command
=
DriveCommand
(
fileSystem:
fileSystem
,
logger:
logger
,
platform:
platform
);
final
DriveCommand
command
=
DriveCommand
(
fileSystem:
fileSystem
,
logger:
logger
,
platform:
platform
);
fileSystem
.
file
(
'lib/main.dart'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'lib/main.dart'
).
createSync
(
recursive:
true
);
...
@@ -214,7 +246,7 @@ class ScreenshotDevice extends Fake implements Device {
...
@@ -214,7 +246,7 @@ class ScreenshotDevice extends Fake implements Device {
Future
<
TargetPlatform
>
get
targetPlatform
async
=>
TargetPlatform
.
android
;
Future
<
TargetPlatform
>
get
targetPlatform
async
=>
TargetPlatform
.
android
;
@override
@override
final
bool
supportsScreenshot
=
true
;
bool
supportsScreenshot
=
true
;
@override
@override
Future
<
LaunchResult
>
startApp
(
Future
<
LaunchResult
>
startApp
(
...
...
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