Unify analysis options (#108462)

This commit is contained in:
Michael Goderbauer
2022-07-28 09:07:49 -07:00
committed by GitHub
parent 8a8ed75d3e
commit 10a7c9ba22
138 changed files with 1155 additions and 607 deletions

View File

@@ -113,10 +113,11 @@ class ComplexLayoutState extends State<ComplexLayout> {
key: const Key('complex-scroll'), // this key is used by the driver test
controller: ScrollController(), // So that the scroll offset can be tracked
itemBuilder: (BuildContext context, int index) {
if (index.isEven)
if (index.isEven) {
return FancyImageItem(index, key: PageStorageKey<int>(index));
else
} else {
return FancyGalleryItem(index, key: PageStorageKey<int>(index));
}
},
),
),

View File

@@ -239,8 +239,9 @@ Map<String, dynamic> scrollSummary(
//
final double absJerk = (scrollOffset[i-1] + scrollOffset[i+1] - 2*scrollOffset[i]).abs();
absJerkAvg += absJerk;
if (absJerk > 0.5)
if (absJerk > 0.5) {
jankyCount += 1;
}
}
// expect(lostFrame < 0.1 * frameTimestamp.length, true);
absJerkAvg /= frameTimestamp.length - lostFrame;

View File

@@ -18,8 +18,9 @@ void main() {
});
tearDownAll(() async {
if (driver != null)
if (driver != null) {
driver.close();
}
});
Future<void> testScrollPerf(String listKey, String summaryName) async {

View File

@@ -19,8 +19,9 @@ void main() {
});
tearDownAll(() async {
if (driver != null)
if (driver != null) {
driver.close();
}
});
test('initial tree creation', () async {
@@ -34,8 +35,9 @@ void main() {
});
final Iterable<TimelineEvent>? semanticsEvents = timeline.events?.where((TimelineEvent event) => event.name == 'SEMANTICS');
if (semanticsEvents?.length != 2)
if (semanticsEvents?.length != 2) {
fail('Expected exactly two "SEMANTICS" events, got ${semanticsEvents?.length}:\n$semanticsEvents');
}
final Duration semanticsTreeCreation = Duration(microseconds: semanticsEvents!.last.timestampMicros! - semanticsEvents.first.timestampMicros!);
final String jsonEncoded = json.encode(<String, dynamic>{'initialSemanticsTreeCreation': semanticsTreeCreation.inMilliseconds});