Commit f68c6fb8 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Fix package_test flakiness, init ensure terminal context entry is set (#10333)

parent 77c07871
...@@ -178,6 +178,7 @@ class BufferLogger extends Logger { ...@@ -178,6 +178,7 @@ class BufferLogger extends Logger {
class VerboseLogger extends Logger { class VerboseLogger extends Logger {
VerboseLogger(this.parent) { VerboseLogger(this.parent) {
assert(terminal != null);
stopwatch.start(); stopwatch.start();
} }
......
...@@ -12,6 +12,7 @@ import 'package:flutter_tools/src/base/logger.dart'; ...@@ -12,6 +12,7 @@ import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.dart'; import 'package:flutter_tools/src/base/os.dart';
import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/port_scanner.dart'; import 'package:flutter_tools/src/base/port_scanner.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/devfs.dart'; import 'package:flutter_tools/src/devfs.dart';
import 'package:flutter_tools/src/device.dart'; import 'package:flutter_tools/src/device.dart';
...@@ -40,6 +41,7 @@ typedef void ContextInitializer(AppContext testContext); ...@@ -40,6 +41,7 @@ typedef void ContextInitializer(AppContext testContext);
void _defaultInitializeContext(AppContext testContext) { void _defaultInitializeContext(AppContext testContext) {
testContext testContext
..putIfAbsent(AnsiTerminal, () => new AnsiTerminal())
..putIfAbsent(DeviceManager, () => new MockDeviceManager()) ..putIfAbsent(DeviceManager, () => new MockDeviceManager())
..putIfAbsent(DevFSConfig, () => new DevFSConfig()) ..putIfAbsent(DevFSConfig, () => new DevFSConfig())
..putIfAbsent(Doctor, () => new MockDoctor()) ..putIfAbsent(Doctor, () => new MockDoctor())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment