Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: sky/tests/raw/render_flex.dart

Issue 1158983005: Implement Container in fn2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: nit Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 var renderBlock = new RenderBlock(); 65 var renderBlock = new RenderBlock();
66 66
67 renderBlock.add(new RenderSolidColor(0xFF00FF00, desiredSize: new sky.Size(1 00.0, 50.0))); 67 renderBlock.add(new RenderSolidColor(0xFF00FF00, desiredSize: new sky.Size(1 00.0, 50.0)));
68 renderBlock.add(new RenderSolidColor(0x7700FFFF, desiredSize: new sky.Size(5 0.0, 100.0))); 68 renderBlock.add(new RenderSolidColor(0x7700FFFF, desiredSize: new sky.Size(5 0.0, 100.0)));
69 69
70 var renderDecoratedBlock = new RenderDecoratedBox( 70 var renderDecoratedBlock = new RenderDecoratedBox(
71 decoration: new BoxDecoration(backgroundColor: 0xFFFFFFFF), 71 decoration: new BoxDecoration(backgroundColor: 0xFFFFFFFF),
72 child: renderBlock 72 child: renderBlock
73 ); 73 );
74 74
75 flexRoot.add(new RenderPadding(const EdgeDims(10.0, 10.0, 10.0, 10.0), rende rDecoratedBlock)); 75 flexRoot.add(new RenderPadding(padding: const EdgeDims(10.0, 10.0, 10.0, 10. 0),
Hixie 2015/06/02 21:52:21 This can be const EdgeDims.all(10.0) now.
abarth-chromium 2015/06/02 22:32:21 Done.
76 child: renderDecoratedBlock));
76 77
77 var row = new RenderFlex(direction: FlexDirection.Horizontal); 78 var row = new RenderFlex(direction: FlexDirection.Horizontal);
78 79
79 // Purple and blue cells 80 // Purple and blue cells
80 addFlexChildSolidColor(row, 0x77FF00FF, flex: 1); 81 addFlexChildSolidColor(row, 0x77FF00FF, flex: 1);
81 addFlexChildSolidColor(row, 0xFF0000FF, flex: 2); 82 addFlexChildSolidColor(row, 0xFF0000FF, flex: 2);
82 83
83 var decoratedRow = new RenderDecoratedBox( 84 var decoratedRow = new RenderDecoratedBox(
84 decoration: new BoxDecoration(backgroundColor: 0xFF333333), 85 decoration: new BoxDecoration(backgroundColor: 0xFF333333),
85 child: row 86 child: row
86 ); 87 );
87 88
88 flexRoot.add(decoratedRow); 89 flexRoot.add(decoratedRow);
89 decoratedRow.parentData.flex = 3; 90 decoratedRow.parentData.flex = 3;
90 app = new TestApp(root); 91 app = new TestApp(root);
91 92
92 expect(root.size.width, equals(sky.view.width)); 93 expect(root.size.width, equals(sky.view.width));
93 expect(root.size.height, equals(sky.view.height)); 94 expect(root.size.height, equals(sky.view.height));
94 expect(renderBlock.size.width, equals(sky.view.width - 20.0)); 95 expect(renderBlock.size.width, equals(sky.view.width - 20.0));
95 96
96 }); 97 });
97 } 98 }
OLDNEW
« sky/sdk/lib/framework/rendering/box.dart ('K') | « sky/sdk/lib/framework/rendering/box.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698