diff --git a/browser/extensions/loop/content/panels/js/roomViews.js b/browser/extensions/loop/content/panels/js/roomViews.js index 00c8a7dd316..6ca0ff34eeb 100644 --- a/browser/extensions/loop/content/panels/js/roomViews.js +++ b/browser/extensions/loop/content/panels/js/roomViews.js @@ -7,7 +7,6 @@ loop.roomViews = (function(mozL10n) { "use strict"; var ROOM_STATES = loop.store.ROOM_STATES; - var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; var FAILURE_DETAILS = loop.shared.utils.FAILURE_DETAILS; var sharedActions = loop.shared.actions; var sharedMixins = loop.shared.mixins; @@ -773,11 +772,6 @@ loop.roomViews = (function(mozL10n) { this.setTitle(roomTitle); } - var screenShareData = { - state: this.state.screenSharingState || SCREEN_SHARE_STATES.INACTIVE, - visible: true - }; - var shouldRenderInvitationOverlay = this._shouldRenderInvitationOverlay(); var shouldRenderEditContextView = this.state.showEditContext; var roomData = this.props.roomStore.getStoreState("activeRoom"); @@ -833,7 +827,6 @@ loop.roomViews = (function(mozL10n) { dispatcher: this.props.dispatcher, hangup: this.leaveRoom, publishStream: this.publishStream, - screenShare: screenShareData, settingsMenuItems: settingsMenuItems, show: !shouldRenderEditContextView, showHangup: this.props.chatWindowDetached, diff --git a/browser/extensions/loop/content/panels/js/roomViews.jsx b/browser/extensions/loop/content/panels/js/roomViews.jsx index a1e21613dcb..dc35bc70a18 100644 --- a/browser/extensions/loop/content/panels/js/roomViews.jsx +++ b/browser/extensions/loop/content/panels/js/roomViews.jsx @@ -7,7 +7,6 @@ loop.roomViews = (function(mozL10n) { "use strict"; var ROOM_STATES = loop.store.ROOM_STATES; - var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; var FAILURE_DETAILS = loop.shared.utils.FAILURE_DETAILS; var sharedActions = loop.shared.actions; var sharedMixins = loop.shared.mixins; @@ -773,11 +772,6 @@ loop.roomViews = (function(mozL10n) { this.setTitle(roomTitle); } - var screenShareData = { - state: this.state.screenSharingState || SCREEN_SHARE_STATES.INACTIVE, - visible: true - }; - var shouldRenderInvitationOverlay = this._shouldRenderInvitationOverlay(); var shouldRenderEditContextView = this.state.showEditContext; var roomData = this.props.roomStore.getStoreState("activeRoom"); @@ -833,7 +827,6 @@ loop.roomViews = (function(mozL10n) { dispatcher={this.props.dispatcher} hangup={this.leaveRoom} publishStream={this.publishStream} - screenShare={screenShareData} settingsMenuItems={settingsMenuItems} show={!shouldRenderEditContextView} showHangup={this.props.chatWindowDetached} diff --git a/browser/extensions/loop/content/shared/css/conversation.css b/browser/extensions/loop/content/shared/css/conversation.css index aacca74062f..97d8eee4f3a 100644 --- a/browser/extensions/loop/content/shared/css/conversation.css +++ b/browser/extensions/loop/content/shared/css/conversation.css @@ -160,24 +160,6 @@ html[dir="rtl"] .conversation-toolbar-btn-box.btn-edit-entry { background-image: url("../img/settings-hover.svg"); } -.btn-screen-share { - background-image: url("../img/sharing.svg"); -} - -.btn-screen-share:hover, -.btn-screen-share:active { - background-image: url("../img/sharing-hover.svg"); -} - -.btn-screen-share.active { - background-image: url("../img/sharing-active.svg"); -} - -.btn-screen-share.disabled { - /* The screen share button is in its pending state when its disabled. */ - background-image: url("../img/sharing-pending.svg"); -} - /* General Call (incoming or outgoing). */ .call-action-group { @@ -319,7 +301,6 @@ html[dir="rtl"] .room-failure > .settings-control { color: #f00; } -.screen-share-menu.dropdown-menu, .settings-menu.dropdown-menu { bottom: 3.1rem; } @@ -330,16 +311,10 @@ html[dir="rtl"] .room-failure > .settings-control { right: 14px; } -html[dir="rtl"] .screen-share-menu.dropdown-menu, html[dir="rtl"] .settings-menu.dropdown-menu { right: auto; } -html[dir="rtl"] .screen-share-menu.dropdown-menu { - /*offset dropdown menu to be above menu button*/ - left: 40px; -} - html[dir="rtl"] .settings-menu.dropdown-menu { /*offset dropdown menu to be above menu button*/ left: 14px; diff --git a/browser/extensions/loop/content/shared/img/sharing-active.svg b/browser/extensions/loop/content/shared/img/sharing-active.svg index 3bc01b3dd32..e69de29bb2d 100644 --- a/browser/extensions/loop/content/shared/img/sharing-active.svg +++ b/browser/extensions/loop/content/shared/img/sharing-active.svg @@ -1 +0,0 @@ - diff --git a/browser/extensions/loop/content/shared/img/sharing-hover.svg b/browser/extensions/loop/content/shared/img/sharing-hover.svg index db49fa22361..e69de29bb2d 100644 --- a/browser/extensions/loop/content/shared/img/sharing-hover.svg +++ b/browser/extensions/loop/content/shared/img/sharing-hover.svg @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/browser/extensions/loop/content/shared/img/sharing-pending.svg b/browser/extensions/loop/content/shared/img/sharing-pending.svg index 1d0efe11d3c..e69de29bb2d 100644 --- a/browser/extensions/loop/content/shared/img/sharing-pending.svg +++ b/browser/extensions/loop/content/shared/img/sharing-pending.svg @@ -1 +0,0 @@ - diff --git a/browser/extensions/loop/content/shared/img/sharing.svg b/browser/extensions/loop/content/shared/img/sharing.svg index e7804c226b0..e69de29bb2d 100644 --- a/browser/extensions/loop/content/shared/img/sharing.svg +++ b/browser/extensions/loop/content/shared/img/sharing.svg @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/browser/extensions/loop/content/shared/js/actions.js b/browser/extensions/loop/content/shared/js/actions.js index fe8fd81ad48..5e051cb5768 100644 --- a/browser/extensions/loop/content/shared/js/actions.js +++ b/browser/extensions/loop/content/shared/js/actions.js @@ -204,14 +204,6 @@ loop.shared.actions = (function() { enabled: Boolean }), - /** - * Used to start a screen share. - */ - StartScreenShare: Action.define("startScreenShare", { - // The part of the screen to share, e.g. "window" or "browser". - type: String - }), - /** * Used to start a browser tab share. */ diff --git a/browser/extensions/loop/content/shared/js/activeRoomStore.js b/browser/extensions/loop/content/shared/js/activeRoomStore.js index 016a28291a7..84b9f34bea0 100644 --- a/browser/extensions/loop/content/shared/js/activeRoomStore.js +++ b/browser/extensions/loop/content/shared/js/activeRoomStore.js @@ -257,7 +257,6 @@ loop.store.ActiveRoomStore = (function() { "mediaStreamDestroyed", "remoteVideoStatus", "videoDimensionsChanged", - "startScreenShare", "startBrowserShare", "endScreenShare", "updateSocialShareInfo", @@ -921,11 +920,11 @@ loop.store.ActiveRoomStore = (function() { }, /** - * Initiates a screen sharing publisher. + * Initiates a browser tab sharing publisher. * - * @param {sharedActions.StartScreenShare} actionData + * @param {sharedActions.StartBrowserShare} actionData */ - startScreenShare: function(actionData) { + startBrowserShare: function(actionData) { // For the unit test we already set the state here, instead of indirectly // via an action, because actions are queued thus depending on the // asynchronous nature of `loop.request`. @@ -935,28 +934,16 @@ loop.store.ActiveRoomStore = (function() { })); var options = { - videoSource: actionData.type + videoSource: "browser" }; - if (options.videoSource === "browser") { - this._browserSharingListener = this._handleSwitchBrowserShare.bind(this); + this._browserSharingListener = this._handleSwitchBrowserShare.bind(this); - // Set up a listener for watching screen shares. This will get notified - // with the first windowId when it is added, so we start off the sharing - // from within the listener. - loop.request("AddBrowserSharingListener").then(this._browserSharingListener); - loop.subscribe("BrowserSwitch", this._browserSharingListener); - } else { - this._sdkDriver.startScreenShare(options); - } - }, - - /** - * Initiates a browser tab sharing publisher. - * - * @param {sharedActions.StartBrowserShare} actionData - */ - startBrowserShare: function(actionData) { - this.startScreenShare({ type: "browser" }); + // Set up a listener for watching screen shares. This will get notified + // with the first windowId when it is added, so we start off the sharing + // from within the listener. + loop.request("AddBrowserSharingListener", this.getStoreState().windowId) + .then(this._browserSharingListener); + loop.subscribe("BrowserSwitch", this._browserSharingListener); }, /** diff --git a/browser/extensions/loop/content/shared/js/views.js b/browser/extensions/loop/content/shared/js/views.js index bdb6caea01d..dd4db0ecac0 100644 --- a/browser/extensions/loop/content/shared/js/views.js +++ b/browser/extensions/loop/content/shared/js/views.js @@ -10,7 +10,6 @@ loop.shared.views = (function(_, mozL10n) { var sharedActions = loop.shared.actions; var sharedModels = loop.shared.models; var sharedMixins = loop.shared.mixins; - var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; /** * Hang-up control button. @@ -104,114 +103,6 @@ loop.shared.views = (function(_, mozL10n) { } }); - /** - * Screen sharing control button. - * - * Required props: - * - {loop.Dispatcher} dispatcher The dispatcher instance - * - {Boolean} visible Set to true to display the button - * - {String} state One of the screen sharing states, see - * loop.shared.utils.SCREEN_SHARE_STATES - */ - var ScreenShareControlButton = React.createClass({displayName: "ScreenShareControlButton", - mixins: [sharedMixins.DropdownMenuMixin()], - - propTypes: { - dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, - state: React.PropTypes.string.isRequired, - visible: React.PropTypes.bool.isRequired - }, - - getInitialState: function() { - var os = loop.shared.utils.getOS(); - var osVersion = loop.shared.utils.getOSVersion(); - // Disable screensharing on older OSX and Windows versions. - if ((os.indexOf("mac") > -1 && osVersion.major <= 10 && osVersion.minor <= 6) || - (os.indexOf("win") > -1 && osVersion.major <= 5 && osVersion.minor <= 2)) { - return { windowSharingDisabled: true }; - } - return { windowSharingDisabled: false }; - }, - - handleClick: function() { - if (this.props.state === SCREEN_SHARE_STATES.ACTIVE) { - this.props.dispatcher.dispatch( - new sharedActions.EndScreenShare({})); - } else { - this.toggleDropdownMenu(); - } - }, - - _startScreenShare: function(type) { - this.props.dispatcher.dispatch(new sharedActions.StartScreenShare({ - type: type - })); - }, - - _handleShareTabs: function() { - this._startScreenShare("browser"); - this.hideDropdownMenu(); - }, - - _handleShareWindows: function() { - this._startScreenShare("window"); - this.hideDropdownMenu(); - }, - - _getTitle: function() { - var prefix = this.props.state === SCREEN_SHARE_STATES.ACTIVE ? - "active" : "inactive"; - - return mozL10n.get(prefix + "_screenshare_button_title"); - }, - - render: function() { - if (!this.props.visible) { - return null; - } - - var cx = classNames; - - var isActive = this.props.state === SCREEN_SHARE_STATES.ACTIVE; - var screenShareClasses = cx({ - "btn": true, - "btn-screen-share": true, - "transparent-button": true, - "menu-showing": this.state.showMenu, - "active": isActive, - "disabled": this.props.state === SCREEN_SHARE_STATES.PENDING - }); - var dropdownMenuClasses = cx({ - "screen-share-menu": true, - "dropdown-menu": true, - "hide": !this.state.showMenu - }); - var windowSharingClasses = cx({ - "dropdown-menu-item": true, - "disabled": this.state.windowSharingDisabled - }); - - return ( - React.createElement("div", null, - React.createElement("button", {className: screenShareClasses, - onClick: this.handleClick, - ref: "anchor", - title: this._getTitle()}, - isActive ? null : React.createElement("span", {className: "chevron"}) - ), - React.createElement("ul", {className: dropdownMenuClasses, ref: "menu"}, - React.createElement("li", {className: "dropdown-menu-item", onClick: this._handleShareTabs}, - mozL10n.get("share_tabs_button_title2") - ), - React.createElement("li", {className: windowSharingClasses, onClick: this._handleShareWindows}, - mozL10n.get("share_windows_button_title") - ) - ) - ) - ); - } - }); - /** * Settings control button. */ @@ -391,7 +282,6 @@ loop.shared.views = (function(_, mozL10n) { return { video: { enabled: true, visible: true }, audio: { enabled: true, visible: true }, - screenShare: { state: SCREEN_SHARE_STATES.INACTIVE, visible: false }, settingsMenuItems: null, showHangup: true }; @@ -408,7 +298,6 @@ loop.shared.views = (function(_, mozL10n) { dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, hangup: React.PropTypes.func.isRequired, publishStream: React.PropTypes.func.isRequired, - screenShare: React.PropTypes.object, settingsMenuItems: React.PropTypes.array, show: React.PropTypes.bool.isRequired, showHangup: React.PropTypes.bool, @@ -525,11 +414,6 @@ loop.shared.views = (function(_, mozL10n) { visible: this.props.audio.visible}) ) ), - React.createElement("li", {className: "conversation-toolbar-btn-box"}, - React.createElement(ScreenShareControlButton, {dispatcher: this.props.dispatcher, - state: this.props.screenShare.state, - visible: this.props.screenShare.visible}) - ), React.createElement("li", {className: "conversation-toolbar-btn-box btn-edit-entry"}, React.createElement(SettingsControlButton, {menuItems: this.props.settingsMenuItems}) ) @@ -1141,7 +1025,6 @@ loop.shared.views = (function(_, mozL10n) { MediaView: MediaView, LoadingView: LoadingView, SettingsControlButton: SettingsControlButton, - ScreenShareControlButton: ScreenShareControlButton, NotificationListView: NotificationListView }; })(_, navigator.mozL10n || document.mozL10n); diff --git a/browser/extensions/loop/content/shared/js/views.jsx b/browser/extensions/loop/content/shared/js/views.jsx index 723e739f29b..8820386375f 100644 --- a/browser/extensions/loop/content/shared/js/views.jsx +++ b/browser/extensions/loop/content/shared/js/views.jsx @@ -10,7 +10,6 @@ loop.shared.views = (function(_, mozL10n) { var sharedActions = loop.shared.actions; var sharedModels = loop.shared.models; var sharedMixins = loop.shared.mixins; - var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; /** * Hang-up control button. @@ -104,114 +103,6 @@ loop.shared.views = (function(_, mozL10n) { } }); - /** - * Screen sharing control button. - * - * Required props: - * - {loop.Dispatcher} dispatcher The dispatcher instance - * - {Boolean} visible Set to true to display the button - * - {String} state One of the screen sharing states, see - * loop.shared.utils.SCREEN_SHARE_STATES - */ - var ScreenShareControlButton = React.createClass({ - mixins: [sharedMixins.DropdownMenuMixin()], - - propTypes: { - dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, - state: React.PropTypes.string.isRequired, - visible: React.PropTypes.bool.isRequired - }, - - getInitialState: function() { - var os = loop.shared.utils.getOS(); - var osVersion = loop.shared.utils.getOSVersion(); - // Disable screensharing on older OSX and Windows versions. - if ((os.indexOf("mac") > -1 && osVersion.major <= 10 && osVersion.minor <= 6) || - (os.indexOf("win") > -1 && osVersion.major <= 5 && osVersion.minor <= 2)) { - return { windowSharingDisabled: true }; - } - return { windowSharingDisabled: false }; - }, - - handleClick: function() { - if (this.props.state === SCREEN_SHARE_STATES.ACTIVE) { - this.props.dispatcher.dispatch( - new sharedActions.EndScreenShare({})); - } else { - this.toggleDropdownMenu(); - } - }, - - _startScreenShare: function(type) { - this.props.dispatcher.dispatch(new sharedActions.StartScreenShare({ - type: type - })); - }, - - _handleShareTabs: function() { - this._startScreenShare("browser"); - this.hideDropdownMenu(); - }, - - _handleShareWindows: function() { - this._startScreenShare("window"); - this.hideDropdownMenu(); - }, - - _getTitle: function() { - var prefix = this.props.state === SCREEN_SHARE_STATES.ACTIVE ? - "active" : "inactive"; - - return mozL10n.get(prefix + "_screenshare_button_title"); - }, - - render: function() { - if (!this.props.visible) { - return null; - } - - var cx = classNames; - - var isActive = this.props.state === SCREEN_SHARE_STATES.ACTIVE; - var screenShareClasses = cx({ - "btn": true, - "btn-screen-share": true, - "transparent-button": true, - "menu-showing": this.state.showMenu, - "active": isActive, - "disabled": this.props.state === SCREEN_SHARE_STATES.PENDING - }); - var dropdownMenuClasses = cx({ - "screen-share-menu": true, - "dropdown-menu": true, - "hide": !this.state.showMenu - }); - var windowSharingClasses = cx({ - "dropdown-menu-item": true, - "disabled": this.state.windowSharingDisabled - }); - - return ( -
- - -
- ); - } - }); - /** * Settings control button. */ @@ -391,7 +282,6 @@ loop.shared.views = (function(_, mozL10n) { return { video: { enabled: true, visible: true }, audio: { enabled: true, visible: true }, - screenShare: { state: SCREEN_SHARE_STATES.INACTIVE, visible: false }, settingsMenuItems: null, showHangup: true }; @@ -408,7 +298,6 @@ loop.shared.views = (function(_, mozL10n) { dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, hangup: React.PropTypes.func.isRequired, publishStream: React.PropTypes.func.isRequired, - screenShare: React.PropTypes.object, settingsMenuItems: React.PropTypes.array, show: React.PropTypes.bool.isRequired, showHangup: React.PropTypes.bool, @@ -525,11 +414,6 @@ loop.shared.views = (function(_, mozL10n) { visible={this.props.audio.visible}/> -
  • - -
  • @@ -1141,7 +1025,6 @@ loop.shared.views = (function(_, mozL10n) { MediaView: MediaView, LoadingView: LoadingView, SettingsControlButton: SettingsControlButton, - ScreenShareControlButton: ScreenShareControlButton, NotificationListView: NotificationListView }; })(_, navigator.mozL10n || document.mozL10n); diff --git a/browser/extensions/loop/standalone/content/l10n/en-US/loop.properties b/browser/extensions/loop/standalone/content/l10n/en-US/loop.properties index 9a2102b4f16..d27774ab063 100644 --- a/browser/extensions/loop/standalone/content/l10n/en-US/loop.properties +++ b/browser/extensions/loop/standalone/content/l10n/en-US/loop.properties @@ -12,8 +12,6 @@ mute_local_audio_button_title=Mute your audio unmute_local_audio_button_title=Unmute your audio mute_local_video_button_title2=Disable video unmute_local_video_button_title2=Enable video -active_screenshare_button_title=Stop sharing -inactive_screenshare_button_title=Share your screen welcome=Welcome to the {{clientShortname}} web client. incompatible_browser_heading=Oops! diff --git a/browser/extensions/loop/test/desktop-local/roomViews_test.js b/browser/extensions/loop/test/desktop-local/roomViews_test.js index 4c9738cd528..58e2cdd6b5f 100644 --- a/browser/extensions/loop/test/desktop-local/roomViews_test.js +++ b/browser/extensions/loop/test/desktop-local/roomViews_test.js @@ -400,11 +400,9 @@ describe("loop.roomViews", function() { expect(muteBtn.classList.contains("muted")).eql(true); }); - it("should dispatch a `StartScreenShare` action when sharing is not active and the screen share button is pressed", function() { + it("should dispatch a `SetMute` action when the mute button is pressed", function() { view = mountTestComponent(); - view.setState({ screenSharingState: SCREEN_SHARE_STATES.INACTIVE }); - var muteBtn = view.getDOMNode().querySelector(".btn-mute-video"); React.addons.TestUtils.Simulate.click(muteBtn); diff --git a/browser/extensions/loop/test/functional/test_1_browser_call.py b/browser/extensions/loop/test/functional/test_1_browser_call.py index de09997d175..0890762934e 100644 --- a/browser/extensions/loop/test/functional/test_1_browser_call.py +++ b/browser/extensions/loop/test/functional/test_1_browser_call.py @@ -186,12 +186,6 @@ class Test1BrowserCall(MarionetteTestCase): self.switch_to_chatbox() self.check_received_message("test2") - def local_enable_screenshare(self): - self.switch_to_chatbox() - button = self.marionette.find_element(By.CLASS_NAME, "btn-screen-share") - - button.click() - def standalone_check_remote_screenshare(self): self.switch_to_standalone() self.check_video(".screen-share-video") @@ -293,10 +287,8 @@ class Test1BrowserCall(MarionetteTestCase): # the start time self.local_check_media_start_time_initialized() - # XXX To enable this, we either need to navigate the permissions prompt - # or have a route where we don't need the permissions prompt. - # self.local_enable_screenshare() - # self.standalone_check_remote_screenshare() + # Check that screenshare was automatically started + self.standalone_check_remote_screenshare() # We hangup on the remote (standalone) side, because this also leaves # the local chatbox with the local publishing media still connected, diff --git a/browser/extensions/loop/test/shared/activeRoomStore_test.js b/browser/extensions/loop/test/shared/activeRoomStore_test.js index b9c7dfd3965..fd1a977ce69 100644 --- a/browser/extensions/loop/test/shared/activeRoomStore_test.js +++ b/browser/extensions/loop/test/shared/activeRoomStore_test.js @@ -199,9 +199,7 @@ describe("loop.store.ActiveRoomStore", function() { it("should remove the sharing listener", function() { // Setup the listener. - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); // Now simulate room failure. store.roomFailure(new sharedActions.RoomFailure({ @@ -1257,9 +1255,7 @@ describe("loop.store.ActiveRoomStore", function() { it("should remove the sharing listener", function() { // Setup the listener. - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); // Now simulate connection failure. store.connectionFailure(connectionFailureAction); @@ -1539,15 +1535,13 @@ describe("loop.store.ActiveRoomStore", function() { }); }); - describe("#startScreenShare", function() { + describe("#startBrowserShare", function() { afterEach(function() { store.endScreenShare(); }); it("should set the state to 'pending'", function() { - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "window" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); sinon.assert.calledOnce(dispatcher.dispatch); sinon.assert.calledWith(dispatcher.dispatch, @@ -1556,29 +1550,14 @@ describe("loop.store.ActiveRoomStore", function() { })); }); - it("should invoke the SDK driver with the correct options for window sharing", function() { - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "window" - })); - - sinon.assert.calledOnce(fakeSdkDriver.startScreenShare); - sinon.assert.calledWith(fakeSdkDriver.startScreenShare, { - videoSource: "window" - }); - }); - it("should add a browser sharing listener for tab sharing", function() { - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); sinon.assert.calledOnce(requestStubs.AddBrowserSharingListener); }); it("should invoke the SDK driver with the correct options for tab sharing", function() { - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); sinon.assert.calledOnce(fakeSdkDriver.startScreenShare); sinon.assert.calledWith(fakeSdkDriver.startScreenShare, { @@ -1593,9 +1572,7 @@ describe("loop.store.ActiveRoomStore", function() { describe("Screen share Events", function() { beforeEach(function() { - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); store.setStoreState({ screenSharingState: SCREEN_SHARE_STATES.ACTIVE @@ -1652,9 +1629,7 @@ describe("loop.store.ActiveRoomStore", function() { it("should remove the sharing listener", function() { // Setup the listener. - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); // Now stop the screen share. store.endScreenShare(); @@ -1807,9 +1782,7 @@ describe("loop.store.ActiveRoomStore", function() { it("should remove the sharing listener", function() { // Setup the listener. - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); // Now unload the window. store.windowUnload(); @@ -1864,9 +1837,7 @@ describe("loop.store.ActiveRoomStore", function() { it("should remove the sharing listener", function() { // Setup the listener. - store.startScreenShare(new sharedActions.StartScreenShare({ - type: "browser" - })); + store.startBrowserShare(new sharedActions.StartBrowserShare()); // Now leave the room. store.leaveRoom(); diff --git a/browser/extensions/loop/test/shared/views_test.js b/browser/extensions/loop/test/shared/views_test.js index b71ccbcb09b..5f3036ba5a2 100644 --- a/browser/extensions/loop/test/shared/views_test.js +++ b/browser/extensions/loop/test/shared/views_test.js @@ -11,7 +11,6 @@ describe("loop.shared.views", function() { var sharedActions = loop.shared.actions; var sharedModels = loop.shared.models; var sharedViews = loop.shared.views; - var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; var getReactElementByClass = TestUtils.findRenderedDOMComponentWithClass; var sandbox, fakeAudioXHR, dispatcher, OS, OSVersion; @@ -109,186 +108,6 @@ describe("loop.shared.views", function() { }); }); - describe("ScreenShareControlButton", function() { - it("should render a visible share button", function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - expect(comp.getDOMNode().classList.contains("active")).eql(false); - expect(comp.getDOMNode().classList.contains("disabled")).eql(false); - }); - - it("should render a disabled share button when share is pending", function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.PENDING - })); - - var node = comp.getDOMNode().querySelector(".btn-screen-share"); - expect(node.classList.contains("active")).eql(false); - expect(node.classList.contains("disabled")).eql(true); - }); - - it("should render an active share button", function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.ACTIVE - })); - - var node = comp.getDOMNode().querySelector(".btn-screen-share"); - expect(node.classList.contains("active")).eql(true); - expect(node.classList.contains("disabled")).eql(false); - }); - - it("should show the screenshare dropdown on click when the state is not active", - function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - expect(comp.state.showMenu).eql(false); - - TestUtils.Simulate.click(comp.getDOMNode().querySelector(".btn-screen-share")); - - expect(comp.state.showMenu).eql(true); - }); - - it("should dispatch a 'browser' StartScreenShare action on option click", - function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - TestUtils.Simulate.click(comp.getDOMNode().querySelector( - ".screen-share-menu > li")); - - sinon.assert.calledOnce(dispatcher.dispatch); - sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.StartScreenShare({ type: "browser" })); - }); - - it("should close the dropdown on 'browser' option click", function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - sandbox.stub(comp, "hideDropdownMenu"); - - TestUtils.Simulate.click(comp.getDOMNode().querySelector( - ".screen-share-menu > li")); - - sinon.assert.calledOnce(comp.hideDropdownMenu); - }); - - it("should dispatch a 'window' StartScreenShare action on option click", - function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - TestUtils.Simulate.click(comp.getDOMNode().querySelector( - ".screen-share-menu > li:last-child")); - - sinon.assert.calledOnce(dispatcher.dispatch); - sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.StartScreenShare({ type: "window" })); - }); - - it("should close the dropdown on 'window' option click", function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - sandbox.stub(comp, "hideDropdownMenu"); - - TestUtils.Simulate.click(comp.getDOMNode().querySelector( - ".screen-share-menu > li:last-child")); - - sinon.assert.calledOnce(comp.hideDropdownMenu); - }); - - it("should have the 'window' option enabled", function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - var node = comp.getDOMNode().querySelector(".screen-share-menu > li:last-child"); - expect(node.classList.contains("disabled")).eql(false); - }); - - it("should disable the 'window' option on Windows XP", function() { - OS = "win"; - OSVersion = { major: 5, minor: 1 }; - - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - var node = comp.getDOMNode().querySelector(".screen-share-menu > li:last-child"); - expect(node.classList.contains("disabled")).eql(true); - }); - - it("should disable the 'window' option on OSX 10.6", function() { - OS = "mac"; - OSVersion = { major: 10, minor: 6 }; - - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.INACTIVE - })); - - var node = comp.getDOMNode().querySelector(".screen-share-menu > li:last-child"); - expect(node.classList.contains("disabled")).eql(true); - }); - - it("should dispatch a EndScreenShare action on click when the state is active", - function() { - var comp = TestUtils.renderIntoDocument( - React.createElement(sharedViews.ScreenShareControlButton, { - dispatcher: dispatcher, - visible: true, - state: SCREEN_SHARE_STATES.ACTIVE - })); - - TestUtils.Simulate.click(comp.getDOMNode().querySelector(".btn-screen-share")); - - sinon.assert.calledOnce(dispatcher.dispatch); - sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.EndScreenShare({})); - }); - }); - describe("SettingsControlButton", function() { var requestStubs; var support_url = "https://support.com"; diff --git a/browser/extensions/loop/ui/ui-showcase.js b/browser/extensions/loop/ui/ui-showcase.js index 59c984e7b14..eade7818e9e 100644 --- a/browser/extensions/loop/ui/ui-showcase.js +++ b/browser/extensions/loop/ui/ui-showcase.js @@ -38,7 +38,6 @@ var ROOM_STATES = loop.store.ROOM_STATES; var CALL_TYPES = loop.shared.utils.CALL_TYPES; var FAILURE_DETAILS = loop.shared.utils.FAILURE_DETAILS; - var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; // Local helpers function returnTrue() { @@ -743,7 +742,6 @@ dispatcher: dispatcher, hangup: noop, publishStream: noop, - screenShare: { state: SCREEN_SHARE_STATES.INACTIVE, visible: true}, settingsMenuItems: [{ id: "feedback" }], show: true, video: { enabled: true, visible: true}}) @@ -751,14 +749,13 @@ ), React.createElement(FramedExample, {dashed: true, height: 56, - summary: "Video muted, Screen share pending", + summary: "Video muted", width: 300}, React.createElement("div", {className: "fx-embedded"}, React.createElement(ConversationToolbar, {audio: { enabled: true, visible: true}, dispatcher: dispatcher, hangup: noop, publishStream: noop, - screenShare: { state: SCREEN_SHARE_STATES.PENDING, visible: true}, settingsMenuItems: [{ id: "feedback" }], show: true, video: { enabled: false, visible: true}}) @@ -766,14 +763,13 @@ ), React.createElement(FramedExample, {dashed: true, height: 56, - summary: "Audio muted, Screen share active", + summary: "Audio muted", width: 300}, React.createElement("div", {className: "fx-embedded"}, React.createElement(ConversationToolbar, {audio: { enabled: false, visible: true}, dispatcher: dispatcher, hangup: noop, publishStream: noop, - screenShare: { state: SCREEN_SHARE_STATES.ACTIVE, visible: true}, settingsMenuItems: [{ id: "feedback" }], show: true, video: { enabled: true, visible: true}}) diff --git a/browser/extensions/loop/ui/ui-showcase.jsx b/browser/extensions/loop/ui/ui-showcase.jsx index 17c24c57f6f..1acd89a7322 100644 --- a/browser/extensions/loop/ui/ui-showcase.jsx +++ b/browser/extensions/loop/ui/ui-showcase.jsx @@ -38,7 +38,6 @@ var ROOM_STATES = loop.store.ROOM_STATES; var CALL_TYPES = loop.shared.utils.CALL_TYPES; var FAILURE_DETAILS = loop.shared.utils.FAILURE_DETAILS; - var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; // Local helpers function returnTrue() { @@ -743,7 +742,6 @@ dispatcher={dispatcher} hangup={noop} publishStream={noop} - screenShare={{ state: SCREEN_SHARE_STATES.INACTIVE, visible: true }} settingsMenuItems={[{ id: "feedback" }]} show={true} video={{ enabled: true, visible: true }} /> @@ -751,14 +749,13 @@
    @@ -766,14 +763,13 @@
    diff --git a/browser/locales/en-US/chrome/browser/loop/loop.properties b/browser/locales/en-US/chrome/browser/loop/loop.properties index b27e1e57287..efcdb5247a7 100644 --- a/browser/locales/en-US/chrome/browser/loop/loop.properties +++ b/browser/locales/en-US/chrome/browser/loop/loop.properties @@ -104,10 +104,6 @@ mute_local_audio_button_title=Mute your audio unmute_local_audio_button_title=Unmute your audio mute_local_video_button_title2=Disable video unmute_local_video_button_title2=Enable video -active_screenshare_button_title=Stop sharing -inactive_screenshare_button_title=Share your screen -share_tabs_button_title2=Share your Tabs -share_windows_button_title=Share other Windows self_view_hidden_message=Self-view hidden but still being sent; resize window to show