flutter_flutter/packages/flutter/test/services/system_chrome_test.dart
Adam Barth 3f19b2db98 Switch to using PlatformPlugin instead of mojom (#6292)
* Switch to using PlatformPlugin instead of mojom

* Update engine.version
2016-10-13 02:10:32 -07:00

23 lines
840 B
Dart

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('SystemChrome overlay style test', (WidgetTester tester) async {
// The first call is a cache miss and will queue a microtask
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
expect(tester.binding.microtaskCount, equals(1));
// Flush all microtasks
await tester.idle();
expect(tester.binding.microtaskCount, equals(0));
// The second call with the same value should be a no-op
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
expect(tester.binding.microtaskCount, equals(0));
});
}