Unverified Commit fda193aa authored by Danny Tuppeny's avatar Danny Tuppeny Committed by GitHub

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
parent c713ef97
......@@ -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 {
......
......@@ -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');
}
......@@ -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
......
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