Remvoe last few references to window singleton (#122644)
Remove last few references to window singleton
This commit is contained in:
committed by
GitHub
parent
0ba64488da
commit
a599c08c32
@@ -7,8 +7,9 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Fails correctly with configured screen size - small', (WidgetTester tester) async {
|
||||
tester.binding.window.devicePixelRatioTestValue = 1.2;
|
||||
tester.binding.window.physicalSizeTestValue = const Size(250, 300);
|
||||
tester.view.devicePixelRatio = 1.2;
|
||||
tester.view.physicalSize = const Size(250, 300);
|
||||
addTearDown(tester.view.reset);
|
||||
|
||||
final Widget invalidButton = ElevatedButton(
|
||||
onPressed: () {},
|
||||
@@ -25,8 +26,9 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('Fails correctly with configured screen size - large', (WidgetTester tester) async {
|
||||
tester.binding.window.devicePixelRatioTestValue = 4.2;
|
||||
tester.binding.window.physicalSizeTestValue = const Size(2500, 3000);
|
||||
tester.view.devicePixelRatio = 4.2;
|
||||
tester.view.physicalSize = const Size(2500, 3000);
|
||||
addTearDown(tester.view.reset);
|
||||
|
||||
final Widget invalidButton = ElevatedButton(
|
||||
onPressed: () {},
|
||||
|
||||
@@ -71,8 +71,8 @@ void main() {
|
||||
testWidgets('setSurfaceSize works', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(home: Center(child: Text('Test'))));
|
||||
|
||||
final Size windowCenter = tester.binding.window.physicalSize /
|
||||
tester.binding.window.devicePixelRatio /
|
||||
final Size windowCenter = tester.view.physicalSize /
|
||||
tester.view.devicePixelRatio /
|
||||
2;
|
||||
final double windowCenterX = windowCenter.width;
|
||||
final double windowCenterY = windowCenter.height;
|
||||
|
||||
@@ -34,8 +34,8 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final Size windowCenter = tester.binding.window.physicalSize /
|
||||
tester.binding.window.devicePixelRatio /
|
||||
final Size windowCenter = tester.view.physicalSize /
|
||||
tester.view.devicePixelRatio /
|
||||
2;
|
||||
final double windowCenterX = windowCenter.width;
|
||||
final double windowCenterY = windowCenter.height;
|
||||
|
||||
Reference in New Issue
Block a user