Unverified Commit ed92f189 authored by Alexander Dahlberg's avatar Alexander Dahlberg Committed by GitHub

Fixed leak and removed no-shuffle tag in dismissible_test.dart (#88933)

parent ba734ed6
...@@ -2,19 +2,14 @@ ...@@ -2,19 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// TODO(gspencergoog): Remove this tag once this test's state leaks/test
// dependencies have been fixed.
// https://github.com/flutter/flutter/issues/85160
// Fails with "flutter test --test-randomize-ordering-seed=456"
@Tags(<String>['no-shuffle'])
import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
const double itemExtent = 100.0; const double itemExtent = 100.0;
Axis scrollDirection = Axis.vertical; Axis scrollDirection = Axis.vertical;
DismissDirection dismissDirection = DismissDirection.horizontal; DismissDirection defaultDismissDirection = DismissDirection.horizontal;
DismissDirection dismissDirection = defaultDismissDirection;
late DismissDirection reportedDismissDirection; late DismissDirection reportedDismissDirection;
List<int> dismissedItems = <int>[]; List<int> dismissedItems = <int>[];
Widget? background; Widget? background;
...@@ -234,6 +229,12 @@ void main() { ...@@ -234,6 +229,12 @@ void main() {
background = null; background = null;
}); });
tearDown(() {
// To make sure dismissDirection does not have unpredicted values when
// tests are being shuffled, restore it to default value after each test.
dismissDirection = defaultDismissDirection;
});
testWidgets('Horizontal drag triggers dismiss scrollDirection=vertical', (WidgetTester tester) async { testWidgets('Horizontal drag triggers dismiss scrollDirection=vertical', (WidgetTester tester) async {
scrollDirection = Axis.vertical; scrollDirection = Axis.vertical;
dismissDirection = DismissDirection.horizontal; dismissDirection = DismissDirection.horizontal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment