Unverified Commit e9ca9cc1 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove references to dart:ui's window singelton (#119296)

parent ab2232a1
......@@ -350,7 +350,7 @@ void main() {
final List<PointerEvent> events = <PointerEvent>[];
binding.callback = events.add;
ui.window.onPointerDataPacket?.call(packet);
binding.platformDispatcher.onPointerDataPacket?.call(packet);
expect(events.length, 3);
expect(events[0], isA<PointerPanZoomStartEvent>());
expect(events[1], isA<PointerPanZoomUpdateEvent>());
......
......@@ -134,7 +134,7 @@ void main() {
test('should not crash if the first event is a Removed event', () {
final List<PointerEvent> events = <PointerEvent>[];
setUpWithOneAnnotation(logEvents: events);
ui.window.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[
binding.platformDispatcher.onPointerDataPacket!(ui.PointerDataPacket(data: <ui.PointerData>[
_pointerData(PointerChange.remove, Offset.zero),
]));
events.clear();
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
......@@ -11,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
const Size _kTestViewSize = Size(800.0, 600.0);
class ScheduledFrameTrackingWindow extends TestWindow {
ScheduledFrameTrackingWindow() : super(window: ui.window);
ScheduledFrameTrackingWindow({ required super.window });
int _scheduledFrameCount = 0;
int get scheduledFrameCount => _scheduledFrameCount;
......@@ -28,7 +26,7 @@ class ScheduledFrameTrackingWindow extends TestWindow {
}
class ScheduledFrameTrackingBindings extends AutomatedTestWidgetsFlutterBinding {
final ScheduledFrameTrackingWindow _window = ScheduledFrameTrackingWindow();
late final ScheduledFrameTrackingWindow _window = ScheduledFrameTrackingWindow(window: super.window);
@override
ScheduledFrameTrackingWindow get window => _window;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment