blob: 0de6d92c41c9bcb723ab1e253598105be1a838e0 [file] [log] [blame]
James Graham2120f702012-10-27 09:13:401<!DOCTYPE html>
2<html>
3 <head>
4 <title>EventSource: bogus MIME type</title>
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <div id="log"></div>
10 <script>
11 var test = async_test()
12 test.step(function() {
13 var source = new EventSource("resources/message.php?mime=x%20bogus")
14 source.onmessage = function() {
15 test.step(function() {
16 assert_unreached()
17 source.close()
18 })
19 test.done()
20 }
21 source.onerror = function(e) {
22 test.step(function() {
23 assert_equals(this.readyState, this.CLOSED)
24 assert_not_exists(e, "data")
25 assert_false(e.bubbles)
26 assert_false(e.cancelable)
27 this.close()
28 }, this)
29 test.done()
30 }
31 })
32 </script>
33 <!-- This tests "fails the connection" as well as making sure a simple
34 event is dispatched and not a MessageEvent -->
35 </body>
36</html>
37