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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user