Commit c19e553d authored by Mehmet Fidanboylu's avatar Mehmet Fidanboylu Committed by Michael Goderbauer

Allow test beds to override defaultTestTimeout (#40806)

parent ad745170
...@@ -839,8 +839,11 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { ...@@ -839,8 +839,11 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
@override @override
bool get checkIntrinsicSizes => true; 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 @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 @override
bool get inTest => _currentFakeAsync != null; bool get inTest => _currentFakeAsync != null;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:test_api/test_api.dart' as test_package;
void main() { void main() {
group(TestViewConfiguration, () { group(TestViewConfiguration, () {
...@@ -14,4 +14,12 @@ void main() { ...@@ -14,4 +14,12 @@ void main() {
TestViewConfiguration(size: const Size(1280.0, 800.0)); 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));
});
});
} }
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