Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart

Issue 2976553002: Fix hot reload test (Closed)
Patch Set: pause on startup Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/tool/vm/reload.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart
diff --git a/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart b/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart
index 45cd55bee410a50af4225ab41a0549ac40b39254..0740dfc52150f164f9b4d3abb985b2d0e3f9e799 100644
--- a/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart
+++ b/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart
@@ -48,12 +48,27 @@ main() {
lines = null;
});
+ Future<int> computeVmPort() async {
+ var portLine = await lines[0];
+ expect(observatoryPortRegExp.hasMatch(portLine), isTrue);
+ var match = observatoryPortRegExp.firstMatch(portLine);
+ return int.parse(match.group(1));
+ }
+
+ /// Request vm to resume execution
+ Future resume() async {
+ var port = await computeVmPort();
+ var remoteVm = new RemoteVm(port);
+ await remoteVm.resume();
+ }
+
/// Start the VM with the first version of the program compiled by the
/// incremental compiler.
startProgram(int reloadCount) async {
var vmArgs = [
'--enable-vm-service=0', // Note: use 0 to avoid port collisions.
- '--platform=${platformFile.toFilePath()}',
+ '--pause_isolates_on_start',
+ '--kernel-binaries=${sdkRoot.toFilePath()}',
outputUri.toFilePath()
];
vmArgs.add('$reloadCount');
@@ -81,24 +96,22 @@ main() {
});
programIsDone = vm.exitCode;
+ await resume();
}
/// Request a hot reload on the running program.
Future hotReload() async {
- var portLine = await lines[0];
- expect(observatoryPortRegExp.hasMatch(portLine), isTrue);
- var match = observatoryPortRegExp.firstMatch(portLine);
- var port = int.parse(match.group(1));
- var reloader = new VmReloader(port);
- var reloadResult = await reloader.reload(outputUri);
+ var port = await computeVmPort();
+ var remoteVm = new RemoteVm(port);
+ var reloadResult = await remoteVm.reload(outputUri);
expect(reloadResult['success'], isTrue);
- await reloader.disconnect();
+ await remoteVm.disconnect();
}
test('initial program is valid', () async {
await startProgram(0);
await programIsDone;
- expect(await lines.skip(1).first, "part1 part2");
+ expect(await lines[1], "part1 part2");
});
test('reload after leaf library modification', () async {
@@ -156,7 +169,6 @@ main() {
var dartVm = Uri.base.resolve(Platform.resolvedExecutable);
var sdkRoot = dartVm.resolve("patched_sdk/");
-var platformFile = sdkRoot.resolve('platform.dill');
Future<IncrementalKernelGenerator> createIncrementalCompiler(
String entry, FileSystem fs) {
« no previous file with comments | « no previous file | pkg/front_end/tool/vm/reload.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698