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

Unified Diff: LayoutTests/http/tests/eventsource/script-tests/eventsource-bad-mime-type.js

Issue 347043002: Rework EventSource tests for better Worker test coverage. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move out CORS tests Created 6 years, 6 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
Index: LayoutTests/http/tests/eventsource/script-tests/eventsource-bad-mime-type.js
diff --git a/LayoutTests/http/tests/eventsource/script-tests/eventsource-bad-mime-type.js b/LayoutTests/http/tests/eventsource/script-tests/eventsource-bad-mime-type.js
new file mode 100644
index 0000000000000000000000000000000000000000..8ea0ab85974edf24ec8354d83aeb9a7e4b8b3e41
--- /dev/null
+++ b/LayoutTests/http/tests/eventsource/script-tests/eventsource-bad-mime-type.js
@@ -0,0 +1,27 @@
+if (self.importScripts)
+ importScripts("/js-test-resources/js-test.js");
+
+description("Test EventSource with an event-stream with incorrect mime-type.");
+
+self.jsTestIsAsync = true;
+
+function end() {
+ es.close();
+ finishJSTest();
+}
+
+var es = new EventSource("resources/bad-mime-type.asis");
+es.onopen = function (evt) {
+ testFailed("got unexpected open event");
+ end();
+};
+
+es.onmessage = function (evt) {
+ testFailed("got unexpected message event");
+ end();
+};
+
+es.onerror = function () {
+ shouldBe("es.readyState", "es.CLOSED");
+ end();
+};

Powered by Google App Engine
This is Rietveld 408576698