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

Unified Diff: sky/tests/resources/display_list.dart

Issue 1192003003: Clean up the tests to be more maintainable. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « sky/tests/raw/box_layout-expected.txt ('k') | sky/tests/widgets/buttons.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/resources/display_list.dart
diff --git a/sky/tests/resources/display_list.dart b/sky/tests/resources/display_list.dart
index 7de956b696d2689c487ad090ccf4dbfbe4330180..d831d0412ad736fa2449aed4cca75c3a8b24466e 100644
--- a/sky/tests/resources/display_list.dart
+++ b/sky/tests/resources/display_list.dart
@@ -124,7 +124,7 @@ class TestRenderView extends RenderView {
attach();
rootConstraints = new ViewConstraints(width: 800.0, height: 600.0); // arbitrary figures
scheduleInitialLayout();
- checkFrame();
+ syncCheckFrame();
}
int frame = 0;
@@ -147,12 +147,16 @@ class TestRenderView extends RenderView {
// TEST API:
- void checkFrame() {
+ void syncCheckFrame() {
RenderObject.flushLayout();
paintFrame();
print(lastPaint); // TODO(ianh): figure out how to make this fit the unit testing framework better
}
+ Future checkFrame() {
+ return new Future.microtask(syncCheckFrame);
+ }
+
void endTest() {
internals.notifyTestComplete("PAINTED $frame FRAMES");
}
@@ -174,10 +178,10 @@ class WidgetTester {
Future test(Function builder) {
runApp(new TestApp(builder: builder), renderViewOverride: renderView);
- return new Future.microtask(renderView.checkFrame);
+ return renderView.checkFrame();
}
- Future endTest() {
- return new Future.microtask(renderView.endTest);
+ void endTest() {
+ renderView.endTest();
}
}
« no previous file with comments | « sky/tests/raw/box_layout-expected.txt ('k') | sky/tests/widgets/buttons.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698