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 |
+'''; |