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:
-
bin/**
-
.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
recipe
:
devicelab/devicelab_drone
presubmit
:
false
...
...
TESTOWNERS
View file @
59859df1
...
...
@@ -199,6 +199,7 @@
/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/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
# 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) {
DeviceDiscovery
get
devices
=>
DeviceDiscovery
();
/// 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.
DeviceOperatingSystem
deviceOperatingSystem
=
DeviceOperatingSystem
.
android
;
...
...
@@ -71,6 +71,8 @@ abstract class DeviceDiscovery {
return
IosDeviceDiscovery
();
case
DeviceOperatingSystem
.
fuchsia
:
return
FuchsiaDeviceDiscovery
();
case
DeviceOperatingSystem
.
windows
:
return
WindowsDeviceDiscovery
();
case
DeviceOperatingSystem
.
fake
:
print
(
'Looking for fake devices! You should not see this in release builds.'
);
return
FakeDeviceDiscovery
();
...
...
@@ -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
{
factory
FuchsiaDeviceDiscovery
()
{
return
_instance
??=
FuchsiaDeviceDiscovery
.
_
();
...
...
@@ -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.
class
FuchsiaDevice
extends
Device
{
const
FuchsiaDevice
({
required
this
.
deviceId
});
...
...
dev/devicelab/lib/tasks/perf_tests.dart
View file @
59859df1
...
...
@@ -615,6 +615,7 @@ class StartupTest {
]);
applicationBinaryPath
=
_findIosAppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
break
;
case
DeviceOperatingSystem
.
windows
:
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fake
:
break
;
...
...
@@ -730,6 +731,7 @@ class DevtoolsStartupTest {
]);
applicationBinaryPath
=
_findIosAppInBuildDirectory
(
'
$testDirectory
/build/ios/iphoneos'
);
break
;
case
DeviceOperatingSystem
.
windows
:
case
DeviceOperatingSystem
.
fuchsia
:
case
DeviceOperatingSystem
.
fake
:
break
;
...
...
@@ -1307,6 +1309,8 @@ class CompileTest {
if
(
reportPackageContentSizes
)
metrics
.
addAll
(
await
getSizesFromApk
(
apkPath
));
break
;
case
DeviceOperatingSystem
.
windows
:
throw
Exception
(
'Unsupported option for Windows devices'
);
case
DeviceOperatingSystem
.
fuchsia
:
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
case
DeviceOperatingSystem
.
fake
:
...
...
@@ -1343,6 +1347,8 @@ class CompileTest {
options
.
insert
(
0
,
'apk'
);
options
.
add
(
'--target-platform=android-arm64'
);
break
;
case
DeviceOperatingSystem
.
windows
:
throw
Exception
(
'Unsupported option for Windows devices'
);
case
DeviceOperatingSystem
.
fuchsia
:
throw
Exception
(
'Unsupported option for Fuchsia devices'
);
case
DeviceOperatingSystem
.
fake
:
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
59859df1
...
...
@@ -214,7 +214,7 @@ class DriveCommand extends RunCommandBase {
throwToolExit
(
null
);
}
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
;
...
...
@@ -359,6 +359,9 @@ class DriveCommand extends RunCommandBase {
}
Future
<
void
>
_takeScreenshot
(
Device
device
)
async
{
if
(!
device
.
supportsScreenshot
)
{
return
;
}
try
{
final
Directory
outputDirectory
=
_fileSystem
.
directory
(
screenshot
)
..
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart
View file @
59859df1
...
...
@@ -45,6 +45,38 @@ void main() {
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
{
final
DriveCommand
command
=
DriveCommand
(
fileSystem:
fileSystem
,
logger:
logger
,
platform:
platform
);
fileSystem
.
file
(
'lib/main.dart'
).
createSync
(
recursive:
true
);
...
...
@@ -214,7 +246,7 @@ class ScreenshotDevice extends Fake implements Device {
Future
<
TargetPlatform
>
get
targetPlatform
async
=>
TargetPlatform
.
android
;
@override
final
bool
supportsScreenshot
=
true
;
bool
supportsScreenshot
=
true
;
@override
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