Make it easier to disable print throttling. (#3941)

This exposes the default throttling implementation, and an alternative
non-throttling implementation, of `debugPrint`.
This commit is contained in:
Ian Hickson
2016-05-16 13:24:06 -07:00
parent a03c8f77ad
commit 7d2519f073
2 changed files with 24 additions and 17 deletions

View File

@@ -339,19 +339,11 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
@override
void initInstances() {
debugPrint = _synchronousDebugPrint;
debugPrint = debugPrintSynchronously;
super.initInstances();
ui.window.onBeginFrame = null;
}
void _synchronousDebugPrint(String message, { int wrapWidth }) {
if (wrapWidth != null) {
print(message.split('\n').expand((String line) => debugWordWrap(line, wrapWidth)).join('\n'));
} else {
print(message);
}
}
FakeAsync _fakeAsync;
Clock _clock;