diff --git a/engine/src/flutter/tests/raw/box_layout-expected.txt b/engine/src/flutter/tests/raw/box_layout-expected.txt index a3d0b908bc..87801ba731 100644 --- a/engine/src/flutter/tests/raw/box_layout-expected.txt +++ b/engine/src/flutter/tests/raw/box_layout-expected.txt @@ -1,16 +1,16 @@ CONSOLE: unittest-suite-wait-for-done -CONSOLE: TestView enabled +CONSOLE: TestRenderView enabled CONSOLE: PAINT FOR FRAME #1 ---------------------------------------------- 1 | TestDisplayList() constructor: 800.0 x 600.0 -1 | paintChild at 0.0,0.0 +1 | paintChild RenderDecoratedBox at Point(0.0, 0.0) 1 | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | drawRect(0.0:0.0:600.0:800.0, Paint(Color(0xff0000ff))) -1 | | paintChild at 0.0,0.0 +1 | | drawRect(Rect.fromLTRB(0.0, 0.0, 800.0, 600.0), Paint(Color(0xff0000ff))) +1 | | paintChild RenderPadding at Point(0.0, 0.0) 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | paintChild at 50.0,50.0 +1 | | | paintChild RenderDecoratedBox at Point(50.0, 50.0) 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:100.0:700.0, Paint(Color(0xff00ff00))) +1 | | | | drawRect(Rect.fromLTRB(0.0, 0.0, 700.0, 100.0), Paint(Color(0xff00ff00))) ------------------------------------------------------------------------ CONSOLE: PASS: padding CONSOLE: diff --git a/engine/src/flutter/tests/raw/box_layout.dart b/engine/src/flutter/tests/raw/box_layout.dart index 8f0f7286e1..65e4213fb6 100644 --- a/engine/src/flutter/tests/raw/box_layout.dart +++ b/engine/src/flutter/tests/raw/box_layout.dart @@ -1,14 +1,14 @@ -import '../resources/third_party/unittest/unittest.dart'; -import '../resources/unit.dart'; -import '../resources/display_list.dart'; import 'dart:math' as math; import 'dart:sky' as sky; + import 'package:sky/framework/app.dart'; -import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/block.dart'; +import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/object.dart'; -TestApp app; +import '../resources/display_list.dart'; +import '../resources/third_party/unittest/unittest.dart'; +import '../resources/unit.dart'; void main() { initUnit(); @@ -19,6 +19,6 @@ void main() { var padding = new RenderPadding(padding: new EdgeDims.all(50.0), child: inner); var block = new RenderBlock(children: [padding]); var outer = new RenderDecoratedBox(decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF0000FF)), child: block); - app = new TestApp(outer); + new TestRenderView(outer); }); } diff --git a/engine/src/flutter/tests/raw/padding_deflate-expected.txt b/engine/src/flutter/tests/raw/padding_deflate-expected.txt index a6444cb469..ebc2a1baae 100644 --- a/engine/src/flutter/tests/raw/padding_deflate-expected.txt +++ b/engine/src/flutter/tests/raw/padding_deflate-expected.txt @@ -1,5 +1,13 @@ CONSOLE: unittest-suite-wait-for-done -CONSOLE: TestView enabled +CONSOLE: TestRenderView enabled +CONSOLE: +PAINT FOR FRAME #1 ---------------------------------------------- +1 | TestDisplayList() constructor: 800.0 x 600.0 +1 | paintChild RenderDecoratedBox at Point(0.0, 0.0) +1 | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | paintChild RenderDecoratedBox at Point(10.0, 10.0) +1 | | | TestDisplayList() constructor: 800.0 x 600.0 +------------------------------------------------------------------------ CONSOLE: PASS: should not have a 0 sized colored Box CONSOLE: CONSOLE: All 1 tests passed. diff --git a/engine/src/flutter/tests/raw/padding_deflate.dart b/engine/src/flutter/tests/raw/padding_deflate.dart index 091db772f8..80533cd167 100644 --- a/engine/src/flutter/tests/raw/padding_deflate.dart +++ b/engine/src/flutter/tests/raw/padding_deflate.dart @@ -3,12 +3,14 @@ // 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'; import 'package:sky/framework/rendering/object.dart'; +import '../resources/display_list.dart'; +import '../resources/third_party/unittest/unittest.dart'; +import '../resources/unit.dart'; + void main() { initUnit(); @@ -22,11 +24,7 @@ void main() { decoration: new BoxDecoration(), child: paddingBox ); - TestView renderView = new TestView(child: root); - renderView.attach(); - renderView.rootConstraints = new ViewConstraints(width: sky.view.width, height: sky.view.height); - renderView.scheduleInitialLayout(); - RenderObject.flushLayout(); + new TestRenderView(root); expect(coloredBox.size.width, equals(sky.view.width - 20)); expect(coloredBox.size.height, equals(sky.view.height - 20)); }); diff --git a/engine/src/flutter/tests/raw/render_box-expected.txt b/engine/src/flutter/tests/raw/render_box-expected.txt index 49a9ef1b30..4e08ce8916 100644 --- a/engine/src/flutter/tests/raw/render_box-expected.txt +++ b/engine/src/flutter/tests/raw/render_box-expected.txt @@ -1,11 +1,11 @@ CONSOLE: unittest-suite-wait-for-done -CONSOLE: TestView enabled +CONSOLE: TestRenderView enabled CONSOLE: PAINT FOR FRAME #1 ---------------------------------------------- 1 | TestDisplayList() constructor: 800.0 x 600.0 -1 | paintChild at 0.0,0.0 +1 | paintChild RenderSizedBox at Point(0.0, 0.0) 1 | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | drawRect(0.0:0.0:600.0:800.0, Paint(Color(0xff00ff00))) +1 | | drawRect(Rect.fromLTRB(0.0, 0.0, 800.0, 600.0), Paint(Color(0xff00ff00))) ------------------------------------------------------------------------ CONSOLE: PASS: should size to render view CONSOLE: diff --git a/engine/src/flutter/tests/raw/render_box.dart b/engine/src/flutter/tests/raw/render_box.dart index 25ff3bb8d7..e322213d56 100644 --- a/engine/src/flutter/tests/raw/render_box.dart +++ b/engine/src/flutter/tests/raw/render_box.dart @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -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'; import 'package:sky/framework/rendering/object.dart'; +import '../resources/display_list.dart'; +import '../resources/third_party/unittest/unittest.dart'; +import '../resources/unit.dart'; + void main() { initUnit(); @@ -18,14 +20,8 @@ void main() { decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00)) ) ); - TestView renderView = new TestView(child: root); - renderView.attach(); - renderView.rootConstraints = new ViewConstraints(width: sky.view.width, height: sky.view.height); - renderView.scheduleInitialLayout(); - RenderObject.flushLayout(); + new TestRenderView(root); expect(root.size.width, equals(sky.view.width)); expect(root.size.height, equals(sky.view.height)); - renderView.paintFrame(); - print(renderView.lastPaint); // TODO(ianh): figure out how to make this fit the unit testing framework better }); } diff --git a/engine/src/flutter/tests/raw/render_flex-expected.txt b/engine/src/flutter/tests/raw/render_flex-expected.txt index a325343560..137e7512f0 100644 --- a/engine/src/flutter/tests/raw/render_flex-expected.txt +++ b/engine/src/flutter/tests/raw/render_flex-expected.txt @@ -1,37 +1,37 @@ CONSOLE: unittest-suite-wait-for-done -CONSOLE: TestView enabled +CONSOLE: TestRenderView enabled CONSOLE: PAINT FOR FRAME #1 ---------------------------------------------- 1 | TestDisplayList() constructor: 800.0 x 600.0 -1 | paintChild at 0.0,0.0 +1 | paintChild RenderDecoratedBox at Point(0.0, 0.0) 1 | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | drawRect(0.0:0.0:600.0:800.0, Paint(Color(0xff000000))) -1 | | paintChild at 0.0,0.0 +1 | | drawRect(Rect.fromLTRB(0.0, 0.0, 800.0, 600.0), Paint(Color(0xff000000))) +1 | | paintChild RenderSolidColor at Point(0.0, 0.0) 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | drawRect(0.0:0.0:82.5:800.0, Paint(Color(0xffffff00))) -1 | | paintChild at 350.0,82.5 +1 | | | drawRect(Rect.fromLTRB(0.0, 0.0, 800.0, 82.5), Paint(Color(0xffffff00))) +1 | | paintChild RenderSolidColor at Point(350.0, 82.5) 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | drawRect(0.0:0.0:100.0:100.0, Paint(Color(0x7700ffff))) -1 | | paintChild at 0.0,182.5 +1 | | | drawRect(Rect.fromLTRB(0.0, 0.0, 100.0, 100.0), Paint(Color(0x7700ffff))) +1 | | paintChild RenderPadding at Point(0.0, 182.5) 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | paintChild at 10.0,10.0 +1 | | | paintChild RenderDecoratedBox at Point(10.0, 10.0) 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:150.0:780.0, Paint(Color(0xffffffff))) -1 | | | | paintChild at 0.0,0.0 +1 | | | | drawRect(Rect.fromLTRB(0.0, 0.0, 780.0, 150.0), Paint(Color(0xffffffff))) +1 | | | | paintChild RenderSolidColor at Point(0.0, 0.0) 1 | | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | | drawRect(0.0:0.0:50.0:780.0, Paint(Color(0xff00ff00))) -1 | | | | paintChild at 0.0,50.0 +1 | | | | | drawRect(Rect.fromLTRB(0.0, 0.0, 780.0, 50.0), Paint(Color(0xff00ff00))) +1 | | | | paintChild RenderSolidColor at Point(0.0, 50.0) 1 | | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | | drawRect(0.0:0.0:100.0:780.0, Paint(Color(0x7700ffff))) -1 | | paintChild at 0.0,352.5 +1 | | | | | drawRect(Rect.fromLTRB(0.0, 0.0, 780.0, 100.0), Paint(Color(0x7700ffff))) +1 | | paintChild RenderDecoratedBox at Point(0.0, 352.5) 1 | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | drawRect(0.0:0.0:247.5:800.0, Paint(Color(0xff333333))) -1 | | | paintChild at 0.0,0.0 +1 | | | drawRect(Rect.fromLTRB(0.0, 0.0, 800.0, 247.5), Paint(Color(0xff333333))) +1 | | | paintChild RenderSolidColor at Point(0.0, 0.0) 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:247.5:266.6666564941406, Paint(Color(0x77ff00ff))) -1 | | | paintChild at 266.6666666666667,0.0 +1 | | | | drawRect(Rect.fromLTRB(0.0, 0.0, 266.6666564941406, 247.5), Paint(Color(0x77ff00ff))) +1 | | | paintChild RenderSolidColor at Point(266.6666666666667, 0.0) 1 | | | | TestDisplayList() constructor: 800.0 x 600.0 -1 | | | | drawRect(0.0:0.0:247.5:533.3333129882812, Paint(Color(0xff0000ff))) +1 | | | | drawRect(Rect.fromLTRB(0.0, 0.0, 533.3333129882812, 247.5), Paint(Color(0xff0000ff))) ------------------------------------------------------------------------ CONSOLE: PASS: should flex CONSOLE: diff --git a/engine/src/flutter/tests/raw/render_flex.dart b/engine/src/flutter/tests/raw/render_flex.dart index 49baa219a5..a19861aa07 100644 --- a/engine/src/flutter/tests/raw/render_flex.dart +++ b/engine/src/flutter/tests/raw/render_flex.dart @@ -2,15 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -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/app.dart'; import 'package:sky/framework/rendering/block.dart'; import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/flex.dart'; +import '../resources/display_list.dart'; +import '../resources/third_party/unittest/unittest.dart'; +import '../resources/unit.dart'; + class RenderSolidColor extends RenderDecoratedBox { final sky.Size desiredSize; final sky.Color backgroundColor; @@ -48,8 +50,6 @@ class RenderSolidColor extends RenderDecoratedBox { } } -TestApp app; - void main() { initUnit(); @@ -99,7 +99,8 @@ void main() { flexRoot.add(decoratedRow); decoratedRow.parentData.flex = 3; - app = new TestApp(root); + + new TestRenderView(root); expect(root.size.width, equals(sky.view.width)); expect(root.size.height, equals(sky.view.height));