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

Unified Diff: sky/tests/raw/render_box.dart

Issue 1156303004: Use Point, Size, and Rect in layout2.dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address review comments Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/layout2.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/raw/render_box.dart
diff --git a/sky/tests/raw/render_box.dart b/sky/tests/raw/render_box.dart
index c3d3412767ce15a14f62a4fad95ed38b3685caae..bb15c80516239c0e9d2312473e31f86b7020d730 100644
--- a/sky/tests/raw/render_box.dart
+++ b/sky/tests/raw/render_box.dart
@@ -8,22 +8,18 @@ import 'dart:sky' as sky;
import 'package:sky/framework/layout2.dart';
class RenderSizedBox extends RenderBox {
- final double desiredHeight;
- final double desiredWidth;
+ final sky.Size desiredSize;
- RenderSizedBox({ this.desiredHeight: double.INFINITY,
- this.desiredWidth: double.INFINITY });
+ RenderSizedBox({ this.desiredSize });
BoxDimensions getIntrinsicDimensions(BoxConstraints constraints) {
return new BoxDimensions.withConstraints(constraints,
- height: desiredHeight,
- width: desiredWidth);
+ width: desiredSize.width,
+ height: desiredSize.height);
}
- void layout(BoxConstraints constraints, { RenderNode relayoutSubtreeRoot }) {
- width = constraints.constrainWidth(desiredWidth);
- height = constraints.constrainHeight(desiredHeight);
- layoutDone();
+ void performLayout() {
+ size = constraints.constrain(desiredSize);
}
}
@@ -31,10 +27,10 @@ void main() {
initUnit();
test("should size to render view", () {
- RenderSizedBox root = new RenderSizedBox();
+ RenderSizedBox root = new RenderSizedBox(desiredSize: new sky.Size.infinite());
RenderView renderView = new RenderView(child: root);
- renderView.layout(newWidth: sky.view.width, newHeight: sky.view.height);
- expect(root.width, equals(sky.view.width));
- expect(root.height, equals(sky.view.height));
+ renderView.layout(new ViewConstraints(width: sky.view.width, height: sky.view.height));
+ expect(root.size.width, equals(sky.view.width));
+ expect(root.size.height, equals(sky.view.height));
});
}
« no previous file with comments | « sky/sdk/lib/framework/layout2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698