mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 14:13:09 +00:00
308c8059f3
TESTS = existing tests are being fixed here Change-Id: I9136017d29c11f73dd97c82364dc5ead8e2ae7d8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169407 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Siva Annamalai <asiva@google.com>
31 lines
1,019 B
Dart
31 lines
1,019 B
Dart
// Copyright (c) 2020, 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.
|
|
|
|
import "dart:io";
|
|
import "nnbd_spawnuri_autodetect_helper.dart";
|
|
|
|
void main() {
|
|
// Create temporary directory.
|
|
var tmpDir = Directory.systemTemp.createTempSync();
|
|
var tmpDirPath = tmpDir.path;
|
|
String sourcePath = "$tmpDirPath/weak_isolate.dart";
|
|
|
|
// Generate code for an isolate to run in strong mode.
|
|
generateIsolateSource(sourcePath, "2.6");
|
|
|
|
try {
|
|
String sourceUri = Uri.file(sourcePath).toString();
|
|
|
|
// Strong Isolate Spawning another weak Isolate using spawnUri.
|
|
testNullSafetyMode(
|
|
"$tmpDirPath/strong_weak.dart", "", sourceUri, 're: weak');
|
|
|
|
// Weak Isolate Spawning another Weak Isolate using spawnUri.
|
|
testNullSafetyMode(
|
|
"$tmpDirPath/weak_weak.dart", "2.6", sourceUri, 're: weak');
|
|
} finally {
|
|
tmpDir.deleteSync(recursive: true);
|
|
}
|
|
}
|