Fix+unskip flutter test expression eval tests (#26579)

* Fix `flutter test`e xpression eval tests

We weren't passing `beforeStart` through so the breakpoints were never being set, which means the evaluations were happening while the code was running.

* Ensure we wait for breakpoints before trying to evaluate
This commit is contained in:
Danny Tuppeny 2019-01-15 15:39:35 +00:00 committed by GitHub
parent c713ef971e
commit fda193aa5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -102,6 +102,7 @@ void main() {
withDebugger: true,
beforeStart: () => _flutter.addBreakpoint(_project.breakpointUri, _project.breakpointLine),
);
await _flutter.waitForPause();
await evaluateTrivialExpressions(_flutter);
});
@ -110,6 +111,7 @@ void main() {
withDebugger: true,
beforeStart: () => _flutter.addBreakpoint(_project.breakpointUri, _project.breakpointLine),
);
await _flutter.waitForPause();
await evaluateComplexExpressions(_flutter);
});
@ -118,10 +120,11 @@ void main() {
withDebugger: true,
beforeStart: () => _flutter.addBreakpoint(_project.breakpointUri, _project.breakpointLine),
);
await _flutter.waitForPause();
await evaluateComplexReturningExpressions(_flutter);
});
// Skipped due to https://github.com/flutter/flutter/issues/26518
}, timeout: const Timeout.factor(6), skip: true);
}, timeout: const Timeout.factor(6));
}
Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async {

View File

@ -51,5 +51,5 @@ class TestsProject extends Project {
Uri get breakpointUri => Uri.file(testFilePath);
@override
int get breakpointLine => lineContaining(main, '// BREAKPOINT');
int get breakpointLine => lineContaining(testContent, '// BREAKPOINT');
}

View File

@ -521,7 +521,7 @@ class FlutterTestTestDriver extends FlutterTestDriver {
'--machine',
'-d',
'flutter-tester'
], script: testFile, withDebugger: withDebugger, pauseOnExceptions: pauseOnExceptions, pidFile: pidFile);
], script: testFile, withDebugger: withDebugger, pauseOnExceptions: pauseOnExceptions, pidFile: pidFile, beforeStart: beforeStart);
}
@override