diff --git a/engine/src/flutter/tests/raw/padding_deflate-expected.txt b/engine/src/flutter/tests/raw/padding_deflate-expected.txt new file mode 100644 index 0000000000..a6444cb469 --- /dev/null +++ b/engine/src/flutter/tests/raw/padding_deflate-expected.txt @@ -0,0 +1,7 @@ +CONSOLE: unittest-suite-wait-for-done +CONSOLE: TestView enabled +CONSOLE: PASS: should not have a 0 sized colored Box +CONSOLE: +CONSOLE: All 1 tests passed. +CONSOLE: unittest-suite-success +DONE diff --git a/engine/src/flutter/tests/raw/padding_deflate.dart b/engine/src/flutter/tests/raw/padding_deflate.dart new file mode 100644 index 0000000000..ffda37cfab --- /dev/null +++ b/engine/src/flutter/tests/raw/padding_deflate.dart @@ -0,0 +1,26 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// 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 'package:sky/framework/rendering/box.dart'; + +void main() { + initUnit(); + + 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(coloredBox.size.width, equals(sky.view.width - 20)); + expect(coloredBox.size.height, equals(sky.view.height - 20)); + }); +}