OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import '../resources/third_party/unittest/unittest.dart'; | 5 import '../resources/third_party/unittest/unittest.dart'; |
6 import '../resources/unit.dart'; | 6 import '../resources/unit.dart'; |
7 import 'dart:sky' as sky; | 7 import 'dart:sky' as sky; |
8 import 'package:sky/framework/layout2.dart'; | 8 import 'package:sky/framework/layout2.dart'; |
9 | 9 |
10 class RenderSizedBox extends RenderBox { | 10 class RenderSizedBox extends RenderBox { |
(...skipping 14 matching lines...) Expand all Loading... |
25 height = constraints.constrainHeight(desiredHeight); | 25 height = constraints.constrainHeight(desiredHeight); |
26 layoutDone(); | 26 layoutDone(); |
27 } | 27 } |
28 } | 28 } |
29 | 29 |
30 void main() { | 30 void main() { |
31 initUnit(); | 31 initUnit(); |
32 | 32 |
33 test("should size to render view", () { | 33 test("should size to render view", () { |
34 RenderSizedBox root = new RenderSizedBox(); | 34 RenderSizedBox root = new RenderSizedBox(); |
35 RenderView renderView = new RenderView(root: root); | 35 RenderView renderView = new RenderView(child: root); |
36 renderView.layout(newWidth: sky.view.width, newHeight: sky.view.height); | 36 renderView.layout(newWidth: sky.view.width, newHeight: sky.view.height); |
37 expect(root.width, equals(sky.view.width)); | 37 expect(root.width, equals(sky.view.width)); |
38 expect(root.height, equals(sky.view.height)); | 38 expect(root.height, equals(sky.view.height)); |
39 }); | 39 }); |
40 } | 40 } |
OLD | NEW |