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
49
gaia/apps/system/test/unit/mock_modal_dialog.js
Executable file
49
gaia/apps/system/test/unit/mock_modal_dialog.js
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
'use strict';
|
||||
|
||||
var MockModalDialog = {
|
||||
|
||||
mMethods: [
|
||||
'alert', 'confirm'
|
||||
],
|
||||
|
||||
mPopulate: function mmd_mPopulate() {
|
||||
this.mMethods.forEach(function(methodName) {
|
||||
this[methodName] = function mmd_method() {
|
||||
this.mMethodCalled(methodName, Array.slice(arguments));
|
||||
};
|
||||
}, this);
|
||||
},
|
||||
|
||||
init: function mmd_init() {
|
||||
this.mMethods.forEach(function(methodName) {
|
||||
this[methodName].mWasCalled = false;
|
||||
this[methodName].mArgs = null;
|
||||
}, this);
|
||||
},
|
||||
|
||||
showWithPseudoEvent: function mmd_showWIthPseudoEvent(param) {
|
||||
if (typeof param.text === 'object' && param.text.raw) {
|
||||
param.text = param.text.raw;
|
||||
}
|
||||
if (this.mCallback) {
|
||||
this.mCallback(param);
|
||||
}
|
||||
},
|
||||
|
||||
mMethodCalled: function mmd_mMethodCalled(name, args) {
|
||||
this[name].mWasCalled = true;
|
||||
this[name].mArgs = args;
|
||||
},
|
||||
|
||||
mTeardown: function mmd_mTeardown() {
|
||||
delete this.mCallback;
|
||||
this.init();
|
||||
},
|
||||
|
||||
selectOne: function mmd_selectOne() {
|
||||
}
|
||||
};
|
||||
|
||||
MockModalDialog.mPopulate();
|
||||
|
||||
|
||||
Loading…
Reference in a new issue