mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1075509 - Standalone UI needs "call failed" sound. r=nperriault
This commit is contained in:
parent
3b0c878729
commit
83f3648184
BIN
browser/components/loop/content/shared/sounds/failure.ogg
Normal file
BIN
browser/components/loop/content/shared/sounds/failure.ogg
Normal file
Binary file not shown.
@ -264,7 +264,6 @@ loop.webapp = (function($, _, OT, mozL10n) {
|
||||
var PendingConversationView = React.createClass({displayName: 'PendingConversationView',
|
||||
mixins: [sharedMixins.AudioMixin],
|
||||
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
callState: "connecting"
|
||||
@ -571,6 +570,12 @@ loop.webapp = (function($, _, OT, mozL10n) {
|
||||
});
|
||||
|
||||
var FailedConversationView = React.createClass({displayName: 'FailedConversationView',
|
||||
mixins: [sharedMixins.AudioMixin],
|
||||
|
||||
componentDidMount: function() {
|
||||
this.play("failure");
|
||||
},
|
||||
|
||||
render: function() {
|
||||
document.title = mozL10n.get("standalone_title_with_status",
|
||||
{clientShortname: mozL10n.get("clientShortname2"),
|
||||
|
@ -264,7 +264,6 @@ loop.webapp = (function($, _, OT, mozL10n) {
|
||||
var PendingConversationView = React.createClass({
|
||||
mixins: [sharedMixins.AudioMixin],
|
||||
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
callState: "connecting"
|
||||
@ -571,6 +570,12 @@ loop.webapp = (function($, _, OT, mozL10n) {
|
||||
});
|
||||
|
||||
var FailedConversationView = React.createClass({
|
||||
mixins: [sharedMixins.AudioMixin],
|
||||
|
||||
componentDidMount: function() {
|
||||
this.play("failure");
|
||||
},
|
||||
|
||||
render: function() {
|
||||
document.title = mozL10n.get("standalone_title_with_status",
|
||||
{clientShortname: mozL10n.get("clientShortname2"),
|
||||
|
@ -501,6 +501,41 @@ describe("loop.webapp", function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("FailedConversationView", function() {
|
||||
var view, conversation, client, fakeAudio;
|
||||
|
||||
beforeEach(function() {
|
||||
fakeAudio = {
|
||||
play: sinon.spy(),
|
||||
pause: sinon.spy(),
|
||||
removeAttribute: sinon.spy()
|
||||
};
|
||||
sandbox.stub(window, "Audio").returns(fakeAudio);
|
||||
|
||||
client = new loop.StandaloneClient({
|
||||
baseServerUrl: "http://fake.example.com"
|
||||
});
|
||||
conversation = new sharedModels.ConversationModel({}, {
|
||||
sdk: {}
|
||||
});
|
||||
conversation.set("loopToken", "fakeToken");
|
||||
|
||||
view = React.addons.TestUtils.renderIntoDocument(
|
||||
loop.webapp.FailedConversationView({
|
||||
conversation: conversation,
|
||||
client: client,
|
||||
notifications: notifications
|
||||
}));
|
||||
});
|
||||
|
||||
it("should play a failure sound, once", function() {
|
||||
sinon.assert.calledOnce(window.Audio);
|
||||
sinon.assert.calledWithExactly(window.Audio,
|
||||
"shared/sounds/failure.ogg");
|
||||
expect(fakeAudio.loop).to.equal(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("WebappRootView", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user