flutter_flutter/packages/flutter/test/widget/media_query_test.dart
Adam Barth 179ea4a0a6 Update framework to account from engine API changes (#5887)
The engine now reports coordinates in physical pixels.
2016-09-15 13:13:42 -07:00

26 lines
665 B
Dart

// Copyright 2015 The Chromium Authors. All rights reserved.
// 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_test/flutter_test.dart';
import 'package:flutter/widgets.dart';
void main() {
testWidgets('MediaQuery has a default', (WidgetTester tester) async {
Size size;
await tester.pumpWidget(
new Builder(
builder: (BuildContext context) {
size = MediaQuery.of(context).size;
return new Container();
}
)
);
expect(size, equals(ui.window.physicalSize / ui.window.devicePixelRatio));
});
}