Skip to content

Calling WidgetTester.startGesture with a trackpad kind throws #113773

@dnfield

Description

@dnfield

Reproduction:

testWidgets('trackpad', (WidgetTester tester) async {
  await tester.startGesture(const Offset(50, 50), kind: PointerDeviceKind.trackpad);
});

results in


══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
'package:flutter/src/gestures/events.dart': Failed assertion: line 1440 pos 15: '!identical(kind,
PointerDeviceKind.trackpad)': is not true.

When the exception was thrown, this was the stack:
#2      new PointerDownEvent (package:flutter/src/gestures/events.dart:1440:15)
#3      TestPointer.down (package:flutter_test/src/test_pointer.dart:139:12)
#4      TestGesture.down.<anonymous closure> (package:flutter_test/src/test_pointer.dart:459:35)
#7      TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:71:41)
#8      TestGesture.down (package:flutter_test/src/test_pointer.dart:458:27)
#9      WidgetController.startGesture (package:flutter_test/src/controller.dart:898:18)
<asynchronous suspension>
<asynchronous suspension>
(elided 5 frames from class _AssertionError, dart:async, and package:stack_trace)

The test description was:
  trackpad
════════════════════════════════════════════════════════════════════════════════════════════════════
Test failed. See exception logs above.
The test description was: trackpad

@dkwingsmt @moffatman

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsf: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions