зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1227885 - Improve stubbing of audio requests to avoid intermittent console warnings and also improve caught errors output. r=mikedeboer
This commit is contained in:
Родитель
dcaa895094
Коммит
9eb59dcd53
|
@ -258,7 +258,11 @@ var LoopMochaUtils = (function(global, _) {
|
|||
};
|
||||
console.error = function() {
|
||||
var args = Array.slice(arguments);
|
||||
gCaughtIssues.push(args);
|
||||
try {
|
||||
throw new Error();
|
||||
} catch (e) {
|
||||
gCaughtIssues.push([args, e.stack]);
|
||||
}
|
||||
consoleError.apply(console, args);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ describe("loop.standaloneRoomViews", function() {
|
|||
var clock, fakeWindow, view;
|
||||
|
||||
beforeEach(function() {
|
||||
sandbox = sinon.sandbox.create();
|
||||
sandbox = LoopMochaUtils.createSandbox();
|
||||
dispatcher = new loop.Dispatcher();
|
||||
dispatch = sandbox.stub(dispatcher, "dispatch");
|
||||
activeRoomStore = new loop.store.ActiveRoomStore(dispatcher, {
|
||||
|
@ -59,6 +59,11 @@ describe("loop.standaloneRoomViews", function() {
|
|||
|
||||
// Prevents audio request errors in the test console.
|
||||
sandbox.useFakeXMLHttpRequest();
|
||||
sandbox.stub(sharedUtils, "isDesktop").returns(true);
|
||||
LoopMochaUtils.stubLoopRequest({
|
||||
GetDoNotDisturb: sinon.stub().returns(true),
|
||||
GetLoopPref: sinon.stub()
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче