Fix microbenchmarks tests. (#9782)
This commit is contained in:
parent
961da5a3bc
commit
2b04e300af
@ -44,7 +44,11 @@ Future<Null> main() async {
|
||||
// artificially high load to find out how much CPU each frame takes.
|
||||
// This differs from normal benchmarks which might look at how many
|
||||
// frames are missed, etc.
|
||||
ui.window.onBeginFrame(new Duration(milliseconds: iterations * 16));
|
||||
// We use Timer.run to ensure there's a microtask flush in between
|
||||
// the two calls below.
|
||||
Timer.run(() { ui.window.onBeginFrame(new Duration(milliseconds: iterations * 16)); });
|
||||
Timer.run(() { ui.window.onDrawFrame(); });
|
||||
await tester.idle(); // wait until the frame has run
|
||||
iterations += 1;
|
||||
}
|
||||
watch.stop();
|
||||
|
@ -45,7 +45,11 @@ Future<Null> main() async {
|
||||
// artificially high load to find out how much CPU each frame takes.
|
||||
// This differs from normal benchmarks which might look at how many
|
||||
// frames are missed, etc.
|
||||
ui.window.onBeginFrame(new Duration(milliseconds: iterations * 16));
|
||||
// We use Timer.run to ensure there's a microtask flush in between
|
||||
// the two calls below.
|
||||
Timer.run(() { ui.window.onBeginFrame(new Duration(milliseconds: iterations * 16)); });
|
||||
Timer.run(() { ui.window.onDrawFrame(); });
|
||||
await tester.idle(); // wait until the frame has run
|
||||
iterations += 1;
|
||||
}
|
||||
watch.stop();
|
||||
|
@ -29,9 +29,8 @@ TaskFunction createMicrobenchmarkTask() {
|
||||
final Directory appDir = dir(
|
||||
path.join(flutterDirectory.path, 'dev/benchmarks/microbenchmarks'));
|
||||
final Process flutterProcess = await inDirectory(appDir, () async {
|
||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
|
||||
await prepareProvisioningCertificates(appDir.path);
|
||||
}
|
||||
return await _startFlutter(
|
||||
options: <String>[
|
||||
'--profile',
|
||||
|
Loading…
x
Reference in New Issue
Block a user