a11y: remove SemanticsSortOrder; sort locally only; semanticsOwner post-test check (#15537)

* a11y: remove SemanticsSortOrder; sort locally only; semanticsOwner post-test check

* update accessibility test framework

- default nextNodeId/previousNodeId to -1
- stop treating null as opt-out from value testing
- add `id`, `TestSemantics.root`, and `tags` to the suggested code in the TestSemantics failure message
- fix a small bug with raw string escaping
- update all tests accordingly

* fix sortKey doc

* prefer const over final
This commit is contained in:
Yegor
2018-03-18 22:18:52 -07:00
committed by GitHub
parent b494e71e36
commit 9c49255f3e
29 changed files with 462 additions and 654 deletions

View File

@@ -471,6 +471,19 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
void _endOfTestVerifications() {
verifyTickersWereDisposed('at the end of the test');
_verifySemanticsHandlesWereDisposed();
}
void _verifySemanticsHandlesWereDisposed() {
if (binding.pipelineOwner.semanticsOwner != null) {
throw new FlutterError(
'A SemanticsHandle was active at the end of the test.\n'
'All SemanticsHandle instances must be disposed by calling dispose() on '
'the SemanticsHandle. If your test uses SemanticsTester, it is '
'sufficient to call dispose() on SemanticsTester. Otherwise, the '
'existing handle will leak into another test and alter its behavior.'
);
}
}
/// Returns the TestTextInput singleton.