Nosuchmethod window (#37417)
This commit is contained in:
@@ -373,4 +373,12 @@ class TestWindow implements Window {
|
||||
clearTextScaleFactorTestValue();
|
||||
clearViewInsetsTestValue();
|
||||
}
|
||||
|
||||
/// This gives us some grace time when the dart:ui side adds something to
|
||||
/// Window, and makes things easier when we do rolls to give us time to
|
||||
/// catch up.
|
||||
@override
|
||||
dynamic noSuchMethod(Invocation invocation) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,11 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
void main() {
|
||||
test('TestWindow can handle new methods without breaking', () {
|
||||
final dynamic testWindow = TestWindow(window: ui.window);
|
||||
expect(testWindow.someNewProperty, null);
|
||||
});
|
||||
|
||||
testWidgets('TestWindow can fake device pixel ratio', (WidgetTester tester) async {
|
||||
verifyThatTestWindowCanFakeProperty<double>(
|
||||
tester: tester,
|
||||
|
||||
Reference in New Issue
Block a user