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

Unified Diff: sdk/lib/_internal/pub/test/serve/supports_cross_origin_header_test.dart

Issue 786223006: Support cross-origin requests to pub serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
Index: sdk/lib/_internal/pub/test/serve/supports_cross_origin_header_test.dart
diff --git a/sdk/lib/_internal/pub/test/serve/does_not_serve_hidden_assets_test.dart b/sdk/lib/_internal/pub/test/serve/supports_cross_origin_header_test.dart
similarity index 60%
copy from sdk/lib/_internal/pub/test/serve/does_not_serve_hidden_assets_test.dart
copy to sdk/lib/_internal/pub/test/serve/supports_cross_origin_header_test.dart
index 0429e7efd7ed91cba68a15506c1ef832e72c97ad..66b7dda301164b0b497954e3c3734ed69cffdd64 100644
--- a/sdk/lib/_internal/pub/test/serve/does_not_serve_hidden_assets_test.dart
+++ b/sdk/lib/_internal/pub/test/serve/supports_cross_origin_header_test.dart
@@ -4,26 +4,23 @@
library pub_tests;
+import 'package:scheduled_test/scheduled_test.dart';
+
import '../descriptor.dart' as d;
import '../test_pub.dart';
import 'utils.dart';
main() {
initConfig();
- integration("doesn't serve hidden assets", () {
+ integration("sends responses that allow cross-origin requests", () {
d.dir(appPath, [
d.appPubspec(),
- d.dir("web", [
- d.file(".outer.txt", "outer contents"),
- d.dir(".dir", [
- d.file("inner.txt", "inner contents"),
- ])
- ])
+ d.dir("web", [d.file("index.html", "<body>")])
]).create();
pubServe();
- requestShould404(".outer.txt");
- requestShould404(".dir/inner.txt");
+ requestShouldSucceed("index.html", "<body>",
+ headers: containsPair("access-control-allow-origin", "*"));
endPubServe();
});
}

Powered by Google App Engine
This is Rietveld 408576698