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
61
gaia/shared/test/unit/mocks/mock_moz_intl.js
Executable file
61
gaia/shared/test/unit/mocks/mock_moz_intl.js
Executable file
|
|
@ -0,0 +1,61 @@
|
|||
(function(global) {
|
||||
'use strict';
|
||||
|
||||
global.MockMozIntl = {
|
||||
formatList: function(list) {
|
||||
return Promise.resolve(list.join(', '));
|
||||
},
|
||||
DateTimeFormat: function(locales, options) {
|
||||
var formatter = Intl.DateTimeFormat(locales, options);
|
||||
return {
|
||||
// we need this because mozIntl options extend Intl options
|
||||
resolvedOptions() { return options; },
|
||||
format: formatter.format.bind(formatter)
|
||||
};
|
||||
},
|
||||
calendarInfo: function(token) {
|
||||
return Promise.resolve(0);
|
||||
},
|
||||
DurationFormat: function(locales, options) {
|
||||
return Promise.resolve({
|
||||
format: function(input) {
|
||||
return JSON.stringify({ value: input, options: options });
|
||||
}
|
||||
});
|
||||
},
|
||||
RelativeTimeFormat: function(locales, options) {
|
||||
return {
|
||||
format: function(value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
},
|
||||
UnitFormat: function(locales, options) {
|
||||
return {
|
||||
format: function(value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
},
|
||||
_gaia: {
|
||||
relativePart: function(ms) {
|
||||
return {
|
||||
unit: 'minutes',
|
||||
value: Math.abs(parseInt(ms / 1000 / 60))
|
||||
};
|
||||
},
|
||||
RelativeDate: function(locales, options) {
|
||||
return {
|
||||
format: function(value) {
|
||||
return Promise.resolve('pretty date');
|
||||
},
|
||||
formatElement: function(element, time, maxDiff) {}
|
||||
};
|
||||
},
|
||||
getFormattedUnit(type, style, v) {
|
||||
return Promise.resolve();
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
}(this));
|
||||
Loading…
Reference in a new issue