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
@@ -32,6 +32,7 @@ Future<void> setClipboard(String message) async {
|
||||
});
|
||||
completer.complete();
|
||||
}
|
||||
|
||||
if (SchedulerBinding.instance.hasScheduledFrame) {
|
||||
SchedulerBinding.instance.addPostFrameCallback(completeSetClipboard);
|
||||
} else {
|
||||
@@ -44,11 +45,13 @@ Future<AndroidSemanticsNode> getSemantics(Finder finder, WidgetTester tester) as
|
||||
final int id = tester.getSemantics(finder).id;
|
||||
final Completer<String> completer = Completer<String>();
|
||||
Future<void> completeSemantics([Object? _]) async {
|
||||
final dynamic result = await kSemanticsChannel.invokeMethod<dynamic>('getSemanticsNode', <String, dynamic>{
|
||||
'id': id,
|
||||
});
|
||||
final dynamic result = await kSemanticsChannel.invokeMethod<dynamic>(
|
||||
'getSemanticsNode',
|
||||
<String, dynamic>{'id': id},
|
||||
);
|
||||
completer.complete(json.encode(result));
|
||||
}
|
||||
|
||||
if (SchedulerBinding.instance.hasScheduledFrame) {
|
||||
SchedulerBinding.instance.addPostFrameCallback(completeSemantics);
|
||||
} else {
|
||||
@@ -94,9 +97,7 @@ Future<void> main() async {
|
||||
isFocusable: true,
|
||||
isFocused: false,
|
||||
isPassword: false,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
// We can't predict the a11y focus when the screen changes.
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
),
|
||||
@@ -163,9 +164,7 @@ Future<void> main() async {
|
||||
isFocusable: true,
|
||||
isFocused: false,
|
||||
isPassword: true,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
// We can't predict the a11y focus when the screen changes.
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
),
|
||||
@@ -229,7 +228,9 @@ Future<void> main() async {
|
||||
|
||||
testWidgets('Checkbox has correct Android semantics', (WidgetTester tester) async {
|
||||
final Finder checkbox = find.byKey(const ValueKey<String>(checkboxKeyValue));
|
||||
final Finder disabledCheckbox = find.byKey(const ValueKey<String>(disabledCheckboxKeyValue));
|
||||
final Finder disabledCheckbox = find.byKey(
|
||||
const ValueKey<String>(disabledCheckboxKeyValue),
|
||||
);
|
||||
|
||||
await prepareSelectionControls(tester);
|
||||
expect(
|
||||
@@ -241,9 +242,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -259,9 +258,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
expect(
|
||||
@@ -289,9 +286,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -307,9 +302,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
}, timeout: Timeout.none);
|
||||
@@ -327,9 +320,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -345,9 +336,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
}, timeout: Timeout.none);
|
||||
@@ -367,9 +356,7 @@ Future<void> main() async {
|
||||
isFocusable: true,
|
||||
contentDescription: switchLabel,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
}, timeout: Timeout.none);
|
||||
@@ -396,9 +383,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -416,9 +401,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
reason: "Popup $item doesn't have the right semantics",
|
||||
);
|
||||
@@ -441,9 +424,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
reason: "Popup $item doesn't have the right semantics the second time",
|
||||
);
|
||||
@@ -466,9 +447,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -494,9 +473,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
reason: "Dropdown $item doesn't have the right semantics",
|
||||
);
|
||||
@@ -532,9 +509,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
reason: "Dropdown $item doesn't have the right semantics the second time.",
|
||||
);
|
||||
@@ -562,9 +537,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -581,9 +554,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
reason: "Alert OK button doesn't have the right semantics",
|
||||
);
|
||||
@@ -621,9 +592,7 @@ Future<void> main() async {
|
||||
isEnabled: true,
|
||||
isFocusable: true,
|
||||
ignoredActions: ignoredAccessibilityFocusActions,
|
||||
actions: <AndroidSemanticsAction>[
|
||||
AndroidSemanticsAction.click,
|
||||
],
|
||||
actions: <AndroidSemanticsAction>[AndroidSemanticsAction.click],
|
||||
),
|
||||
reason: "Alert OK button doesn't have the right semantics",
|
||||
);
|
||||
@@ -657,7 +626,9 @@ Future<void> main() async {
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
testWidgets('AppBar title has correct Android heading semantics', (WidgetTester tester) async {
|
||||
testWidgets('AppBar title has correct Android heading semantics', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await prepareHeading(tester);
|
||||
expect(
|
||||
await getSemantics(find.byKey(const ValueKey<String>(appBarTitleKeyValue)), tester),
|
||||
|
||||
Reference in New Issue
Block a user