mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
Bug 1160487 - Enable eslint rules for Loop: semi-colon related. r=Standard8
This commit is contained in:
parent
3bf1f269c9
commit
75dc92028a
@ -49,7 +49,6 @@
|
||||
"no-empty": 0, // TODO: Remove (use default)
|
||||
"no-extra-bind": 0, // Leave as 0
|
||||
"no-extra-boolean-cast": 0, // TODO: Remove (use default)
|
||||
"no-extra-semi": 0, // TODO: Remove (use default)
|
||||
"no-multi-spaces": 0, // TBD.
|
||||
"no-new": 0, // TODO: Remove (use default)
|
||||
"no-redeclare": 0, // TODO: Remove (use default)
|
||||
@ -64,8 +63,6 @@
|
||||
"no-use-before-define": 0, // TODO: Remove (use default)
|
||||
"no-wrap-func": 0, // TODO: Remove (use default)
|
||||
"quotes": 0, // [2, "double", "avoid-escape"],
|
||||
"semi": 0, // TODO: Remove (use default)
|
||||
"semi-spacing": 0, // TODO: Remove (use default)
|
||||
"space-infix-ops": 0, // TODO: Remove (use default)
|
||||
"space-return-throw-case": 0, // TODO: Remove (use default)
|
||||
"strict": 0, // [2, "function"],
|
||||
|
@ -18,7 +18,7 @@ var inChrome = typeof Components != "undefined" && "utils" in Components;
|
||||
throw new Error("mozL10n.get not availabled from chrome!");
|
||||
}};
|
||||
} else {
|
||||
mozL10n = document.mozL10n || navigator.mozL10n
|
||||
mozL10n = document.mozL10n || navigator.mozL10n;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ loop.CallConnectionWebSocket = (function() {
|
||||
loop.shared.utils.getBoolPreference("debug.websocket");
|
||||
|
||||
_.extend(this, Backbone.Events);
|
||||
};
|
||||
}
|
||||
|
||||
CallConnectionWebSocket.prototype = {
|
||||
/**
|
||||
|
@ -306,7 +306,7 @@ this.CardDavImporter.prototype = {
|
||||
// a supported field. We're saving it off here in case we
|
||||
// need to use it if the fullname is blank.
|
||||
nickname = value;
|
||||
};
|
||||
}
|
||||
|
||||
if (name === "ADR") {
|
||||
value = value.replace(/\\;/g, "\r");
|
||||
@ -455,7 +455,7 @@ this.CardDavImporter.prototype = {
|
||||
|
||||
req.onerror = function(error) {
|
||||
reject(error);
|
||||
}
|
||||
};
|
||||
|
||||
req.send(body);
|
||||
});
|
||||
|
@ -325,7 +325,7 @@ this.GoogleImporter.prototype = {
|
||||
|
||||
request.onerror = function(error) {
|
||||
reject(error);
|
||||
}
|
||||
};
|
||||
|
||||
request.send();
|
||||
});
|
||||
@ -514,7 +514,7 @@ this.GoogleImporter.prototype = {
|
||||
for (let [,orgNode] of Iterator(orgNodes)) {
|
||||
let orgElement = orgNode.getElementsByTagNameNS(kNS_GD, "orgName")[0];
|
||||
let titleElement = orgNode.getElementsByTagNameNS(kNS_GD, "orgTitle")[0];
|
||||
contact.org.push(orgElement ? orgElement.textContent : "")
|
||||
contact.org.push(orgElement ? orgElement.textContent : "");
|
||||
contact.jobTitle.push(titleElement ? titleElement.textContent : "");
|
||||
}
|
||||
}
|
||||
|
@ -53,8 +53,9 @@ CallProgressSocket.prototype = {
|
||||
*/
|
||||
connect: function(onSuccess, onError) {
|
||||
this._onSuccess = onSuccess;
|
||||
this._onError = onError ||
|
||||
(reason => {MozLoopService.log.warn("LoopCalls::callProgessSocket - ", reason);});
|
||||
this._onError = onError || (reason => {
|
||||
MozLoopService.log.warn("LoopCalls::callProgessSocket - ", reason);
|
||||
});
|
||||
|
||||
if (!onSuccess) {
|
||||
this._onError("missing onSuccess argument");
|
||||
@ -237,7 +238,7 @@ let LoopCallsInternal = {
|
||||
|
||||
_getCalls: function(sessionType, version) {
|
||||
return MozLoopService.hawkRequest(sessionType, "/calls?version=" + version, "GET").then(
|
||||
response => {this._processCalls(response, sessionType);}
|
||||
response => { this._processCalls(response, sessionType); }
|
||||
);
|
||||
},
|
||||
|
||||
@ -309,7 +310,7 @@ let LoopCallsInternal = {
|
||||
}
|
||||
|
||||
openChat();
|
||||
})
|
||||
});
|
||||
} else {
|
||||
openChat();
|
||||
}
|
||||
@ -397,7 +398,7 @@ let LoopCallsInternal = {
|
||||
}
|
||||
// This instance of CallProgressSocket should stay alive until the underlying
|
||||
// websocket is closed since it is passed to the websocket as the nsIWebSocketListener.
|
||||
callProgress.connect(() => {callProgress.sendBusy();});
|
||||
callProgress.connect(() => { callProgress.sendBusy(); });
|
||||
}
|
||||
};
|
||||
Object.freeze(LoopCallsInternal);
|
||||
|
@ -288,7 +288,7 @@ const batch = function(operation, data, callback) {
|
||||
}
|
||||
callback(null, processed);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Extend a `target` object with the properties defined in `source`.
|
||||
|
@ -20,7 +20,7 @@ XPCOMUtils.defineLazyGetter(this, "gLoopBundle", function() {
|
||||
return Services.strings.createBundle('chrome://browser/locale/loop/loop.properties');
|
||||
});
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "loopUtils",
|
||||
"resource:///modules/loop/utils.js", "utils")
|
||||
"resource:///modules/loop/utils.js", "utils");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "loopCrypto",
|
||||
"resource:///modules/loop/crypto.js", "LoopCrypto");
|
||||
|
||||
@ -341,7 +341,7 @@ let LoopRoomsInternal = {
|
||||
// Do what we can to save the room data.
|
||||
room.decryptedContext = {};
|
||||
this.saveAndNotifyUpdate(room, isUpdate);
|
||||
};
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
|
@ -10,7 +10,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
const {MozLoopService} = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
|
||||
const { MozLoopService } = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
|
||||
const consoleLog = MozLoopService.log;
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["MozLoopPushHandler"];
|
||||
@ -296,7 +296,7 @@ PingMonitor.prototype = {
|
||||
restart: function () {
|
||||
consoleLog.info("PushHandler: ping timeout restart");
|
||||
this.stop();
|
||||
this._pingTimerID = setTimeout(() => {this._pingSend()}, this._pingInterval);
|
||||
this._pingTimerID = setTimeout(() => { this._pingSend(); }, this._pingInterval);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -503,7 +503,7 @@ let MozLoopPushHandler = {
|
||||
this._channelsToRegister.push(channelID);
|
||||
this._registerChannels();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Un-register a notification channel.
|
||||
*
|
||||
@ -771,14 +771,14 @@ let MozLoopPushHandler = {
|
||||
(aMsg) => this._onMsg(aMsg),
|
||||
() => this._onStart(),
|
||||
(aCode, aReason) => this._onClose(aCode, aReason));
|
||||
}
|
||||
};
|
||||
|
||||
let pushServerURLFetchError = () => {
|
||||
consoleLog.warn("PushHandler: Could not retrieve push server URL from Loop server, will retry");
|
||||
this._pushSocket = undefined;
|
||||
this._retryManager.retry(() => this._openSocket());
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
this.pushServerUri = Services.prefs.getCharPref("loop.debug.pushserver");
|
||||
@ -871,4 +871,4 @@ let MozLoopPushHandler = {
|
||||
channelID: channelID});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
@ -64,7 +64,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "injectLoopAPI",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "convertToRTCStatsReport",
|
||||
"resource://gre/modules/media/RTCStatsReport.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "loopUtils",
|
||||
"resource:///modules/loop/utils.js", "utils")
|
||||
"resource:///modules/loop/utils.js", "utils");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "loopCrypto",
|
||||
"resource:///modules/loop/crypto.js", "LoopCrypto");
|
||||
|
||||
@ -170,12 +170,12 @@ let MozLoopServiceInternal = {
|
||||
deferredRegistrations: new Map(),
|
||||
|
||||
get pushHandler() {
|
||||
return this.mocks.pushHandler || MozLoopPushHandler
|
||||
return this.mocks.pushHandler || MozLoopPushHandler;
|
||||
},
|
||||
|
||||
// The uri of the Loop server.
|
||||
get loopServerUri() {
|
||||
return Services.prefs.getCharPref("loop.server")
|
||||
return Services.prefs.getCharPref("loop.server");
|
||||
},
|
||||
|
||||
/**
|
||||
@ -365,7 +365,7 @@ let MozLoopServiceInternal = {
|
||||
} else {
|
||||
resolve(this.registerWithLoopServer(sessionType, serviceType, pushURL));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.pushHandler.register(channelID, onRegistered, onNotification);
|
||||
});
|
||||
@ -443,7 +443,7 @@ let MozLoopServiceInternal = {
|
||||
|
||||
// Create a blank URL record set if none exists for this sessionType.
|
||||
if (!pushURLs) {
|
||||
pushURLs = {calls: undefined, rooms: undefined};
|
||||
pushURLs = { calls: undefined, rooms: undefined };
|
||||
this.pushURLs.set(sessionType, pushURLs);
|
||||
}
|
||||
|
||||
@ -456,7 +456,7 @@ let MozLoopServiceInternal = {
|
||||
newURLs[serviceType] = pushURL;
|
||||
|
||||
return this.hawkRequestInternal(sessionType, "/registration", "POST",
|
||||
{simplePushURLs: newURLs}).then(
|
||||
{ simplePushURLs: newURLs }).then(
|
||||
(response) => {
|
||||
// If this failed we got an invalid token.
|
||||
if (!this.storeSessionToken(sessionType, response.headers)) {
|
||||
@ -533,7 +533,7 @@ let MozLoopServiceInternal = {
|
||||
log.error("Failed to unregister with the loop server. Error: ", error);
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return Promise.all([unregister(sessionType, callsPushURL), unregister(sessionType, roomsPushURL)]);
|
||||
},
|
||||
@ -584,7 +584,7 @@ let MozLoopServiceInternal = {
|
||||
} else {
|
||||
newPayloadObj[property] = payloadObj[property];
|
||||
}
|
||||
};
|
||||
}
|
||||
payloadObj = newPayloadObj;
|
||||
}
|
||||
|
||||
@ -804,7 +804,7 @@ let MozLoopServiceInternal = {
|
||||
log.info(e.data.ok ?
|
||||
"Successfully staged loop report for telemetry upload." :
|
||||
("Failed to stage loop report. Error: " + e.data.fail));
|
||||
}
|
||||
};
|
||||
worker.postMessage(job);
|
||||
});
|
||||
}, pc.id);
|
||||
@ -942,7 +942,7 @@ let MozLoopServiceInternal = {
|
||||
|
||||
return JSON.parse(response.body);
|
||||
},
|
||||
error => {this._hawkRequestError(error);});
|
||||
error => { this._hawkRequestError(error); });
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1025,7 +1025,7 @@ let MozLoopServiceInternal = {
|
||||
return this.hawkRequestInternal(LOOP_SESSION_TYPE.FXA, "/fxa-oauth/token", "POST", payload).then(response => {
|
||||
return JSON.parse(response.body);
|
||||
},
|
||||
error => {this._hawkRequestError(error);});
|
||||
error => { this._hawkRequestError(error); });
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1689,7 +1689,7 @@ this.MozLoopService = {
|
||||
*/
|
||||
hawkRequest: function(sessionType, path, method, payloadObj) {
|
||||
return MozLoopServiceInternal.hawkRequest(sessionType, path, method, payloadObj).catch(
|
||||
error => {MozLoopServiceInternal._hawkRequestError(error);});
|
||||
error => { MozLoopServiceInternal._hawkRequestError(error); });
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -58,7 +58,7 @@ loop.standaloneMedia = (function() {
|
||||
if (typeof cb == "function") {
|
||||
cb(param);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
function handleSuccess(localStream) {
|
||||
this.userMedia.pending = false;
|
||||
@ -134,7 +134,7 @@ loop.standaloneMedia = (function() {
|
||||
// This function is needed to pull in the instance
|
||||
// of the singleton for tests to overwrite the used instance.
|
||||
singletonMultiplexGum.getPermsAndCacheMedia.apply(singletonMultiplexGum, arguments);
|
||||
};
|
||||
}
|
||||
patchSymbolIfExtant("navigator", "mozGetUserMedia", myGetUserMedia);
|
||||
patchSymbolIfExtant("navigator", "webkitGetUserMedia", myGetUserMedia);
|
||||
patchSymbolIfExtant("navigator", "getUserMedia", myGetUserMedia);
|
||||
|
@ -36,7 +36,7 @@ loop.store.StandaloneMetricsStore = (function() {
|
||||
pageLoad: "page load messages",
|
||||
success: "success",
|
||||
support: "support link click"
|
||||
}
|
||||
};
|
||||
|
||||
var StandaloneMetricsStore = loop.store.createStore({
|
||||
actions: [
|
||||
@ -132,7 +132,7 @@ loop.store.StandaloneMetricsStore = (function() {
|
||||
*/
|
||||
mediaConnected: function() {
|
||||
this._storeEvent(METRICS_GA_CATEGORY.general, METRICS_GA_ACTIONS.success,
|
||||
"Media connected")
|
||||
"Media connected");
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -215,7 +215,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
if (event.target && event.target.href) {
|
||||
this.props.dispatcher.dispatch(new sharedActions.RecordClick({
|
||||
linkInfo: event.target.href
|
||||
}))
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
@ -288,7 +288,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
getInitialState: function() {
|
||||
return {
|
||||
failureLogged: false
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
_logFailure: function(message) {
|
||||
|
@ -215,7 +215,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
if (event.target && event.target.href) {
|
||||
this.props.dispatcher.dispatch(new sharedActions.RecordClick({
|
||||
linkInfo: event.target.href
|
||||
}))
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
@ -288,7 +288,7 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||
getInitialState: function() {
|
||||
return {
|
||||
failureLogged: false
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
_logFailure: function(message) {
|
||||
|
@ -680,6 +680,6 @@ describe("loop.roomViews", function () {
|
||||
React.addons.TestUtils.Simulate.click(closeBtn);
|
||||
expect(view.getDOMNode()).to.eql(null);
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -9,7 +9,7 @@ const kAuth = {
|
||||
"method": "basic",
|
||||
"user": "username",
|
||||
"password": "p455w0rd"
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// "pid" for "provider ID"
|
||||
@ -166,7 +166,7 @@ const monkeyPatchImporter = function(importer) {
|
||||
});
|
||||
}.bind(importer);
|
||||
return importer;
|
||||
}
|
||||
};
|
||||
|
||||
add_task(function* test_CardDavImport() {
|
||||
let importer = monkeyPatchImporter(new CardDavImporter());
|
||||
@ -323,4 +323,4 @@ add_task(function* test_CardDavImport() {
|
||||
}, (err, result) => { err ? resolve(err) : reject(new Error("Should have failed")); }, mockDb);
|
||||
});
|
||||
Assert.equal(error.message, "No authentication specified", "Missing parameters should generate error");
|
||||
})
|
||||
});
|
||||
|
@ -106,7 +106,7 @@ const normalizeContact = function(contact) {
|
||||
// Get a copy of contact without private properties.
|
||||
for (let prop of Object.getOwnPropertyNames(contact)) {
|
||||
if (!prop.startsWith("_")) {
|
||||
result[prop] = contact[prop]
|
||||
result[prop] = contact[prop];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -189,7 +189,7 @@ add_task(function* () {
|
||||
Assert.ok(!err, "There shouldn't be an error");
|
||||
Assert.equal(found.length, 0, "There shouldn't be any contacts left");
|
||||
resolve();
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -33,7 +33,7 @@ function promiseWindowIdReceivedOnAdd(handler) {
|
||||
handler.resolve = resolve;
|
||||
gMozLoopAPI.addBrowserSharingListener(handler.listener);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
let createdTabs = [];
|
||||
|
||||
@ -52,7 +52,7 @@ function promiseWindowIdReceivedNewTab(handlers = []) {
|
||||
promiseHandlers.push(promiseTabLoadEvent(createdTab, "about:mozilla"));
|
||||
|
||||
return Promise.all(promiseHandlers);
|
||||
};
|
||||
}
|
||||
|
||||
function promiseRemoveTab(tab) {
|
||||
return new Promise(resolve => {
|
||||
@ -170,7 +170,7 @@ add_task(function* test_infoBar() {
|
||||
"The popup should be opening anchored to the dropmarker");
|
||||
Assert.strictEqual(button.getElementsByTagNameNS(kNSXUL, "menupopup").length, 1,
|
||||
"There should be a popup attached to the button");
|
||||
}
|
||||
};
|
||||
|
||||
testBarProps();
|
||||
|
||||
|
@ -19,9 +19,9 @@ describe("loop.OTSdkDriver", function () {
|
||||
beforeEach(function() {
|
||||
sandbox = sinon.sandbox.create();
|
||||
|
||||
fakeLocalElement = {fake: 1};
|
||||
fakeRemoteElement = {fake: 2};
|
||||
fakeScreenElement = {fake: 3};
|
||||
fakeLocalElement = { fake: 1 };
|
||||
fakeRemoteElement = { fake: 2 };
|
||||
fakeScreenElement = { fake: 3 };
|
||||
fakeEvent = {
|
||||
preventDefault: sinon.stub()
|
||||
};
|
||||
@ -98,7 +98,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
describe("Constructor", function() {
|
||||
it("should throw an error if the dispatcher is missing", function() {
|
||||
expect(function() {
|
||||
new loop.OTSdkDriver({sdk: sdk});
|
||||
new loop.OTSdkDriver({ sdk: sdk });
|
||||
}).to.Throw(/dispatcher/);
|
||||
});
|
||||
|
||||
@ -112,8 +112,8 @@ describe("loop.OTSdkDriver", function () {
|
||||
describe("#setupStreamElements", function() {
|
||||
it("should call initPublisher", function() {
|
||||
driver.setupStreamElements(new sharedActions.SetupStreamElements({
|
||||
getLocalElementFunc: function() {return fakeLocalElement;},
|
||||
getRemoteElementFunc: function() {return fakeRemoteElement;},
|
||||
getLocalElementFunc: function() { return fakeLocalElement; },
|
||||
getRemoteElementFunc: function() { return fakeRemoteElement; },
|
||||
publisherConfig: publisherConfig
|
||||
}));
|
||||
|
||||
@ -127,8 +127,8 @@ describe("loop.OTSdkDriver", function () {
|
||||
sdk.initPublisher.returns(publisher);
|
||||
|
||||
driver.setupStreamElements(new sharedActions.SetupStreamElements({
|
||||
getLocalElementFunc: function() {return fakeLocalElement;},
|
||||
getRemoteElementFunc: function() {return fakeRemoteElement;},
|
||||
getLocalElementFunc: function() { return fakeLocalElement; },
|
||||
getRemoteElementFunc: function() { return fakeRemoteElement; },
|
||||
publisherConfig: publisherConfig
|
||||
}));
|
||||
});
|
||||
@ -158,8 +158,8 @@ describe("loop.OTSdkDriver", function () {
|
||||
sdk.initPublisher.returns(publisher);
|
||||
|
||||
driver.setupStreamElements(new sharedActions.SetupStreamElements({
|
||||
getLocalElementFunc: function() {return fakeLocalElement;},
|
||||
getRemoteElementFunc: function() {return fakeRemoteElement;},
|
||||
getLocalElementFunc: function() { return fakeLocalElement; },
|
||||
getRemoteElementFunc: function() { return fakeRemoteElement; },
|
||||
publisherConfig: publisherConfig
|
||||
}));
|
||||
});
|
||||
@ -604,9 +604,9 @@ describe("loop.OTSdkDriver", function () {
|
||||
driver.connectSession(sessionData);
|
||||
|
||||
driver.setupStreamElements(new sharedActions.SetupStreamElements({
|
||||
getLocalElementFunc: function() {return fakeLocalElement;},
|
||||
getScreenShareElementFunc: function() {return fakeScreenElement;},
|
||||
getRemoteElementFunc: function() {return fakeRemoteElement;},
|
||||
getLocalElementFunc: function() {return fakeLocalElement; },
|
||||
getScreenShareElementFunc: function() {return fakeScreenElement; },
|
||||
getRemoteElementFunc: function() {return fakeRemoteElement; },
|
||||
publisherConfig: publisherConfig
|
||||
}));
|
||||
});
|
||||
@ -732,7 +732,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
});
|
||||
|
||||
it("should dispatch a VideoDimensionsChanged action", function() {
|
||||
publisher.trigger("streamCreated", {stream: fakeStream});
|
||||
publisher.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
@ -773,21 +773,21 @@ describe("loop.OTSdkDriver", function () {
|
||||
});
|
||||
|
||||
it("should dispatch a VideoDimensionsChanged action", function() {
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.VideoDimensionsChanged({
|
||||
isLocal: false,
|
||||
videoType: "camera",
|
||||
dimensions: {width: 1, height: 2}
|
||||
dimensions: { width: 1, height: 2 }
|
||||
}));
|
||||
});
|
||||
|
||||
it("should dispatch a ConnectionStatus action", function() {
|
||||
driver._metrics.connections = 1;
|
||||
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
@ -801,7 +801,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
});
|
||||
|
||||
it("should subscribe to a camera stream", function() {
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
sinon.assert.calledOnce(session.subscribe);
|
||||
sinon.assert.calledWithExactly(session.subscribe,
|
||||
@ -811,7 +811,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
it("should subscribe to a screen sharing stream", function() {
|
||||
fakeStream.videoType = "screen";
|
||||
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
sinon.assert.calledOnce(session.subscribe);
|
||||
sinon.assert.calledWithExactly(session.subscribe,
|
||||
@ -821,7 +821,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
it("should dispatch a mediaConnected action if both streams are up", function() {
|
||||
driver._publishedLocalStream = true;
|
||||
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
// Called twice due to the VideoDimensionsChanged above.
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
@ -836,19 +836,19 @@ describe("loop.OTSdkDriver", function () {
|
||||
var startTime = 1;
|
||||
sandbox.stub(performance, "now").returns(startTime);
|
||||
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
expect(driver._getTwoWayMediaStartTime()).to.eql(startTime);
|
||||
});
|
||||
|
||||
it("should not store the start time when both streams are up and" +
|
||||
" driver._isDesktop is false", function() {
|
||||
driver._isDesktop = false ;
|
||||
driver._isDesktop = false;
|
||||
driver._publishedLocalStream = true;
|
||||
var startTime = 73;
|
||||
sandbox.stub(performance, "now").returns(startTime);
|
||||
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
expect(driver._getTwoWayMediaStartTime()).to.not.eql(startTime);
|
||||
});
|
||||
@ -859,7 +859,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
driver._publishedLocalStream = true;
|
||||
fakeStream.videoType = "screen";
|
||||
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
sinon.assert.neverCalledWithMatch(dispatcher.dispatch,
|
||||
sinon.match.hasOwn("name", "mediaConnected"));
|
||||
@ -877,12 +877,12 @@ describe("loop.OTSdkDriver", function () {
|
||||
function() {
|
||||
fakeStream.videoType = "screen";
|
||||
|
||||
session.trigger("streamCreated", {stream: fakeStream});
|
||||
session.trigger("streamCreated", { stream: fakeStream });
|
||||
|
||||
// Called twice due to the VideoDimensionsChanged above.
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
new sharedActions.ReceivingScreenShare({receiving: true}));
|
||||
new sharedActions.ReceivingScreenShare({ receiving: true }));
|
||||
});
|
||||
});
|
||||
|
||||
@ -916,7 +916,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
});
|
||||
|
||||
it("should dispatch a ReceivingScreenShare action", function() {
|
||||
session.trigger("streamDestroyed", {stream: fakeStream});
|
||||
session.trigger("streamDestroyed", { stream: fakeStream });
|
||||
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
sinon.assert.calledWithExactly(dispatcher.dispatch,
|
||||
@ -946,7 +946,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
it("should not dispatch an action if the videoType is camera", function() {
|
||||
fakeStream.videoType = "camera";
|
||||
|
||||
session.trigger("streamDestroyed", {stream: fakeStream});
|
||||
session.trigger("streamDestroyed", { stream: fakeStream });
|
||||
|
||||
sinon.assert.neverCalledWithMatch(dispatcher.dispatch,
|
||||
sinon.match.hasOwn("name", "receivingScreenShare"));
|
||||
@ -1001,7 +1001,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
it("should dispatch a RemotePeerConnected action if this is for a remote user",
|
||||
function() {
|
||||
session.trigger("connectionCreated", {
|
||||
connection: {id: "remoteUser"}
|
||||
connection: { id: "remoteUser" }
|
||||
});
|
||||
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
@ -1011,7 +1011,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
|
||||
it("should store the connection details for a remote user", function() {
|
||||
session.trigger("connectionCreated", {
|
||||
connection: {id: "remoteUser"}
|
||||
connection: { id: "remoteUser" }
|
||||
});
|
||||
|
||||
expect(driver.connections).to.include.keys("remoteUser");
|
||||
@ -1022,7 +1022,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
driver._metrics.sendStreams = 1;
|
||||
|
||||
session.trigger("connectionCreated", {
|
||||
connection: {id: "remoteUser"}
|
||||
connection: { id: "remoteUser" }
|
||||
});
|
||||
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
@ -1039,7 +1039,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
it("should not dispatch an RemotePeerConnected action if this is for a local user",
|
||||
function() {
|
||||
session.trigger("connectionCreated", {
|
||||
connection: {id: "localUser"}
|
||||
connection: { id: "localUser" }
|
||||
});
|
||||
|
||||
sinon.assert.neverCalledWithMatch(dispatcher.dispatch,
|
||||
@ -1048,7 +1048,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
|
||||
it("should not store the connection details for a local user", function() {
|
||||
session.trigger("connectionCreated", {
|
||||
connection: {id: "localUser"}
|
||||
connection: { id: "localUser" }
|
||||
});
|
||||
|
||||
expect(driver.connections).to.not.include.keys("localUser");
|
||||
@ -1059,7 +1059,7 @@ describe("loop.OTSdkDriver", function () {
|
||||
driver._metrics.sendStreams = 0;
|
||||
|
||||
session.trigger("connectionCreated", {
|
||||
connection: {id: "localUser"}
|
||||
connection: { id: "localUser" }
|
||||
});
|
||||
|
||||
sinon.assert.called(dispatcher.dispatch);
|
||||
|
@ -92,7 +92,7 @@ describe("loop.store.StandaloneMetricsStore", function() {
|
||||
sinon.assert.calledWithExactly(window.ga,
|
||||
"send", "event", METRICS_GA_CATEGORY.general, METRICS_GA_ACTIONS.linkClick,
|
||||
"fake");
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
describe("Store Change Handlers", function() {
|
||||
|
@ -249,7 +249,7 @@ describe("loop.standaloneRoomViews", function() {
|
||||
local: {},
|
||||
remote: {}
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
describe("#publishStream", function() {
|
||||
|
@ -94,7 +94,7 @@ describe("loop.StandaloneClient", function() {
|
||||
sinon.assert.calledWithExactly(console.error, "Server error",
|
||||
"HTTP 404 Not Found", serverResponse);
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@ let mockPushHandler = {
|
||||
* enables us to check parameters and return messages similar to the push
|
||||
* server.
|
||||
*/
|
||||
function MockWebSocketChannel() {};
|
||||
function MockWebSocketChannel() {}
|
||||
|
||||
MockWebSocketChannel.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI(Ci.nsIWebSocketChannel),
|
||||
|
@ -33,7 +33,7 @@ function generateSessionTypeVerificationStub(desiredSessionType) {
|
||||
|
||||
resolve();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return hawkRequestStub;
|
||||
}
|
||||
|
@ -130,10 +130,10 @@ add_test(function test_ping_websocket() {
|
||||
mockWebSocket.defaultMsgHandler = (msg) => {
|
||||
pingReceived = true;
|
||||
// Do not send a ping response.
|
||||
}
|
||||
};
|
||||
mockWebSocket.close = () => {
|
||||
socketClosed = true;
|
||||
}
|
||||
};
|
||||
|
||||
MozLoopPushHandler.shutdown();
|
||||
MozLoopPushHandler.initialize({mockWebSocket: mockWebSocket});
|
||||
@ -220,4 +220,4 @@ function run_test() {
|
||||
});
|
||||
|
||||
run_next_test();
|
||||
};
|
||||
}
|
||||
|
@ -120,4 +120,4 @@ function run_test() {
|
||||
});
|
||||
|
||||
run_next_test();
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user