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

Unified Diff: tests/isolate/scenarios/package_data_uri_spec/package_resolve_test.dart

Issue 1585103006: - Add support for passing data: based URIs as packageConfig to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « runtime/tests/vm/vm.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/scenarios/package_data_uri_spec/package_resolve_test.dart
diff --git a/tests/isolate/scenarios/automatic_resolution_spec/package_resolve_test.dart b/tests/isolate/scenarios/package_data_uri_spec/package_resolve_test.dart
similarity index 86%
copy from tests/isolate/scenarios/automatic_resolution_spec/package_resolve_test.dart
copy to tests/isolate/scenarios/package_data_uri_spec/package_resolve_test.dart
index 67b4d1e3f000ac1029029a446a437f9a5b553dad..8884d4eb30f6fd8b87264223848933afeb047af4 100644
--- a/tests/isolate/scenarios/automatic_resolution_spec/package_resolve_test.dart
+++ b/tests/isolate/scenarios/package_data_uri_spec/package_resolve_test.dart
@@ -8,26 +8,32 @@ import 'dart:isolate';
final PACKAGE_URI = "package:foo/bar.dart";
final PACKAGE_PATH = "file:///no/such/directory/bar.dart";
+final PACKAGE_SPEC = """
+# This is the content of a .packages file.
+foo:file:///no/such/directory/
+""";
+
+
main([args, port]) async {
if (port != null) {
testPackageResolution(port);
return;
}
+ var data = new Uri.dataFromString(PACKAGE_SPEC);
var p = new RawReceivePort();
Isolate.spawnUri(Platform.script,
[],
p.sendPort,
- automaticPackageResolution: true);
+ packageConfig: data);
p.handler = (msg) {
p.close();
if (msg is! List) {
print(msg.runtimeType);
throw "Failure return from spawned isolate:\n\n$msg";
}
- var child_pkg_config = Platform.script.resolve(".packages");
- if (msg[0] != child_pkg_config.toString()) {
+ if (msg[0] != data.toString()) {
throw "Bad package config in child isolate: ${msg[0]}\n"
- "Expected: $child_pkg_config";
+ "Expected: $data";
}
if (msg[1] != PACKAGE_PATH) {
throw "Package path not matching: ${msg[1]}";
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698