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 'dart:sky' as sky; |
| 6 |
| 7 import 'package:sky/framework/rendering/box.dart'; |
| 8 import 'package:sky/framework/rendering/object.dart'; |
| 9 |
| 10 import '../resources/display_list.dart'; |
5 import '../resources/third_party/unittest/unittest.dart'; | 11 import '../resources/third_party/unittest/unittest.dart'; |
6 import '../resources/unit.dart'; | 12 import '../resources/unit.dart'; |
7 import '../resources/display_list.dart'; | |
8 import 'dart:sky' as sky; | |
9 import 'package:sky/framework/rendering/box.dart'; | |
10 import 'package:sky/framework/rendering/object.dart'; | |
11 | 13 |
12 void main() { | 14 void main() { |
13 initUnit(); | 15 initUnit(); |
14 | 16 |
15 test("should size to render view", () { | 17 test("should size to render view", () { |
16 RenderSizedBox root = new RenderSizedBox( | 18 RenderSizedBox root = new RenderSizedBox( |
17 child: new RenderDecoratedBox( | 19 child: new RenderDecoratedBox( |
18 decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF0
0)) | 20 decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF0
0)) |
19 ) | 21 ) |
20 ); | 22 ); |
21 TestView renderView = new TestView(child: root); | 23 new TestRenderView(root); |
22 renderView.attach(); | |
23 renderView.rootConstraints = new ViewConstraints(width: sky.view.width, heig
ht: sky.view.height); | |
24 renderView.scheduleInitialLayout(); | |
25 RenderObject.flushLayout(); | |
26 expect(root.size.width, equals(sky.view.width)); | 24 expect(root.size.width, equals(sky.view.width)); |
27 expect(root.size.height, equals(sky.view.height)); | 25 expect(root.size.height, equals(sky.view.height)); |
28 renderView.paintFrame(); | |
29 print(renderView.lastPaint); // TODO(ianh): figure out how to make this fit
the unit testing framework better | |
30 }); | 26 }); |
31 } | 27 } |
OLD | NEW |