mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 998271 - L10n notifications, r=dmose
This commit is contained in:
parent
f5b358c5bb
commit
b148744fb0
@ -100,7 +100,7 @@ loop.conversation = (function(OT, mozL10n) {
|
||||
if (!this._conversation.isSessionReady()) {
|
||||
console.error("Error: navigated to conversation route without " +
|
||||
"the start route to initialise the call first");
|
||||
this._notifier.error(__("cannot_start_call_session_not_ready"));
|
||||
this._notifier.errorL10n("cannot_start_call_session_not_ready");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -43,10 +43,7 @@ loop.panel = (function(mozL10n) {
|
||||
var nickname = this.$("input[name=caller]").val();
|
||||
var callback = function(err, callUrl) {
|
||||
if (err) {
|
||||
this.notifier.notify({
|
||||
message: __("unable_retrieve_url"),
|
||||
level: "error"
|
||||
});
|
||||
this.notifier.errorL10n("unable_retrieve_url");
|
||||
return;
|
||||
}
|
||||
this.onCallUrlReceived(callUrl);
|
||||
|
@ -18,7 +18,9 @@ describe("loop.conversation", function() {
|
||||
notifier = {
|
||||
notify: sandbox.spy(),
|
||||
warn: sandbox.spy(),
|
||||
error: sandbox.spy()
|
||||
warnL10n: sandbox.spy(),
|
||||
error: sandbox.spy(),
|
||||
errorL10n: sandbox.spy()
|
||||
};
|
||||
});
|
||||
|
||||
@ -73,9 +75,8 @@ describe("loop.conversation", function() {
|
||||
router.conversation();
|
||||
|
||||
sinon.assert.calledOnce(router.loadView);
|
||||
sinon.assert.calledWith(router.loadView, sinon.match(function(obj) {
|
||||
return obj instanceof loop.shared.views.ConversationView;
|
||||
}));
|
||||
sinon.assert.calledWith(router.loadView,
|
||||
sinon.match.instanceOf(loop.shared.views.ConversationView));
|
||||
});
|
||||
|
||||
it("should not load the ConversationView if session is not set",
|
||||
@ -89,7 +90,9 @@ describe("loop.conversation", function() {
|
||||
function() {
|
||||
router.conversation();
|
||||
|
||||
sinon.assert.calledOnce(router._notifier.error);
|
||||
sinon.assert.calledOnce(router._notifier.errorL10n);
|
||||
sinon.assert.calledWithExactly(router._notifier.errorL10n,
|
||||
"cannot_start_call_session_not_ready");
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -67,12 +67,13 @@ describe("loop.panel", function() {
|
||||
cb("fake error");
|
||||
});
|
||||
var view = new loop.panel.PanelView();
|
||||
sandbox.stub(view.notifier, "notify");
|
||||
sandbox.stub(view.notifier, "errorL10n");
|
||||
|
||||
view.getCallUrl({preventDefault: sandbox.spy()});
|
||||
|
||||
sinon.assert.calledOnce(view.notifier.notify);
|
||||
sinon.assert.calledWithMatch(view.notifier.notify, {level: "error"});
|
||||
sinon.assert.calledOnce(view.notifier.errorL10n);
|
||||
sinon.assert.calledWithExactly(view.notifier.errorL10n,
|
||||
"unable_retrieve_url");
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user