Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions packages/flutter/test/material/paginated_data_table_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
// 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=1000"
@Tags(<String>['no-shuffle'])
library;

import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
Expand Down Expand Up @@ -845,6 +838,7 @@ void main() {

testWidgets('PaginatedDataTable with optional column checkbox', (WidgetTester tester) async {
await binding.setSurfaceSize(const Size(800, 800));
addTearDown(() => binding.setSurfaceSize(null));

Widget buildTable(bool checkbox) => MaterialApp(
home: PaginatedDataTable(
Expand Down Expand Up @@ -1004,6 +998,7 @@ void main() {

testWidgets('PaginatedDataTable arrowHeadColor set properly', (WidgetTester tester) async {
await binding.setSurfaceSize(const Size(800, 800));
addTearDown(() => binding.setSurfaceSize(null));
const Color arrowHeadColor = Color(0xFFE53935);

await tester.pumpWidget(
Expand Down
11 changes: 11 additions & 0 deletions packages/flutter_test/lib/src/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,17 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
/// then flushes microtasks.
///
/// Set to null to use the default surface size.
///
/// To avoid affecting other tests by leaking state, a test that
/// uses this method should always reset the surface size to the default.
/// For example, using `addTearDown`:
/// ```dart
/// await binding.setSurfaceSize(someSize);
/// addTearDown(() => binding.setSurfaceSize(null));
/// ```
///
/// See also [TestFlutterView.physicalSize], which has a similar effect.
// TODO(pdblasi-google): Deprecate this. https://github.com/flutter/flutter/issues/123881
Future<void> setSurfaceSize(Size? size) {
Comment thread
pdblasi-google marked this conversation as resolved.
Outdated
return TestAsyncUtils.guard<void>(() async {
assert(inTest);
Expand Down