X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Fwebsock.js;h=c42955363e844698c844510c35e3c3c630011f5f;hb=7f4444176bd6efaa5e189a148351bab5a72c2853;hp=8446558810b9d1122a926de0d98779bced14802c;hpb=6ea1d50ab6571551e1d0379940349911956c97ee;p=src%2Fapp-framework-binder.git diff --git a/test/websock.js b/test/websock.js index 84465588..c4295536 100644 --- a/test/websock.js +++ b/test/websock.js @@ -27,12 +27,18 @@ AfbWsItf = (function(){ var RETERR = 4; function AfbWsItf(base, onopen, onabort, ctx) { + ctx = ctx || new AfbCtxItf(); var wl = window.location; var u = "ws://"+wl.host+"/"+base; + if (ctx.token) { + u = u + '?x-afb-token=' + ctx.token; + if (ctx.uuid) + u = u + '&x-afb-uuid=' + ctx.uuid; + } this.ws = new (WebSocket || MozWebSocket)(u, [ "x-afb-ws-json1" ]); this.pendings = {}; this.counter = 0; - this.ctx = ctx || new AfbCtxItf(); + this.ctx = ctx; this.ws.onopen = onopen.bind(this); this.ws.onerror = onerror.bind(this); this.ws.onclose = onclose.bind(this);