Commit ce2c834f authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Adjust the tests to handle a higher-DPI test harness. (#10056)

Requires https://github.com/flutter/engine/pull/3688
parent abeb164f
7dd359e165162515ae882f2b6cb36e28a2acb37b
6fef702cfaf58913f67979f725adcabc9bc55a0c
......@@ -61,8 +61,8 @@ void main() {
expect(find.text('Account Balance'), findsNothing);
// drag the drawer out
final Offset left = new Offset(0.0, ui.window.physicalSize.height / 2.0);
final Offset right = new Offset(ui.window.physicalSize.width, left.dy);
final Offset left = new Offset(0.0, (ui.window.physicalSize / ui.window.devicePixelRatio).height / 2.0);
final Offset right = new Offset((ui.window.physicalSize / ui.window.devicePixelRatio).width, left.dy);
final TestGesture gesture = await tester.startGesture(left);
await tester.pump();
await gesture.moveTo(right);
......
......@@ -145,9 +145,9 @@ void main() {
r'^'
r'RenderView#[0-9]+\n'
r' debug mode enabled - [a-zA-Z]+\n'
r' window size: Size\(800\.0, 600\.0\) \(in physical pixels\)\n'
r' device pixel ratio: 1\.0 \(physical pixels per logical pixel\)\n'
r' configuration: Size\(800\.0, 600\.0\) at 1\.0x \(in logical pixels\)\n'
r' window size: Size\(2400\.0, 1800\.0\) \(in physical pixels\)\n'
r' device pixel ratio: 3\.0 \(physical pixels per logical pixel\)\n'
r' configuration: Size\(800\.0, 600\.0\) at 3\.0x \(in logical pixels\)\n'
r'$'
),
]);
......@@ -168,8 +168,8 @@ void main() {
r' creator: RenderView\n'
r' offset: Offset\(0\.0, 0\.0\)\n'
r' transform:\n'
r' \[0] 1\.0,0\.0,0\.0,0\.0\n'
r' \[1] 0\.0,1\.0,0\.0,0\.0\n'
r' \[0] 3\.0,0\.0,0\.0,0\.0\n'
r' \[1] 0\.0,3\.0,0\.0,0\.0\n'
r' \[2] 0\.0,0\.0,1\.0,0\.0\n'
r' \[3] 0\.0,0\.0,0\.0,1\.0\n'
r'$'
......
......@@ -68,17 +68,17 @@ void main() {
});
test('Synthetic move events', () {
final ui.PointerDataPacket packet = const ui.PointerDataPacket(
data: const <ui.PointerData>[
const ui.PointerData(
final ui.PointerDataPacket packet = new ui.PointerDataPacket(
data: <ui.PointerData>[
new ui.PointerData(
change: ui.PointerChange.down,
physicalX: 1.0,
physicalY: 3.0,
physicalX: 1.0 * ui.window.devicePixelRatio,
physicalY: 3.0 * ui.window.devicePixelRatio,
),
const ui.PointerData(
new ui.PointerData(
change: ui.PointerChange.up,
physicalX: 10.0,
physicalY: 15.0,
physicalX: 10.0 * ui.window.devicePixelRatio,
physicalY: 15.0 * ui.window.devicePixelRatio,
),
]
);
......@@ -154,10 +154,10 @@ void main() {
});
test('Synthetic hover and cancel for misplaced down and remove', () {
final ui.PointerDataPacket packet = const ui.PointerDataPacket(
data: const <ui.PointerData>[
const ui.PointerData(change: ui.PointerChange.add, device: 25, physicalX: 10.0, physicalY: 10.0),
const ui.PointerData(change: ui.PointerChange.down, device: 25, physicalX: 15.0, physicalY: 17.0),
final ui.PointerDataPacket packet = new ui.PointerDataPacket(
data: <ui.PointerData>[
new ui.PointerData(change: ui.PointerChange.add, device: 25, physicalX: 10.0 * ui.window.devicePixelRatio, physicalY: 10.0 * ui.window.devicePixelRatio),
new ui.PointerData(change: ui.PointerChange.down, device: 25, physicalX: 15.0 * ui.window.devicePixelRatio, physicalY: 17.0 * ui.window.devicePixelRatio),
const ui.PointerData(change: ui.PointerChange.remove, device: 25),
]
);
......@@ -168,7 +168,7 @@ void main() {
expect(events.length, 5);
expect(events[0].runtimeType, equals(PointerAddedEvent));
expect(events[1].runtimeType, equals(PointerHoverEvent));
expect(events[1].delta, equals(const Offset(5.0, 7.0) / ui.window.devicePixelRatio));
expect(events[1].delta, equals(const Offset(5.0, 7.0)));
expect(events[2].runtimeType, equals(PointerDownEvent));
expect(events[3].runtimeType, equals(PointerCancelEvent));
expect(events[4].runtimeType, equals(PointerRemovedEvent));
......
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