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
43
gaia/apps/system/test/unit/scheduler_test.js
Executable file
43
gaia/apps/system/test/unit/scheduler_test.js
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
/* global BaseModule */
|
||||
'use strict';
|
||||
|
||||
requireApp('system/js/service.js');
|
||||
requireApp('system/js/base_module.js');
|
||||
requireApp('system/js/scheduler.js');
|
||||
|
||||
suite('system/scheduler', function() {
|
||||
var subject;
|
||||
|
||||
setup(function() {
|
||||
subject = BaseModule.instantiate('Scheduler');
|
||||
subject.start();
|
||||
});
|
||||
|
||||
teardown(function() {
|
||||
subject.stop();
|
||||
});
|
||||
|
||||
test('Should hold the operations until released', function() {
|
||||
var spy1 = this.sinon.spy();
|
||||
var spy2 = this.sinon.spy();
|
||||
subject.schedule(spy1);
|
||||
subject.schedule(spy2);
|
||||
assert.isFalse(spy1.called);
|
||||
assert.isFalse(spy2.called);
|
||||
|
||||
subject.release();
|
||||
assert.isTrue(spy1.called);
|
||||
assert.isTrue(spy2.called);
|
||||
});
|
||||
|
||||
test('Should proceed the operations if it is not blocking now', function() {
|
||||
var spy1 = this.sinon.spy();
|
||||
var spy2 = this.sinon.spy();
|
||||
subject.release();
|
||||
subject.schedule(spy1);
|
||||
subject.schedule(spy2);
|
||||
|
||||
assert.isTrue(spy1.called);
|
||||
assert.isTrue(spy2.called);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue