From f1193d37bd8dde89c0efd97c8af6d77cbd099b86 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 16 Jun 2015 17:11:23 -0700 Subject: [PATCH] Add a basic Dialog The dialog will need many more features to be complete, but this class is a basic skeleton of what we'll need. R=jackson@google.com, jackson@chromium.org Review URL: https://codereview.chromium.org/1189893002. --- .../flutter/tests/widgets/dialog-expected.txt | 24 +++++++++++++++++++ engine/src/flutter/tests/widgets/dialog.dart | 21 ++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 engine/src/flutter/tests/widgets/dialog-expected.txt create mode 100644 engine/src/flutter/tests/widgets/dialog.dart diff --git a/engine/src/flutter/tests/widgets/dialog-expected.txt b/engine/src/flutter/tests/widgets/dialog-expected.txt new file mode 100644 index 00000000000..0c76eb7d078 --- /dev/null +++ b/engine/src/flutter/tests/widgets/dialog-expected.txt @@ -0,0 +1,24 @@ +CONSOLE: TestRenderView enabled +CONSOLE: +PAINT FOR FRAME #1 ---------------------------------------------- +1 | TestDisplayList() constructor: 800.0 x 600.0 +------------------------------------------------------------------------ +CONSOLE: +PAINT FOR FRAME #2 ---------------------------------------------- +2 | TestDisplayList() constructor: 800.0 x 600.0 +2 | paintChild RenderStack at Point(0.0, 0.0) +2 | | TestDisplayList() constructor: 800.0 x 600.0 +2 | | paintChild RenderDecoratedBox at Point(0.0, 0.0) +2 | | | TestDisplayList() constructor: 800.0 x 600.0 +2 | | | drawRect(Rect.fromLTRB(0.0, 0.0, 800.0, 600.0), Paint(Color(0x7f000000))) +2 | | paintChild RenderPositionedBox at Point(0.0, 0.0) +2 | | | TestDisplayList() constructor: 800.0 x 600.0 +2 | | | paintChild RenderConstrainedBox at Point(260.0, 284.0) +2 | | | | TestDisplayList() constructor: 800.0 x 600.0 +2 | | | | drawRRect(Instance of 'RRect', Paint(Color(0xfffafafa))) +2 | | | | paintChild RenderParagraph at Point(0.0, 0.0) +2 | | | | | TestDisplayList() constructor: 800.0 x 600.0 +2 | | | | paintChild RenderParagraph at Point(0.0, 16.0) +2 | | | | | TestDisplayList() constructor: 800.0 x 600.0 +------------------------------------------------------------------------ +PAINTED 2 FRAMES diff --git a/engine/src/flutter/tests/widgets/dialog.dart b/engine/src/flutter/tests/widgets/dialog.dart new file mode 100644 index 00000000000..b90a413f9b0 --- /dev/null +++ b/engine/src/flutter/tests/widgets/dialog.dart @@ -0,0 +1,21 @@ +// 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 'package:sky/widgets/basic.dart'; +import 'package:sky/widgets/dialog.dart'; + +import '../resources/display_list.dart'; + +main() async { + WidgetTester tester = new WidgetTester(); + + await tester.test(() { + return new Dialog( + title: new Text("I am a title"), + content: new Text("I am some content") + ); + }); + + await tester.endTest(); +}