mirror of
https://github.com/encounter/flutter.git
synced 2026-03-30 11:10:35 -07:00
Allow test beds to override defaultTestTimeout (#40806)
This commit is contained in:
committed by
Michael Goderbauer
parent
ad745170b7
commit
c19e553d64
@@ -839,8 +839,11 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
|
||||
@override
|
||||
bool get checkIntrinsicSizes => true;
|
||||
|
||||
/// The value of [defaultTestTimeout] can be set to `None` to enable debugging flutter tests where
|
||||
/// we would not want to timeout the test. This is expected to be used by test tooling which
|
||||
/// can detect debug mode.
|
||||
@override
|
||||
test_package.Timeout get defaultTestTimeout => const test_package.Timeout(Duration(minutes: 10));
|
||||
test_package.Timeout defaultTestTimeout = const test_package.Timeout(Duration(minutes: 10));
|
||||
|
||||
@override
|
||||
bool get inTest => _currentFakeAsync != null;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:test_api/test_api.dart' as test_package;
|
||||
|
||||
void main() {
|
||||
group(TestViewConfiguration, () {
|
||||
@@ -14,4 +14,12 @@ void main() {
|
||||
TestViewConfiguration(size: const Size(1280.0, 800.0));
|
||||
});
|
||||
});
|
||||
|
||||
group(AutomatedTestWidgetsFlutterBinding, () {
|
||||
test('allows setting defaultTestTimeout to 5 minutes', () {
|
||||
final AutomatedTestWidgetsFlutterBinding binding = AutomatedTestWidgetsFlutterBinding();
|
||||
binding.defaultTestTimeout = const test_package.Timeout(Duration(minutes: 5));
|
||||
expect(binding.defaultTestTimeout.duration, const Duration(minutes: 5));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user