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

Unified Diff: tests/compiler/dart2js/source_map_pub_build_validity_test.dart

Issue 2824083002: Fix 29264: remove access to the network on source-map unit test (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/source_map_pub_build_validity_test.dart
diff --git a/tests/compiler/dart2js/source_map_pub_build_validity_test.dart b/tests/compiler/dart2js/source_map_pub_build_validity_test.dart
index 5eaff5b7256f96d7506c58cf949799ecafee32d2..9879f183299befde6b641bfed0928741c9814c58 100644
--- a/tests/compiler/dart2js/source_map_pub_build_validity_test.dart
+++ b/tests/compiler/dart2js/source_map_pub_build_validity_test.dart
@@ -23,9 +23,16 @@ void main() {
path.fromUri(Platform.script), '../../../../sdk/bin/pub${ext}'));
String file = path.join(tmpDir.path, 'build/web/sunflower.dart.js');
- print("Running '$command get' from '${tmpDir}'.");
- ProcessResult getResult =
- await Process.run(command, ['get'], workingDirectory: tmpDir.path);
+ // sunflower/pubspec.yaml only depends on package:browser for Dartium, we
+ // override the file to remove this dependency and make pub-get --offline
+ // trivially succeed.
+ print("Overriding '${tmpDir.path}/pubspec.yaml'.");
+ new File(path.join(tmpDir.path, "pubspec.yaml"))
+ .writeAsStringSync(_newPubspec);
+
+ print("Running '$command get --offline' from '${tmpDir}'.");
+ ProcessResult getResult = await Process.run(command, ['get', '--offline'],
+ workingDirectory: tmpDir.path);
print(getResult.stdout);
print(getResult.stderr);
Expect.equals(0, getResult.exitCode, 'Unexpected exitCode from pub get');
@@ -44,3 +51,9 @@ void main() {
}
});
}
+
+String _newPubspec = '''
+# Generated by test
+name: sunflower
+version: 0.0.0
+''';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698