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:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,34 @@
/* global DOMEventSource */
'use strict';
/**
* To test if DOMEventSource can really register the events and forward to
* the target handler.
**/
requireApp('system/lockscreen/js/source/source_event.js');
requireApp('system/lockscreen/js/source/dom_event_source.js');
suite('DOMEventSource > ', function() {
test(`DOMEventSource would forward events from native event listener`,
function() {
var stubForwardTo = this.sinon.stub();
var stubAddEventListener =
this.sinon.stub(window, 'addEventListener');
var stubRemoveEventListener =
this.sinon.stub(window, 'removeEventListener');
var source = new DOMEventSource({
events: ['foo']
});
source.start(stubForwardTo);
assert.isTrue(stubAddEventListener.called);
source.onchange(new CustomEvent('foo'));
source.onchange(new CustomEvent('foo'));
assert.isTrue(stubForwardTo.calledTwice);
source.stop();
assert.isTrue(stubRemoveEventListener.called);
source.onchange(new CustomEvent('foo'));
assert.isFalse(stubForwardTo.calledThrice);
});
});

View file

@ -0,0 +1,36 @@
/* global MinuteClockSource */
'use strict';
/**
* To test if MinuteClockSource can really register the events and forward to
* the target handler.
**/
requireApp('system/lockscreen/js/source/source_event.js');
requireApp('system/lockscreen/js/source/minute_clock_source.js');
suite('MinuteClockSource > ', function() {
test(`MinuteClockSource is a source fire the event every [interval]`,
function() {
var clock = sinon.useFakeTimers();
var stubForwardTo = sinon.stub();
var source = new MinuteClockSource({
type: 'dummy-ticking'
});
// Fake clock would stub the clock and make it as at the second 0
// of this minute, so it would wait 60 seconds to set the timeout.
source.start(stubForwardTo);
clock.tick(100);
assert.isTrue(stubForwardTo.calledOnce,
`it doesn't wait 0 seconds to start ticking`);
clock.tick(60000);
assert.isTrue(stubForwardTo.calledTwice,
`it doesn't tick after the #1 minute`);
clock.tick(59000);
assert.isFalse(stubForwardTo.calledThrice,
`it ticks too more times before the #2 minute`);
clock.tick(1000);
assert.isTrue(stubForwardTo.calledThrice,
`it doesn't tick 3 times after the #2 minute`);
});
});