Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the `engine` subdirectory and enforces that these files stay formatted with a presubmit check. **Reviewers:** Please carefully review all the commits except for the one titled "formatted". The "formatted" commit was auto-generated by running `dev/tools/format.sh -a -f`. The other commits were hand-crafted to prepare the repo for the formatting change. I recommend reviewing the commits one-by-one via the "Commits" tab and avoiding Github's "Files changed" tab as it will likely slow down your browser because of the size of this PR. --------- Co-authored-by: Kate Lovett <katelovett@google.com> Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8e0993eda8
commit
5491c8c146
@@ -8,9 +8,6 @@ import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||
|
||||
Future<void> main() => driver.integrationDriver(
|
||||
responseDataCallback: (Map<String, dynamic>? data) async {
|
||||
await driver.writeResponseData(
|
||||
data,
|
||||
testOutputFilename: 'scroll_smoothness_test',
|
||||
);
|
||||
}
|
||||
await driver.writeResponseData(data, testOutputFilename: 'scroll_smoothness_test');
|
||||
},
|
||||
);
|
||||
|
||||
@@ -47,26 +47,39 @@ void main() {
|
||||
expect(
|
||||
await driver.setSemantics(true),
|
||||
isTrue,
|
||||
reason: 'Could not toggle semantics to on because semantics were already '
|
||||
'on, but the test needs to toggle semantics to measure the initial '
|
||||
'semantics tree generation in isolation.'
|
||||
reason:
|
||||
'Could not toggle semantics to on because semantics were already '
|
||||
'on, but the test needs to toggle semantics to measure the initial '
|
||||
'semantics tree generation in isolation.',
|
||||
);
|
||||
});
|
||||
|
||||
final Iterable<TimelineEvent>? semanticsEvents = timeline.events?.where((TimelineEvent event) => event.name == 'SEMANTICS');
|
||||
final Iterable<TimelineEvent>? semanticsEvents = timeline.events?.where(
|
||||
(TimelineEvent event) => event.name == 'SEMANTICS',
|
||||
);
|
||||
if (semanticsEvents?.length != 2) {
|
||||
fail('Expected exactly two "SEMANTICS" events, got ${semanticsEvents?.length}:\n$semanticsEvents');
|
||||
fail(
|
||||
'Expected exactly two "SEMANTICS" events, got ${semanticsEvents?.length}:\n$semanticsEvents',
|
||||
);
|
||||
}
|
||||
final Duration semanticsTreeCreation = Duration(microseconds: semanticsEvents!.last.timestampMicros! - semanticsEvents.first.timestampMicros!);
|
||||
final Duration semanticsTreeCreation = Duration(
|
||||
microseconds:
|
||||
semanticsEvents!.last.timestampMicros! - semanticsEvents.first.timestampMicros!,
|
||||
);
|
||||
|
||||
final String jsonEncoded = json.encode(<String, dynamic>{'initialSemanticsTreeCreation': semanticsTreeCreation.inMilliseconds});
|
||||
File(p.join(testOutputsDirectory, 'complex_layout_semantics_perf.json')).writeAsStringSync(jsonEncoded);
|
||||
final String jsonEncoded = json.encode(<String, dynamic>{
|
||||
'initialSemanticsTreeCreation': semanticsTreeCreation.inMilliseconds,
|
||||
});
|
||||
File(
|
||||
p.join(testOutputsDirectory, 'complex_layout_semantics_perf.json'),
|
||||
).writeAsStringSync(jsonEncoded);
|
||||
}, timeout: Timeout.none);
|
||||
});
|
||||
}
|
||||
|
||||
String _adbPath() {
|
||||
final String? androidHome = Platform.environment['ANDROID_HOME'] ?? Platform.environment['ANDROID_SDK_ROOT'];
|
||||
final String? androidHome =
|
||||
Platform.environment['ANDROID_HOME'] ?? Platform.environment['ANDROID_SDK_ROOT'];
|
||||
if (androidHome == null) {
|
||||
return 'adb';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user