2020-03-19 20:07:58 +00:00
|
|
|
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// VMOptions=--trace_shutdown
|
2021-11-04 18:57:21 +00:00
|
|
|
|
2020-03-19 20:07:58 +00:00
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:isolate';
|
|
|
|
|
2020-05-04 14:51:14 +00:00
|
|
|
const String packageConfig = "foobar:///no/such/file/";
|
|
|
|
const String errorString = "IsolateSpawnException: Unable to spawn isolate:";
|
|
|
|
const String errorString2 = "Error when reading '$packageConfig'";
|
2020-03-19 20:07:58 +00:00
|
|
|
|
2020-05-04 14:51:14 +00:00
|
|
|
main([args, msg]) async {
|
|
|
|
if (msg != null) {
|
|
|
|
throw 'unreachable';
|
|
|
|
}
|
|
|
|
dynamic error;
|
|
|
|
try {
|
|
|
|
await Isolate.spawnUri(Platform.script, [], 'msg',
|
|
|
|
packageConfig: Uri.parse('foobar:///no/such/file/'));
|
|
|
|
} catch (e) {
|
|
|
|
error = e;
|
|
|
|
}
|
|
|
|
if (error == null) throw 'Expected a Spawning error.';
|
|
|
|
if (!'$error'.contains(errorString)) {
|
2020-08-14 14:02:39 +00:00
|
|
|
throw 'Expected: $error to contain "$errorString"';
|
2020-05-04 14:51:14 +00:00
|
|
|
}
|
|
|
|
if (!'$error'.contains(errorString2)) {
|
2020-08-14 14:02:39 +00:00
|
|
|
throw 'Expected: $error to contain "$errorString2"';
|
2020-03-19 20:07:58 +00:00
|
|
|
}
|
|
|
|
}
|