Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
87
gaia/shared/test/unit/mocks/mock_audio.js
Executable file
87
gaia/shared/test/unit/mocks/mock_audio.js
Executable file
|
|
@ -0,0 +1,87 @@
|
|||
'use strict';
|
||||
|
||||
function MockAudio(src) {
|
||||
MockAudio.instances.push(this);
|
||||
this.src = src;
|
||||
this.readyState = 1;
|
||||
this.paused = true;
|
||||
}
|
||||
|
||||
MockAudio.instances = [];
|
||||
|
||||
MockAudio.mSetup = function() {
|
||||
MockAudio.instances = [];
|
||||
};
|
||||
|
||||
MockAudio.mTeardown = function() {
|
||||
MockAudio.instances = [];
|
||||
};
|
||||
|
||||
MockAudio.prototype.HAVE_NOTHING = 0;
|
||||
|
||||
MockAudio.prototype.load = function() {
|
||||
};
|
||||
|
||||
MockAudio.prototype.play = function() {
|
||||
// FIXME can we replace playing with paused?
|
||||
this.playing = true;
|
||||
this.paused = false;
|
||||
};
|
||||
|
||||
MockAudio.prototype.pause = function() {
|
||||
this.playing = false;
|
||||
this.paused = true;
|
||||
};
|
||||
|
||||
MockAudio.prototype.removeAttribute = function() {
|
||||
};
|
||||
|
||||
MockAudio.prototype.cloneNode = function() {
|
||||
return this;
|
||||
};
|
||||
|
||||
function MockAudioContext(channel) {
|
||||
MockAudioContext.instances.push(this);
|
||||
this.mozAudioChannelType = channel;
|
||||
this.currentTime = 0;
|
||||
this.sampleRate = 0;
|
||||
this.destination = {};
|
||||
}
|
||||
|
||||
MockAudioContext.instances = [];
|
||||
|
||||
MockAudioContext.mSetup = function() {
|
||||
MockAudioContext.instances = [];
|
||||
};
|
||||
|
||||
MockAudioContext.mTeardown = function() {
|
||||
MockAudioContext.instances = [];
|
||||
};
|
||||
|
||||
MockAudioContext.prototype.createBuffer = function() { return {}; };
|
||||
MockAudioContext.prototype.createBufferSource = function() {
|
||||
return {
|
||||
connect: function() {},
|
||||
start: function() {},
|
||||
stop: function() {}
|
||||
};
|
||||
};
|
||||
MockAudioContext.prototype.createGain = function() {
|
||||
return {
|
||||
connect() {},
|
||||
gain: {
|
||||
setValueAtTime() {},
|
||||
setValueCurveAtTime() {}
|
||||
}
|
||||
};
|
||||
};
|
||||
MockAudioContext.prototype.createOscillator = function() {
|
||||
return {
|
||||
frequency: { value: 0 },
|
||||
connect: function() {},
|
||||
start: function() {},
|
||||
stop: function() {}
|
||||
};
|
||||
};
|
||||
MockAudioContext.prototype.addEventListener = function() {};
|
||||
MockAudioContext.prototype.removeEventListener = function() {};
|
||||
Loading…
Reference in a new issue