Auto merge of #6436 - Ms2ger:ws-test, r=nox

Don't try to connect to a non-existent WebSocket server on location.host:80.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6436)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-06-21 06:17:42 -06:00
commit d2d51d4776

View file

@ -5,9 +5,14 @@
<script src=../constants.js?pipe=sub></script>
<div id=log></div>
<script>
var tests = ['ws:', 'ws:/', 'wss:', 'wss:/'];
var tests = [
['ws:', PORT],
['ws:/', PORT],
['wss:', PORT_SSL],
['wss:/', PORT_SSL]
];
//Pass condition is to not throw
for (var i = 0; i < tests.length; ++i) {
test(function(){new WebSocket(tests[i]+location.host+'/echo')}, tests[i]);
test(function(){new WebSocket(tests[i][0] + location.host + ':' + tests[i][1] + '/echo')}, tests[i][0]);
}
</script>