Bug 1141059: ignore attempts to share e10s tabs in a Hello conversation. r=Standard8

This commit is contained in:
Mike de Boer 2015-03-10 10:43:44 +01:00
Родитель a4a7ab1193
Коммит 8602728725
3 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -292,6 +292,15 @@ function injectLoopAPI(targetWindow) {
listener(cloneValueInto(err, targetWindow));
return;
}
if (browser.getAttribute("remote") == "true") {
// Tab sharing is not supported yet for e10s-enabled browsers. This will
// be fixed in bug 1137634.
let err = new Error("Tab sharing is not supported for e10s-enabled browsers");
MozLoopService.log.error(err);
listener(cloneValueInto(err, targetWindow));
return;
}
win.LoopUI.addBrowserSharingListener(listener);
savedWindowListeners.set(listener, Cu.getWeakReference(win));

Просмотреть файл

@ -421,6 +421,9 @@ loop.store.ActiveRoomStore = (function() {
_handleSwitchBrowserShare: function(err, windowId) {
if (err) {
console.error("Error getting the windowId: " + err);
this.dispatchAction(new sharedActions.ScreenSharingState({
state: SCREEN_SHARE_STATES.INACTIVE
}));
return;
}

Просмотреть файл

@ -831,6 +831,18 @@ describe("loop.store.ActiveRoomStore", function () {
sinon.assert.calledOnce(fakeSdkDriver.switchAcquiredWindow);
sinon.assert.calledWithExactly(fakeSdkDriver.switchAcquiredWindow, 72);
});
it("should end the screen sharing session when the listener receives an error", function() {
listener(new Error("foo"));
// The dispatcher was already called once in beforeEach().
sinon.assert.calledTwice(dispatcher.dispatch);
sinon.assert.calledWith(dispatcher.dispatch,
new sharedActions.ScreenSharingState({
state: SCREEN_SHARE_STATES.INACTIVE
}));
sinon.assert.notCalled(fakeSdkDriver.switchAcquiredWindow);
});
});
describe("#endScreenShare", function() {