Add Windows performance benchmark (#99564)

This commit is contained in:
Jonah Williams
2022-03-04 15:41:14 -08:00
committed by GitHub
parent 4b902c79ce
commit 59859df126
7 changed files with 154 additions and 3 deletions

View File

@@ -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(