mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
Bug 1075509 - Standalone UI needs "call failed" sound. r=nperriault
This commit is contained in:
parent
95e5eae8b8
commit
084803d02b
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