Migrate to ChannelBuffers.push (#81235)
This commit is contained in:
@@ -11,6 +11,8 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:test_api/test_api.dart' as test_package;
|
||||
|
||||
void main() {
|
||||
final AutomatedTestWidgetsFlutterBinding binding = AutomatedTestWidgetsFlutterBinding();
|
||||
|
||||
group(TestViewConfiguration, () {
|
||||
test('is initialized with top-level window if one is not provided', () {
|
||||
// The code below will throw without the default.
|
||||
@@ -20,15 +22,32 @@ void main() {
|
||||
|
||||
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));
|
||||
});
|
||||
});
|
||||
|
||||
// The next three tests must run in order -- first using `test`, then `testWidgets`, then `test` again.
|
||||
|
||||
int order = 0;
|
||||
|
||||
test('Initializes httpOverrides and testTextInput', () async {
|
||||
final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized() as TestWidgetsFlutterBinding;
|
||||
expect(binding.testTextInput.isRegistered, true);
|
||||
assert(order == 0);
|
||||
expect(binding.testTextInput, isNotNull);
|
||||
expect(binding.testTextInput.isRegistered, isFalse);
|
||||
expect(HttpOverrides.current, isNotNull);
|
||||
order += 1;
|
||||
});
|
||||
|
||||
testWidgets('Registers testTextInput', (WidgetTester tester) async {
|
||||
assert(order == 1);
|
||||
expect(tester.testTextInput.isRegistered, isTrue);
|
||||
order += 1;
|
||||
});
|
||||
|
||||
test('Unregisters testTextInput', () async {
|
||||
assert(order == 2);
|
||||
expect(binding.testTextInput.isRegistered, isFalse);
|
||||
order += 1;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,12 +20,6 @@ class TestDelegate extends BinaryMessenger {
|
||||
Future<void> handlePlatformMessage(String channel, ByteData? data, ui.PlatformMessageResponseCallback? callback) => throw UnimplementedError();
|
||||
@override
|
||||
void setMessageHandler(String channel, MessageHandler? handler) => throw UnimplementedError();
|
||||
@override
|
||||
bool checkMessageHandler(String channel, MessageHandler? handler) => throw UnimplementedError();
|
||||
@override
|
||||
void setMockMessageHandler(String channel, MessageHandler? handler) => throw UnimplementedError();
|
||||
@override
|
||||
bool checkMockMessageHandler(String channel, MessageHandler? handler) => throw UnimplementedError();
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
Reference in New Issue
Block a user