mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Don't try to connect to "ws://"+location.host+"/" in WebSocket tests.
This will connect on port 80, which is not typically under the control of the wpt server.
This commit is contained in:
parent
6b886e545d
commit
e8d691aa03
7 changed files with 512 additions and 16 deletions
|
@ -1,3 +1,485 @@
|
|||
[004.html]
|
||||
type: testharness
|
||||
expected: CRASH
|
||||
[WebSockets: new WebSocket(url, invalid protocol)]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 1]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 2]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 3]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 4]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 5]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 6]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 7]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 8]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 9]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 10]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 11]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 12]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 13]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 14]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 15]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 16]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 17]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 18]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 19]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 20]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 21]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 22]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 23]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 24]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 25]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 26]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 27]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 28]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 29]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 30]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 31]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 32]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 33]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 34]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 35]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 36]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 37]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 38]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 39]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 40]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 41]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 42]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 43]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 44]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 45]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 46]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 47]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 48]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 49]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 50]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 51]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 52]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 53]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 54]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 55]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 56]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 57]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 58]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 59]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 60]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 61]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 62]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 63]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 64]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 65]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 66]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 67]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 68]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 69]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 70]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 71]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 72]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 73]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 74]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 75]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 76]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 77]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 78]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 79]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 80]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 81]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 82]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 83]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 84]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 85]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 86]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 87]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 88]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 89]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 90]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 91]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 92]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 93]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 94]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 95]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 96]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 97]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 98]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 99]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 100]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 101]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 102]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 103]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 104]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 105]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 106]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 107]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 108]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 109]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 110]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 111]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 112]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 113]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 114]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 115]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 116]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 117]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 118]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 119]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 120]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 121]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 122]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 123]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 124]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 125]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 126]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 127]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 128]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 129]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 130]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 131]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 132]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 133]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 134]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 135]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 136]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 137]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 138]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 139]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 140]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 141]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 142]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 143]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 144]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 145]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 146]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 147]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 148]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 149]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 150]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 151]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 152]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 153]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 154]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 155]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 156]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 157]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 158]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 159]
|
||||
expected: FAIL
|
||||
|
||||
[WebSockets: new WebSocket(url, invalid protocol) 160]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[005.html]
|
||||
type: testharness
|
||||
expected: CRASH
|
|
@ -1,3 +1,5 @@
|
|||
[007.html]
|
||||
type: testharness
|
||||
expected: CRASH
|
||||
[WebSockets: new WebSocket(url, null char)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ test(function() {assert_throws("SyntaxError", function(){new WebSocket("wss://fo
|
|||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("http://"+location.host+"/")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("mailto:example@example.org")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("about:blank")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/#")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/#test")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket(SCHEME_DOMAIN_PORT+"/#")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket(SCHEME_DOMAIN_PORT+"/#test")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("?test")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("#test")})});
|
||||
</script>
|
||||
|
|
|
@ -6,18 +6,28 @@
|
|||
<div id=log></div>
|
||||
<script>
|
||||
// empty string
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", "")})});
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function() {
|
||||
new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message', "")
|
||||
})
|
||||
});
|
||||
|
||||
// chars below U+0020 except U+0000; U+0000 is tested in a separate test
|
||||
for (var i = 1; i < 0x20; ++i) {
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", "a"+String.fromCharCode(i)+"b")}, 'char code '+i);
|
||||
})
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function() {
|
||||
new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message',
|
||||
"a"+String.fromCharCode(i)+"b")
|
||||
}, 'char code '+i);
|
||||
})
|
||||
}
|
||||
// some chars above U+007E
|
||||
for (var i = 0x7F; i < 0x100; ++i) {
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", "a"+String.fromCharCode(i)+"b")}, 'char code '+i);
|
||||
})
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function() {
|
||||
new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message',
|
||||
"a"+String.fromCharCode(i)+"b")
|
||||
}, 'char code '+i);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(new WebSocket("ws://"+location.host+"/") instanceof WebSocket);
|
||||
assert_true(new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message') instanceof WebSocket);
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -5,5 +5,10 @@
|
|||
<script src=../constants.js?pipe=sub></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", 'a'+String.fromCharCode(0)+'b')})});
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function() {
|
||||
new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message',
|
||||
'a' + String.fromCharCode(0) + 'b')
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue