@@ -117,14 +117,6 @@ TaskFunction createCubicBezierPerfE2ETest() {
117
117
).run;
118
118
}
119
119
120
- TaskFunction createFlutterGalleryTransitionsPerfSkSLWarmupTest () {
121
- return PerfTestWithSkSL (
122
- '${flutterDirectory .path }/dev/integration_tests/flutter_gallery' ,
123
- 'test_driver/transitions_perf.dart' ,
124
- 'transitions' ,
125
- ).run;
126
- }
127
-
128
120
TaskFunction createBackdropFilterPerfTest ({
129
121
bool measureCpuGpu = true ,
130
122
bool enableImpeller = false ,
@@ -1010,9 +1002,7 @@ class PerfTest {
1010
1002
1011
1003
@protected
1012
1004
Future <TaskResult > internalRun ({
1013
- bool cacheSkSL = false ,
1014
1005
String ? existingApp,
1015
- String ? writeSkslFileName,
1016
1006
}) {
1017
1007
return inDirectory <TaskResult >(testDirectory, () async {
1018
1008
late Device selectedDevice;
@@ -1048,9 +1038,6 @@ class PerfTest {
1048
1038
...< String > ['--driver' , testDriver! ],
1049
1039
if (existingApp != null )
1050
1040
...< String > ['--use-existing-app' , existingApp],
1051
- if (writeSkslFileName != null )
1052
- ...< String > ['--write-sksl-on-exit' , writeSkslFileName],
1053
- if (cacheSkSL) '--cache-sksl' ,
1054
1041
if (dartDefine.isNotEmpty)
1055
1042
...< String > ['--dart-define' , dartDefine],
1056
1043
if (enableImpeller) '--enable-impeller' ,
@@ -1139,149 +1126,6 @@ const List<String> _kCommonScoreKeys = <String>[
1139
1126
'old_gen_gc_count' ,
1140
1127
];
1141
1128
1142
- class PerfTestWithSkSL extends PerfTest {
1143
- PerfTestWithSkSL (
1144
- super .testDirectory,
1145
- super .testTarget,
1146
- String super .timelineFileName, {
1147
- super .measureCpuGpu = false ,
1148
- super .testDriver,
1149
- super .needsFullTimeline,
1150
- super .benchmarkScoreKeys,
1151
- });
1152
-
1153
-
1154
- PerfTestWithSkSL .e2e (
1155
- super .testDirectory,
1156
- super .testTarget, {
1157
- String super .testDriver,
1158
- super .resultFilename,
1159
- }) : super .e2e (
1160
- needsFullTimeline: false ,
1161
- );
1162
-
1163
- @override
1164
- Future <TaskResult > run ({int ? timeoutSeconds}) async {
1165
- return inDirectory <TaskResult >(testDirectory, () async {
1166
- // Some initializations
1167
- _device = await devices.workingDevice;
1168
- _flutterPath = path.join (flutterDirectory.path, 'bin' , 'flutter' );
1169
-
1170
- // Prepare the SkSL by running the driver test.
1171
- await _generateSkSL ();
1172
-
1173
- // Build the app with SkSL artifacts and run that app
1174
- final String observatoryUri = await _runApp (skslPath: _skslJsonFileName);
1175
-
1176
- // Attach to the running app and run the final driver test to get metrics.
1177
- final TaskResult result = await internalRun (
1178
- existingApp: observatoryUri,
1179
- );
1180
-
1181
- _runProcess.kill ();
1182
- await _runProcess.exitCode;
1183
-
1184
- return result;
1185
- });
1186
- }
1187
-
1188
- Future <void > _generateSkSL () async {
1189
- // `flutter drive` without `flutter run`, and `flutter drive --existing-app`
1190
- // with `flutter run` may generate different SkSLs. Hence we run both
1191
- // versions to generate as many SkSLs as possible.
1192
- //
1193
- // 1st, `flutter drive --existing-app` with `flutter run`. The
1194
- // `--write-sksl-on-exit` option doesn't seem to be compatible with
1195
- // `flutter drive --existing-app` as it will complain web socket connection
1196
- // issues.
1197
- final String observatoryUri = await _runApp (cacheSkSL: true );
1198
- await super .internalRun (cacheSkSL: true , existingApp: observatoryUri);
1199
- _runProcess.kill ();
1200
- await _runProcess.exitCode;
1201
-
1202
- // 2nd, `flutter drive` without `flutter run`. The --no-build option ensures
1203
- // that we won't remove the SkSLs generated earlier.
1204
- await super .internalRun (
1205
- cacheSkSL: true ,
1206
- writeSkslFileName: _skslJsonFileName,
1207
- );
1208
- }
1209
-
1210
- Future <String > _runApp ({String ? appBinary, bool cacheSkSL = false , String ? skslPath}) async {
1211
- if (File (_vmserviceFileName).existsSync ()) {
1212
- File (_vmserviceFileName).deleteSync ();
1213
- }
1214
- final String ? localEngine = localEngineFromEnv;
1215
- final String ? localEngineSrcPath = localEngineSrcPathFromEnv;
1216
- _runProcess = await startProcess (
1217
- _flutterPath,
1218
- < String > [
1219
- 'run' ,
1220
- if (localEngine != null )
1221
- ...< String > ['--local-engine' , localEngine],
1222
- if (localEngineSrcPath != null )
1223
- ...< String > ['--local-engine-src-path' , localEngineSrcPath],
1224
- '--no-dds' ,
1225
- if (deviceOperatingSystem == DeviceOperatingSystem .ios)
1226
- ...< String > [
1227
- '--device-timeout' , '5' ,
1228
- ],
1229
- '--verbose' ,
1230
- '--verbose-system-logs' ,
1231
- '--purge-persistent-cache' ,
1232
- '--no-publish-port' ,
1233
- '--profile' ,
1234
- if (skslPath != null ) '--bundle-sksl-path=$skslPath ' ,
1235
- if (cacheSkSL) '--cache-sksl' ,
1236
- '-d' , _device.deviceId,
1237
- '-t' , testTarget,
1238
- '--endless-trace-buffer' ,
1239
- if (appBinary != null ) ...< String > ['--use-application-binary' , _appBinary],
1240
- '--vmservice-out-file' , _vmserviceFileName,
1241
- ],
1242
- );
1243
-
1244
- final Stream <List <int >> broadcastOut = _runProcess.stdout.asBroadcastStream ();
1245
- _forwardStream (broadcastOut, 'run stdout' );
1246
- _forwardStream (_runProcess.stderr, 'run stderr' );
1247
-
1248
- final File file = await waitForFile (_vmserviceFileName);
1249
- return file.readAsStringSync ();
1250
- }
1251
-
1252
- String get _skslJsonFileName => '$testDirectory /flutter_01.sksl.json' ;
1253
- String get _vmserviceFileName => '$testDirectory /$_kVmserviceOutFileName ' ;
1254
-
1255
- bool get _isAndroid => deviceOperatingSystem == DeviceOperatingSystem .android;
1256
-
1257
- String get _appBinary {
1258
- if (_isAndroid) {
1259
- return '$testDirectory /build/app/outputs/flutter-apk/app-profile.apk' ;
1260
- }
1261
- for (final FileSystemEntity entry in Directory ('$testDirectory /build/ios/iphoneos/' ).listSync ()) {
1262
- if (entry.path.endsWith ('.app' )) {
1263
- return entry.path;
1264
- }
1265
- }
1266
- throw 'No app found.' ;
1267
- }
1268
-
1269
- Stream <String > _transform (Stream <List <int >> stream) =>
1270
- stream.transform <String >(utf8.decoder).transform <String >(const LineSplitter ());
1271
-
1272
- void _forwardStream (Stream <List <int >> stream, String label) {
1273
- _transform (stream).listen ((String line) {
1274
- print ('$label : $line ' );
1275
- });
1276
- }
1277
-
1278
- late String _flutterPath;
1279
- late Device _device;
1280
- late Process _runProcess;
1281
-
1282
- static const String _kVmserviceOutFileName = 'vmservice.out' ;
1283
- }
1284
-
1285
1129
/// Measures how long it takes to compile a Flutter app to JavaScript and how
1286
1130
/// big the compiled code is.
1287
1131
class WebCompileTest {
0 commit comments