5737: Merge branch 'master' into 5737-ruby231
[arvados.git] / apps / workbench / test / support / fake_websocket.js
1 sockets = [];
2 window.WebSocket = function(url) {
3     sockets.push(this);
4     window.setTimeout(function() {
5         sockets.map(function(s) {
6             s.onopen();
7         });
8         sockets.splice(0);
9     }, 1);
10 }
11
12 window.WebSocket.prototype.send = function(msg) {
13     // Uncomment for debugging:
14     // console.log("fake WebSocket: send: "+msg);
15 }