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

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

Issue 1153413003: Fix min/max typo in BoxConstraints.deflate (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
Index: sky/tests/raw/padding_deflate.dart
diff --git a/sky/tests/raw/render_box.dart b/sky/tests/raw/padding_deflate.dart
similarity index 63%
copy from sky/tests/raw/render_box.dart
copy to sky/tests/raw/padding_deflate.dart
index bf44896174dd56ff6d721bd1174664aa77f25058..59d5b0235245e94898444956b9a5d91a0012118d 100644
--- a/sky/tests/raw/render_box.dart
+++ b/sky/tests/raw/padding_deflate.dart
@@ -2,25 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import 'dart:sky' as sky;
import '../resources/third_party/unittest/unittest.dart';
import '../resources/unit.dart';
import '../resources/display_list.dart';
-import 'dart:sky' as sky;
import 'package:sky/framework/rendering/box.dart';
void main() {
initUnit();
- test("should size to render view", () {
- RenderSizedBox root = new RenderSizedBox(
- child: new RenderDecoratedBox(
- decoration: new BoxDecoration(backgroundColor: 0xFF00FF00)
- )
+ test("should not have a 0 sized colored Box", () {
+ var coloredBox = new RenderDecoratedBox();
+ var paddingBox = new RenderPadding(padding: const EdgeDims.all(10.0),
+ child: coloredBox);
+ RenderBox root = new RenderDecoratedBox(
+ child: paddingBox
);
TestView renderView = new TestView(child: root);
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));
+ expect(coloredBox.size.width, equals(sky.view.width - 20));
+ expect(coloredBox.size.height, equals(sky.view.height - 20));
renderView.paintFrame();
print(renderView.lastPaint); // TODO(ianh): figure out how to make this fit the unit testing framework better
});

Powered by Google App Engine
This is Rietveld 408576698