зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1440022: Some infrastructure for testing broadcast_subscribe r=lina
MozReview-Commit-ID: 8Re4EGCSbmi --HG-- extra : rebase_source : 8f851ce140f6e61816d002490de3b0af2fb5fe3d
This commit is contained in:
Родитель
0910ae2529
Коммит
8e229ea686
|
@ -187,6 +187,7 @@ function MockWebSocket(originalURI, handlers = {}) {
|
|||
this._onUnregister = handlers.onUnregister;
|
||||
this._onACK = handlers.onACK;
|
||||
this._onPing = handlers.onPing;
|
||||
this._onBroadcastSubscribe = handlers.onBroadcastSubscribe;
|
||||
}
|
||||
|
||||
MockWebSocket.prototype = {
|
||||
|
@ -259,6 +260,13 @@ MockWebSocket.prototype = {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'broadcast_subscribe':
|
||||
if (typeof this._onBroadcastSubscribe != 'function') {
|
||||
throw new Error('Unexpected broadcast_subscribe');
|
||||
}
|
||||
this._onBroadcastSubscribe(request);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unexpected message: ' + messageType);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче