зеркало из https://github.com/mozilla/gecko-dev.git
Back out 7b0bb5c3ab01 (bug 1259245) for very frequent OS X 10.10 e10s mochitest-5 crashes, a=backout
CLOSED TREE
This commit is contained in:
Родитель
ba049d3406
Коммит
48e56cf3be
|
@ -13,9 +13,6 @@ const kBrowserSharingNotificationId = "loop-sharing-notification";
|
|||
const CURSOR_MIN_DELTA = 3;
|
||||
const CURSOR_MIN_INTERVAL = 100;
|
||||
const CURSOR_CLICK_DELAY = 1000;
|
||||
// Due to bug 1051238 frame scripts are cached forever, so we can't update them
|
||||
// as a restartless add-on. The Math.random() is the work around for this.
|
||||
const FRAME_SCRIPT = "chrome://loop/content/modules/tabFrame.js?" + Math.random();
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
@ -60,7 +57,6 @@ var WindowListener = {
|
|||
let FileReader = window.FileReader;
|
||||
let menuItem = null;
|
||||
let isSlideshowOpen = false;
|
||||
let titleChangedListener = null;
|
||||
|
||||
// the "exported" symbols
|
||||
var LoopUI = {
|
||||
|
@ -119,10 +115,6 @@ var WindowListener = {
|
|||
return this._constants;
|
||||
},
|
||||
|
||||
get mm() {
|
||||
return window.getGroupMessageManager("browsers");
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {Promise}
|
||||
*/
|
||||
|
@ -321,10 +313,6 @@ var WindowListener = {
|
|||
return;
|
||||
}
|
||||
|
||||
// Load the frame script into any tab, plus any that get created in the
|
||||
// future.
|
||||
this.mm.loadFrameScript(FRAME_SCRIPT, true);
|
||||
|
||||
// Cleanup when the window unloads.
|
||||
window.addEventListener("unload", () => {
|
||||
Services.obs.removeObserver(this, "loop-status-changed");
|
||||
|
@ -534,13 +522,9 @@ var WindowListener = {
|
|||
gBrowser.tabContainer.addEventListener("TabSelect", this);
|
||||
this._listeningToTabSelect = true;
|
||||
|
||||
titleChangedListener = this.handleDOMTitleChanged.bind(this);
|
||||
|
||||
// Watch for title changes as opposed to location changes as more
|
||||
// metadata about the page is available when this event fires.
|
||||
this.mm.addMessageListener("loop@mozilla.org:DOMTitleChanged",
|
||||
titleChangedListener);
|
||||
|
||||
gBrowser.addEventListener("DOMTitleChanged", this);
|
||||
this._browserSharePaused = false;
|
||||
|
||||
// Add this event to the parent gBrowser to avoid adding and removing
|
||||
|
@ -566,12 +550,7 @@ var WindowListener = {
|
|||
|
||||
this._hideBrowserSharingInfoBar();
|
||||
gBrowser.tabContainer.removeEventListener("TabSelect", this);
|
||||
|
||||
if (titleChangedListener) {
|
||||
this.mm.removeMessageListener("loop@mozilla.org:DOMTitleChanged",
|
||||
titleChangedListener);
|
||||
titleChangedListener = null;
|
||||
}
|
||||
gBrowser.removeEventListener("DOMTitleChanged", this);
|
||||
|
||||
// Remove shared pointers related events
|
||||
gBrowser.removeEventListener("mousemove", this);
|
||||
|
@ -809,27 +788,15 @@ var WindowListener = {
|
|||
gBrowser.selectedBrowser.outerWindowID);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles events from the frame script.
|
||||
*
|
||||
* @param {Object} message The message received from the frame script.
|
||||
*/
|
||||
handleDOMTitleChanged: function(message) {
|
||||
if (!this._listeningToTabSelect || this._browserSharePaused) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gBrowser.selectedBrowser == message.target) {
|
||||
// Get the new title of the shared tab
|
||||
this._notifyBrowserSwitch();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles events from gBrowser.
|
||||
*/
|
||||
handleEvent: function(event) {
|
||||
switch (event.type) {
|
||||
case "DOMTitleChanged":
|
||||
// Get the new title of the shared tab
|
||||
this._notifyBrowserSwitch();
|
||||
break;
|
||||
case "TabSelect":
|
||||
let wasVisible = false;
|
||||
// Hide the infobar from the previous tab.
|
||||
|
@ -972,10 +939,6 @@ var WindowListener = {
|
|||
if (window.LoopUI) {
|
||||
window.LoopUI.removeMenuItem();
|
||||
|
||||
// This stops the frame script being loaded to new tabs, but doesn't
|
||||
// remove it from existing tabs (there's no way to do that).
|
||||
window.LoopUI.mm.removeDelayedFrameScript(FRAME_SCRIPT);
|
||||
|
||||
// XXX Bug 1229352 - Add in tear-down of the panel.
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/* global sendAsyncMessage */
|
||||
|
||||
/**
|
||||
* This script runs in the content process and is attached to browsers when
|
||||
* they are created.
|
||||
*/
|
||||
|
||||
// Listen for when the title is changed and send a message back to the chrome
|
||||
// process.
|
||||
addEventListener("DOMTitleChanged", ({ target }) => {
|
||||
sendAsyncMessage("loop@mozilla.org:DOMTitleChanged", {
|
||||
details: "titleChanged"
|
||||
}, {
|
||||
target: target
|
||||
});
|
||||
});
|
|
@ -30,6 +30,7 @@
|
|||
}
|
||||
|
||||
.room-invitation-content > * {
|
||||
width: 100%;
|
||||
margin: 0 15px;
|
||||
}
|
||||
|
||||
|
@ -229,6 +230,10 @@ html[dir="rtl"] .share-panel-container > .room-invitation-overlay {
|
|||
margin: 0 0 12px;
|
||||
}
|
||||
|
||||
.share-panel-container > .room-invitation-overlay > .room-invitation-content > * {
|
||||
width: initial;
|
||||
}
|
||||
|
||||
.share-panel-open > .room-invitation-overlay,
|
||||
html[dir="rtl"] .share-panel-open > .room-invitation-overlay {
|
||||
transform: translateX(0);
|
||||
|
|
|
@ -356,7 +356,6 @@ loop.roomViews = function (mozL10n) {
|
|||
screenShareMediaElement: this.state.screenShareMediaElement,
|
||||
screenSharePosterUrl: null,
|
||||
showInitialContext: false,
|
||||
showMediaWait: false,
|
||||
showTile: false },
|
||||
React.createElement(sharedViews.ConversationToolbar, {
|
||||
audio: { enabled: !this.state.audioMuted, visible: true },
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
pref("loop.enabled", true);
|
||||
pref("loop.remote.autostart", true);
|
||||
#ifdef LOOP_DEV_XPI
|
||||
pref("loop.server", "https://loop-dev.stage.mozaws.net/v0");
|
||||
pref("loop.linkClicker.url", "https://loop-webapp-dev.stage.mozaws.net/");
|
||||
#else
|
||||
pref("loop.server", "https://loop.services.mozilla.com/v0");
|
||||
pref("loop.linkClicker.url", "https://hello.firefox.com/");
|
||||
#endif
|
||||
pref("loop.gettingStarted.latestFTUVersion", 1);
|
||||
pref("loop.gettingStarted.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/hello/start/");
|
||||
pref("loop.gettingStarted.resumeOnFirstJoin", false);
|
||||
|
|
|
@ -510,74 +510,40 @@ html, .fx-embedded, #main,
|
|||
width: 272px;
|
||||
}
|
||||
|
||||
.media-wrapper > .text-chat-view > .text-chat-entries > .text-chat-scroller > .welcome-message {
|
||||
font-size: 1.2rem;
|
||||
margin: 0 0 15px;
|
||||
color: #5e5f64;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.media-wrapper.showing-local-streams > .text-chat-view,
|
||||
.media-wrapper.showing-media-wait > .text-chat-view {
|
||||
.media-wrapper.showing-local-streams > .text-chat-view {
|
||||
/* When we're displaying the local streams, then we need to make the text
|
||||
chat view a bit shorter to give room. */
|
||||
height: calc(100% - 204px);
|
||||
}
|
||||
|
||||
.media-wrapper.showing-media-wait > .text-chat-view {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.media-wrapper.showing-media-wait > .local {
|
||||
/* Hides the local stream video box while we're asking the user for permissions */
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-wrapper.showing-local-streams.receiving-screen-share {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-wrapper.showing-local-streams.receiving-screen-share > .text-chat-view {
|
||||
/* When we're displaying the local streams, then we need to make the text
|
||||
chat view a bit shorter to give room. 1 streams x 204px */
|
||||
height: calc(100% - 204px);
|
||||
chat view a bit shorter to give room. 2 streams x 204px each*/
|
||||
height: calc(100% - 408px);
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .screen {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .text-chat-view,
|
||||
.media-wrapper.showing-local-streams > .text-chat-view {
|
||||
order: 4;
|
||||
.media-wrapper.receiving-screen-share > .text-chat-view {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .remote {
|
||||
flex: 0 1 auto;
|
||||
order: 2;
|
||||
order: 3;
|
||||
/* to keep the 4:3 ratio set both height and width */
|
||||
height: 204px;
|
||||
width: 272px;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share > .local {
|
||||
order: 3;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share.showing-remote-streams > .local {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
padding: 8px;
|
||||
right: 0;
|
||||
left: auto;
|
||||
top: 124px;
|
||||
/* to keep the 4:3 ratio 80x60px + 16px padding + 4px border */
|
||||
width: calc(80px + 16px + 4px);
|
||||
height: calc(60px + 16px + 4px);
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share.showing-remote-streams > .local > .remote-video-box {
|
||||
border: solid 2px #fff;
|
||||
order: 4;
|
||||
}
|
||||
|
||||
@media screen and (max-width:640px) {
|
||||
|
@ -664,7 +630,7 @@ html, .fx-embedded, #main,
|
|||
object-fit: contain;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share.showing-remote-streams > .local {
|
||||
.media-wrapper.receiving-screen-share > .local {
|
||||
/* Screen shares have remote & local video side-by-side on narrow screens */
|
||||
order: 3;
|
||||
flex: 1 1 auto;
|
||||
|
@ -675,15 +641,13 @@ html, .fx-embedded, #main,
|
|||
max-width: 50%;
|
||||
/* This cancels out the absolute positioning when it's just remote video. */
|
||||
position: relative;
|
||||
top: auto;
|
||||
bottom: auto;
|
||||
right: auto;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-wrapper.receiving-screen-share.showing-remote-streams > .local > .remote-video-box {
|
||||
border: 0;
|
||||
.media-wrapper.receiving-screen-share > .text-chat-view {
|
||||
order: 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,11 +216,6 @@ loop.shared.views.chat = function (mozL10n) {
|
|||
React.createElement(
|
||||
"div",
|
||||
{ className: "text-chat-scroller" },
|
||||
loop.shared.utils.isDesktop() ? null : React.createElement(
|
||||
"p",
|
||||
{ className: "welcome-message" },
|
||||
mozL10n.get("rooms_welcome_text_chat_label", { clientShortname: mozL10n.get("clientShortname2") })
|
||||
),
|
||||
this.props.messageList.map(function (entry, i) {
|
||||
if (entry.type === CHAT_MESSAGE_TYPES.SPECIAL) {
|
||||
if (!this.props.showInitialContext) {
|
||||
|
|
|
@ -885,7 +885,6 @@ loop.shared.views = function (_, mozL10n) {
|
|||
screenSharePosterUrl: React.PropTypes.string,
|
||||
screenSharingPaused: React.PropTypes.bool,
|
||||
showInitialContext: React.PropTypes.bool.isRequired,
|
||||
showMediaWait: React.PropTypes.bool.isRequired,
|
||||
showTile: React.PropTypes.bool.isRequired
|
||||
},
|
||||
|
||||
|
@ -943,30 +942,6 @@ loop.shared.views = function (_, mozL10n) {
|
|||
);
|
||||
},
|
||||
|
||||
renderMediaWait: function () {
|
||||
var msg = mozL10n.get("call_progress_getting_media_description", { clientShortname: mozL10n.get("clientShortname2") });
|
||||
var utils = loop.shared.utils;
|
||||
var isChrome = utils.isChrome(navigator.userAgent);
|
||||
var isFirefox = utils.isFirefox(navigator.userAgent);
|
||||
var isOpera = utils.isOpera(navigator.userAgent);
|
||||
var promptMediaMessageClasses = classNames({
|
||||
"prompt-media-message": true,
|
||||
"chrome": isChrome,
|
||||
"firefox": isFirefox,
|
||||
"opera": isOpera,
|
||||
"other": !isChrome && !isFirefox && !isOpera
|
||||
});
|
||||
return React.createElement(
|
||||
"div",
|
||||
{ className: "prompt-media-message-wrapper" },
|
||||
React.createElement(
|
||||
"p",
|
||||
{ className: promptMediaMessageClasses },
|
||||
msg
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
var remoteStreamClasses = classNames({
|
||||
"remote": true,
|
||||
|
@ -983,7 +958,6 @@ loop.shared.views = function (_, mozL10n) {
|
|||
"media-wrapper": true,
|
||||
"receiving-screen-share": this.props.displayScreenShare,
|
||||
"showing-local-streams": this.props.localSrcMediaElement || this.props.localPosterUrl,
|
||||
"showing-media-wait": this.props.showMediaWait,
|
||||
"showing-remote-streams": this.props.remoteSrcMediaElement || this.props.remotePosterUrl || this.props.isRemoteLoading
|
||||
});
|
||||
|
||||
|
@ -1029,8 +1003,7 @@ loop.shared.views = function (_, mozL10n) {
|
|||
dispatcher: this.props.dispatcher,
|
||||
showInitialContext: this.props.showInitialContext,
|
||||
showTile: this.props.showTile }),
|
||||
this.state.localMediaAboslutelyPositioned ? null : this.renderLocalVideo(),
|
||||
this.props.showMediaWait ? this.renderMediaWait() : null
|
||||
this.state.localMediaAboslutelyPositioned ? null : this.renderLocalVideo()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -831,7 +831,6 @@ describe("loop.shared.views", function() {
|
|||
matchMedia: window.matchMedia,
|
||||
renderRemoteVideo: false,
|
||||
showInitialContext: false,
|
||||
showMediaWait: false,
|
||||
showTile: false
|
||||
};
|
||||
|
||||
|
@ -969,24 +968,6 @@ describe("loop.shared.views", function() {
|
|||
expect(view.getDOMNode().querySelector(".media-wrapper")
|
||||
.classList.contains("showing-remote-streams")).eql(true);
|
||||
});
|
||||
|
||||
it("should mark the wrapper as showing media wait tile when asking for user media", function() {
|
||||
view = mountTestComponent({
|
||||
showMediaWait: true
|
||||
});
|
||||
|
||||
expect(view.getDOMNode().querySelector(".media-wrapper")
|
||||
.classList.contains("showing-media-wait")).eql(true);
|
||||
});
|
||||
|
||||
it("should display a media wait tile when asking for user media", function() {
|
||||
view = mountTestComponent({
|
||||
showMediaWait: true
|
||||
});
|
||||
|
||||
expect(view.getDOMNode().querySelector(".prompt-media-message-wrapper"))
|
||||
.not.eql(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe("RemoteCursorView", function() {
|
||||
|
|
|
@ -16,5 +16,4 @@ support-files =
|
|||
[browser_mozLoop_sharingListeners.js]
|
||||
skip-if = e10s
|
||||
[browser_mozLoop_telemetry.js]
|
||||
[browser_sharingTitleListeners.js]
|
||||
[browser_toolbarbutton.js]
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/*
|
||||
* This file contains tests for the browser sharing document title listeners.
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
var [, gHandlers] = LoopAPI.inspect();
|
||||
|
||||
function promiseBrowserSwitch() {
|
||||
return new Promise(resolve => {
|
||||
LoopAPI.stub([{
|
||||
sendAsyncMessage: function(messageName, data) {
|
||||
if (data[0] == "BrowserSwitch") {
|
||||
LoopAPI.restore();
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
}]);
|
||||
});
|
||||
}
|
||||
|
||||
add_task(function* setup() {
|
||||
Services.prefs.setBoolPref("loop.remote.autostart", true);
|
||||
|
||||
gHandlers.AddBrowserSharingListener({ data: [42] }, () => {});
|
||||
|
||||
let newTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank", true);
|
||||
|
||||
registerCleanupFunction(function* () {
|
||||
// Remove the listener.
|
||||
gHandlers.RemoveBrowserSharingListener({ data: [42] }, function() {});
|
||||
|
||||
yield BrowserTestUtils.removeTab(newTab);
|
||||
|
||||
Services.prefs.clearUserPref("loop.remote.autostart");
|
||||
});
|
||||
});
|
||||
|
||||
add_task(function* test_notifyOnTitleChanged() {
|
||||
// Hook up the async listener and wait for the BrowserSwitch to happen.
|
||||
let browserSwitchPromise = promiseBrowserSwitch();
|
||||
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:mozilla");
|
||||
|
||||
// Now check we get the notification of the browser switch.
|
||||
yield browserSwitchPromise;
|
||||
|
||||
Assert.ok(true, "We got notification of the browser switch");
|
||||
});
|
|
@ -9,9 +9,8 @@
|
|||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>loop@mozilla.org</em:id>
|
||||
<em:bootstrap>true</em:bootstrap>
|
||||
<em:version>1.2.3</em:version>
|
||||
<em:version>1.2.2</em:version>
|
||||
<em:type>2</em:type>
|
||||
<em:multiprocessCompatible>true</em:multiprocessCompatible>
|
||||
|
||||
<!-- Target Application this extension can install into,
|
||||
with minimum and maximum supported versions. -->
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
[features/loop@mozilla.org] chrome.jar:
|
||||
% content loop %content/ contentaccessible=yes
|
||||
% content loop-locale-fallback %content/locale-fallback/en-US/
|
||||
% skin loop classic/1.0 %skin/linux/
|
||||
% skin loop classic/1.0 %skin/linux/ os=Linux
|
||||
% skin loop classic/1.0 %skin/osx/ os=Darwin
|
||||
% skin loop classic/1.0 %skin/windows/ os=WINNT
|
||||
% skin loop-shared classic/1.0 %skin/shared/
|
||||
|
|
Загрузка…
Ссылка в новой задаче