diff --git a/dom/push/test/xpcshell/head.js b/dom/push/test/xpcshell/head.js index 71070ca2d46f..96c856f7ea7e 100644 --- a/dom/push/test/xpcshell/head.js +++ b/dom/push/test/xpcshell/head.js @@ -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); }