Simplify SystemChrome.setSystemUIOverlayStyle() (#4653)
* Only schedule overlay style update microtask if needed * Simplify API
This commit is contained in:
@@ -112,6 +112,9 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||
/// Whether there is currently a test executing.
|
||||
bool get inTest;
|
||||
|
||||
/// The number of outstanding microtasks in the queue.
|
||||
int get microtaskCount;
|
||||
|
||||
/// The default test timeout for tests when using this binding.
|
||||
test_package.Timeout get defaultTestTimeout;
|
||||
|
||||
@@ -410,6 +413,9 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
|
||||
@override
|
||||
bool get inTest => _fakeAsync != null;
|
||||
|
||||
@override
|
||||
int get microtaskCount => _fakeAsync.microtaskCount;
|
||||
|
||||
@override
|
||||
Future<Null> pump([ Duration duration, EnginePhase newPhase = EnginePhase.sendSemanticsTree ]) {
|
||||
return TestAsyncUtils.guard(() {
|
||||
@@ -544,6 +550,14 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
|
||||
bool get inTest => _inTest;
|
||||
bool _inTest = false;
|
||||
|
||||
@override
|
||||
int get microtaskCount {
|
||||
// Unsupported until we have a wrapper around the real async API
|
||||
// https://github.com/flutter/flutter/issues/4637
|
||||
assert(false);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@override
|
||||
test_package.Timeout get defaultTestTimeout => test_package.Timeout.none;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user