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 '../resources/display-list.dart'; | |
abarth-chromium
2015/05/29 00:32:29
______
| |
7 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
8 import 'package:sky/framework/rendering/render_box.dart'; | 9 import 'package:sky/framework/rendering/render_box.dart'; |
9 | 10 |
10 void main() { | 11 void main() { |
11 initUnit(); | 12 initUnit(); |
12 | 13 |
13 test("should size to render view", () { | 14 test("should size to render view", () { |
14 RenderSizedBox root = new RenderSizedBox( | 15 RenderSizedBox root = new RenderSizedBox( |
15 child: new RenderDecoratedBox( | 16 child: new RenderDecoratedBox( |
16 decoration: new BoxDecoration(backgroundColor: 0xFF00FF00) | 17 decoration: new BoxDecoration(backgroundColor: 0xFF00FF00) |
17 ) | 18 ) |
18 ); | 19 ); |
19 RenderView renderView = new RenderView(child: root); | 20 TestView renderView = new TestView(child: root); |
20 renderView.layout(new ViewConstraints(width: sky.view.width, height: sky.vie w.height)); | 21 renderView.layout(new ViewConstraints(width: sky.view.width, height: sky.vie w.height)); |
21 expect(root.size.width, equals(sky.view.width)); | 22 expect(root.size.width, equals(sky.view.width)); |
22 expect(root.size.height, equals(sky.view.height)); | 23 expect(root.size.height, equals(sky.view.height)); |
24 renderView.paintFrame(); | |
25 print(renderView.lastPaint); // TODO(ianh): figure out how to make this fit the unit testing framework better | |
23 }); | 26 }); |
24 } | 27 } |
OLD | NEW |