Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Remove references to dart:ui's window singelton (#119296)
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored Jan 27, 2023
1 parent ab2232a commit e9ca9cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/flutter/test/gestures/gesture_binding_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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>());
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/test/rendering/mouse_tracker_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
// 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';

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;
Expand All @@ -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;
Expand Down

0 comments on commit e9ca9cc

Please sign in to comment.