Fixed leak and removed no-shuffle tag in dismissible_test.dart (#88933)
This commit is contained in:
committed by
GitHub
parent
ba734ed63c
commit
ed92f1890e
@@ -2,19 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// 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/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
const double itemExtent = 100.0;
|
||||
Axis scrollDirection = Axis.vertical;
|
||||
DismissDirection dismissDirection = DismissDirection.horizontal;
|
||||
DismissDirection defaultDismissDirection = DismissDirection.horizontal;
|
||||
DismissDirection dismissDirection = defaultDismissDirection;
|
||||
late DismissDirection reportedDismissDirection;
|
||||
List<int> dismissedItems = <int>[];
|
||||
Widget? background;
|
||||
@@ -234,6 +229,12 @@ void main() {
|
||||
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 {
|
||||
scrollDirection = Axis.vertical;
|
||||
dismissDirection = DismissDirection.horizontal;
|
||||
|
||||
Reference in New Issue
Block a user