Add some basic tests for the material buttons

Specifically, RaisedButton, FlatButton, and FloatingActionButton. These just
test that these classes work in their default configurations.

R=ianh@google.com, jackson@chromium.org

Review URL: https://codereview.chromium.org/1193453005.
This commit is contained in:
Adam Barth 2015-06-16 17:02:58 -07:00
parent c0b4ef6b14
commit 3fa0816576
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,50 @@
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 RenderPositionedBox at Point(0.0, 0.0)
2 | | TestDisplayList() constructor: 800.0 x 600.0
2 | | paintChild RenderPadding at Point(348.0, 274.0)
2 | | | TestDisplayList() constructor: 800.0 x 600.0
2 | | | paintChild RenderConstrainedBox at Point(8.0, 8.0)
2 | | | | TestDisplayList() constructor: 800.0 x 600.0
2 | | | | drawRRect(Instance of 'RRect', Paint(Color(0xffe0e0e0)))
2 | | | | paintChild RenderPositionedBox at Point(8.0, 0.0)
2 | | | | | TestDisplayList() constructor: 800.0 x 600.0
2 | | | | | paintChild RenderParagraph at Point(6.0, 10.0)
2 | | | | | | TestDisplayList() constructor: 800.0 x 600.0
------------------------------------------------------------------------
CONSOLE:
PAINT FOR FRAME #3 ----------------------------------------------
3 | TestDisplayList() constructor: 800.0 x 600.0
3 | paintChild RenderPositionedBox at Point(0.0, 0.0)
3 | | TestDisplayList() constructor: 800.0 x 600.0
3 | | paintChild RenderPadding at Point(348.0, 274.0)
3 | | | TestDisplayList() constructor: 800.0 x 600.0
3 | | | paintChild RenderConstrainedBox at Point(8.0, 8.0)
3 | | | | TestDisplayList() constructor: 800.0 x 600.0
3 | | | | drawRRect(Instance of 'RRect', Paint(Color(0xfffafafa)))
3 | | | | paintChild RenderPositionedBox at Point(8.0, 0.0)
3 | | | | | TestDisplayList() constructor: 800.0 x 600.0
3 | | | | | paintChild RenderParagraph at Point(6.0, 10.0)
3 | | | | | | TestDisplayList() constructor: 800.0 x 600.0
------------------------------------------------------------------------
CONSOLE:
PAINT FOR FRAME #4 ----------------------------------------------
4 | TestDisplayList() constructor: 800.0 x 600.0
4 | paintChild RenderPositionedBox at Point(0.0, 0.0)
4 | | TestDisplayList() constructor: 800.0 x 600.0
4 | | paintChild RenderDecoratedBox at Point(372.0, 272.0)
4 | | | TestDisplayList() constructor: 800.0 x 600.0
4 | | | drawCircle(28.0, 28.0, 28.0, Paint(Color(0xfff44336)))
4 | | | saveLayer(Rect.fromLTRB(0.0, 0.0, 56.0, 56.0), Paint(Color(0xff000000)))
4 | | | clipPath(Instance of 'Path')
4 | | | paintChild RenderParagraph at Point(22.0, 20.0)
4 | | | | TestDisplayList() constructor: 800.0 x 600.0
4 | | | restore
------------------------------------------------------------------------
PAINTED 4 FRAMES

View File

@ -0,0 +1,28 @@
// 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/flat_button.dart';
import 'package:sky/widgets/floating_action_button.dart';
import 'package:sky/widgets/raised_button.dart';
import '../resources/display_list.dart';
main() async {
WidgetTester tester = new WidgetTester();
await tester.test(() {
return new Center(child: new RaisedButton(child: new Text("ENGAGE")));
});
await tester.test(() {
return new Center(child: new FlatButton(child: new Text("ENGAGE")));
});
await tester.test(() {
return new Center(child: new FloatingActionButton(child: new Text("+")));
});
await tester.endTest();
}