mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Revert "Don't try to connect to "ws://"+location.host+"/" in WebSocket tests."
This reverts commit 61a9f9d7d4
.
This commit is contained in:
parent
2212cacef2
commit
d9995d9541
4 changed files with 11 additions and 26 deletions
|
@ -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(SCHEME_DOMAIN_PORT+"/#")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket(SCHEME_DOMAIN_PORT+"/#test")})});
|
||||
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("?test")})});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("#test")})});
|
||||
</script>
|
||||
|
|
|
@ -6,28 +6,18 @@
|
|||
<div id=log></div>
|
||||
<script>
|
||||
// empty string
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function() {
|
||||
new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message', "")
|
||||
})
|
||||
});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", "")})});
|
||||
|
||||
// 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(SCHEME_DOMAIN_PORT + '/empty-message',
|
||||
"a"+String.fromCharCode(i)+"b")
|
||||
}, 'char code '+i);
|
||||
})
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", "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(SCHEME_DOMAIN_PORT + '/empty-message',
|
||||
"a"+String.fromCharCode(i)+"b")
|
||||
}, 'char code '+i);
|
||||
})
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", "a"+String.fromCharCode(i)+"b")}, 'char code '+i);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_true(new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message') instanceof WebSocket);
|
||||
assert_true(new WebSocket("ws://"+location.host+"/") instanceof WebSocket);
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -5,10 +5,5 @@
|
|||
<script src=../constants.js?pipe=sub></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function() {
|
||||
new WebSocket(SCHEME_DOMAIN_PORT + '/empty-message',
|
||||
'a' + String.fromCharCode(0) + 'b')
|
||||
})
|
||||
});
|
||||
test(function() {assert_throws("SyntaxError", function(){new WebSocket("ws://"+location.host+"/", 'a'+String.fromCharCode(0)+'b')})});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue