Revert "Clean up test infrastructure (#41880)" (#42982)

This reverts commit 1781d5c9bb.
This commit is contained in:
Jonah Williams
2019-10-17 19:47:16 -07:00
committed by GitHub
parent be7937965c
commit 1982a5c3ec
27 changed files with 1777 additions and 1722 deletions

View File

@@ -127,6 +127,13 @@ Future<String> createProject(Directory temp, { List<String> arguments }) async {
return projectPath;
}
/// Test case timeout for tests involving remote calls to `pub get` or similar.
const Timeout allowForRemotePubInvocation = Timeout.factor(10.0);
/// Test case timeout for tests involving creating a Flutter project with
/// `--no-pub`. Use [allowForRemotePubInvocation] when creation involves `pub`.
const Timeout allowForCreateFlutterProject = Timeout.factor(3.0);
Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher) async {
try {
await future;

View File

@@ -48,6 +48,7 @@ typedef ContextInitializer = void Function(AppContext testContext);
void testUsingContext(
String description,
dynamic testMethod(), {
Timeout timeout,
Map<Type, Generator> overrides = const <Type, Generator>{},
bool initializeFlutterRoot = true,
String testOn,
@@ -136,7 +137,8 @@ void testUsingContext(
},
);
});
}, testOn: testOn, skip: skip);
}, timeout: timeout ?? const Timeout(Duration(seconds: 60)),
testOn: testOn, skip: skip);
}
void _printBufferedErrors(AppContext testContext) {