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; | 5 import 'dart:sky' as sky; |
6 | 6 |
7 import 'package:sky/framework/rendering/box.dart'; | 7 import 'package:sky/rendering/box.dart'; |
8 import 'package:sky/framework/rendering/object.dart'; | 8 import 'package:sky/rendering/object.dart'; |
9 | 9 |
10 import '../resources/display_list.dart'; | 10 import '../resources/display_list.dart'; |
11 import '../resources/third_party/unittest/unittest.dart'; | 11 import '../resources/third_party/unittest/unittest.dart'; |
12 import '../resources/unit.dart'; | 12 import '../resources/unit.dart'; |
13 | 13 |
14 void main() { | 14 void main() { |
15 initUnit(); | 15 initUnit(); |
16 | 16 |
17 test("should not have a 0 sized colored Box", () { | 17 test("should not have a 0 sized colored Box", () { |
18 var coloredBox = new RenderDecoratedBox( | 18 var coloredBox = new RenderDecoratedBox( |
19 decoration: new BoxDecoration() | 19 decoration: new BoxDecoration() |
20 ); | 20 ); |
21 var paddingBox = new RenderPadding(padding: const EdgeDims.all(10.0), | 21 var paddingBox = new RenderPadding(padding: const EdgeDims.all(10.0), |
22 child: coloredBox); | 22 child: coloredBox); |
23 RenderBox root = new RenderDecoratedBox( | 23 RenderBox root = new RenderDecoratedBox( |
24 decoration: new BoxDecoration(), | 24 decoration: new BoxDecoration(), |
25 child: paddingBox | 25 child: paddingBox |
26 ); | 26 ); |
27 new TestRenderView(root); | 27 new TestRenderView(root); |
28 expect(coloredBox.size.width, equals(sky.view.width - 20)); | 28 expect(coloredBox.size.width, equals(sky.view.width - 20)); |
29 expect(coloredBox.size.height, equals(sky.view.height - 20)); | 29 expect(coloredBox.size.height, equals(sky.view.height - 20)); |
30 }); | 30 }); |
31 } | 31 } |
OLD | NEW |