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:
parent
c713ef971e
commit
fda193aa5d
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user