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'; | 7 import '../resources/display_list.dart'; |
8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
9 import 'package:sky/framework/app.dart'; | 9 import 'package:sky/framework/app.dart'; |
10 import 'package:sky/framework/rendering/block.dart'; | 10 import 'package:sky/framework/rendering/block.dart'; |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 sky.Size getIntrinsicDimensions(BoxConstraints constraints) { | 23 sky.Size getIntrinsicDimensions(BoxConstraints constraints) { |
24 return constraints.constrain(desiredSize); | 24 return constraints.constrain(desiredSize); |
25 } | 25 } |
26 | 26 |
27 void performLayout() { | 27 void performLayout() { |
28 size = constraints.constrain(desiredSize); | 28 size = constraints.constrain(desiredSize); |
29 } | 29 } |
30 | 30 |
31 void handlePointer(sky.PointerEvent event) { | 31 void handleEvent(sky.Event event) { |
32 if (event.type == 'pointerdown') | 32 if (event.type == 'pointerdown') |
33 decoration = new BoxDecoration(backgroundColor: const sky.Color(0xFFFF0000
)); | 33 decoration = new BoxDecoration(backgroundColor: const sky.Color(0xFFFF0000
)); |
34 else if (event.type == 'pointerup') | 34 else if (event.type == 'pointerup') |
35 decoration = new BoxDecoration(backgroundColor: backgroundColor); | 35 decoration = new BoxDecoration(backgroundColor: backgroundColor); |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 TestApp app; | 39 TestApp app; |
40 | 40 |
41 void main() { | 41 void main() { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 flexRoot.add(decoratedRow); | 88 flexRoot.add(decoratedRow); |
89 decoratedRow.parentData.flex = 3; | 89 decoratedRow.parentData.flex = 3; |
90 app = new TestApp(root); | 90 app = new TestApp(root); |
91 | 91 |
92 expect(root.size.width, equals(sky.view.width)); | 92 expect(root.size.width, equals(sky.view.width)); |
93 expect(root.size.height, equals(sky.view.height)); | 93 expect(root.size.height, equals(sky.view.height)); |
94 expect(renderBlock.size.width, equals(sky.view.width - 20.0)); | 94 expect(renderBlock.size.width, equals(sky.view.width - 20.0)); |
95 | 95 |
96 }); | 96 }); |
97 } | 97 } |
OLD | NEW |