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

Unified Diff: tests/isolate/package_map_test.dart

Issue 1409343007: - Rollback packageConfig/File/Spec updates for 1.13. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « sdk/lib/isolate/isolate.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/package_map_test.dart
diff --git a/tests/isolate/package_map_test.dart b/tests/isolate/package_map_test.dart
deleted file mode 100644
index 3e34dc0011f96491032d55e758d895542e75cfdd..0000000000000000000000000000000000000000
--- a/tests/isolate/package_map_test.dart
+++ /dev/null
@@ -1,67 +0,0 @@
-// 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.
-
-import 'dart:io';
-import 'dart:isolate';
-
-final NOT_HERE = "notHere";
-final NOT_HERE_URI = "file:///no/such/file/";
-
-class Foo {}
-
-void main([args, port]) {
- if (port != null) {
- testPackageRoot(port);
- return;
- }
- var p = new RawReceivePort();
- p.handler = (msg) {
- p.close();
- // Cannot use the expect package here because the spawned isolate
- // would not be able to handle it.
- if (msg is! List) {
- throw "Bad response from child isolate: $msg";
- }
- if (msg.length != 2) {
- throw "Length should be 2: ${msg.length}\nmsg: $msg";
- }
- if (msg[0] != NOT_HERE) {
- throw "Key should be $NOT_HERE: ${msg[0]}";
- }
- if (msg[1] != NOT_HERE_URI) {
- throw "Value should be $NOT_HERE_URI: ${msg[1]}";
- }
- };
- Isolate.spawnUri(Platform.script,
- [],
- p.sendPort,
- packageMap: {
- NOT_HERE: Uri.parse(NOT_HERE_URI)
- });
-}
-
-testPackageRoot(port) async {
- var packageMap = await Isolate.packageMap;
- var packageMapEntries = [];
- if (packageMap is! Map) {
- port.send("packageMap is not a Map: ${packageMap.runtimeType}");
- return;
- }
- var ok = true;
- packageMap.forEach((k, v) {
- if (ok && (k is! String)) {
- port.send("Key $k is not a String: ${k.runtimeType}");
- ok = false;
- }
- packageMapEntries.add(k);
- if (ok && (v is! Uri)) {
- port.send("Value $v is not a Uri: ${v.runtimeType}");
- ok = false;
- }
- packageMapEntries.add(v.toString());
- });
- if (ok) {
- port.send(packageMapEntries);
- }
-}
« no previous file with comments | « sdk/lib/isolate/isolate.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698