Unverified Commit f5933dba authored by Jia Hao's avatar Jia Hao Committed by GitHub

[integration_test] Add a setter for defaultTestTimeout (#70073)

* [integration_test] Add a setter for defaultTestTimeout

* type annotation

* More type annotations

* Fix doc
parent 8e7748e7
......@@ -319,4 +319,13 @@ class IntegrationTestWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding
reportData ??= <String, dynamic>{};
reportData[reportKey] = frameTimes.summary;
}
@override
Timeout get defaultTestTimeout => _defaultTestTimeout ?? super.defaultTestTimeout;
/// Configures the default timeout for [testWidgets].
///
/// See [TestWidgetsFlutterBinding.defaultTestTimeout] for more details.
set defaultTestTimeout(Timeout timeout) => _defaultTestTimeout = timeout;
Timeout _defaultTestTimeout;
}
......@@ -87,6 +87,19 @@ Future<void> main() async {
json.encode(_kTimelines),
);
});
group('defaultTestTimeout', () {
final Timeout originalTimeout = integrationBinding.defaultTestTimeout;
tearDown(() {
integrationBinding.defaultTestTimeout = originalTimeout;
});
test('can be configured', () {
const Timeout newTimeout = Timeout(Duration(seconds: 17));
integrationBinding.defaultTestTimeout = newTimeout;
expect(integrationBinding.defaultTestTimeout, newTimeout);
});
});
});
tearDownAll(() async {
......
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