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
30
gaia/apps/settings/test/unit/mock_test_panel.js
Executable file
30
gaia/apps/settings/test/unit/mock_test_panel.js
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
/* global define */
|
||||
define(function() {
|
||||
'use strict';
|
||||
|
||||
var _mInnerFunction = null;
|
||||
var ctor = function mock_panel_module() {
|
||||
if (_mInnerFunction) {
|
||||
return _mInnerFunction.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
// As this module is simply a function, we are not able to mock the function
|
||||
// in our tests after the module loaded. mInnerFunction provides a way that
|
||||
// allows one loads the module be able to mock the behavior of the function.
|
||||
Object.defineProperty(ctor, 'mInnerFunction', {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
return _mInnerFunction;
|
||||
},
|
||||
set: function(value) {
|
||||
_mInnerFunction = value;
|
||||
}
|
||||
});
|
||||
|
||||
ctor.mTeardown = function mock_panel_module_teardown() {
|
||||
ctor._mInnerFunction = null;
|
||||
};
|
||||
|
||||
return ctor;
|
||||
});
|
||||
Loading…
Reference in a new issue