|
1 | 1 | (function () {
|
| 2 | + /* jshint undef: true, unused: true */ |
| 3 | + /* globals QUnit, test, Rx, equal, ok */ |
| 4 | + |
2 | 5 | QUnit.module('HistoricalScheduler');
|
3 | 6 |
|
4 | 7 | var HistoricalScheduler = Rx.HistoricalScheduler;
|
|
47 | 50 |
|
48 | 51 | var list = [];
|
49 | 52 |
|
50 |
| - s.scheduleAbsolute(time(0), function () { list.push(new Timestamped(1, s.now())); }); |
51 |
| - s.scheduleAbsolute(time(1), function () { list.push(new Timestamped(2, s.now())); }); |
52 |
| - s.scheduleAbsolute(time(2), function () { s.stop(); }); |
53 |
| - s.scheduleAbsolute(time(3), function () { list.push(new Timestamped(3, s.now())); }); |
54 |
| - s.scheduleAbsolute(time(4), function () { s.stop(); }); |
55 |
| - s.scheduleAbsolute(time(5), function () { s.start(); }); |
56 |
| - s.scheduleAbsolute(time(6), function () { list.push(new Timestamped(4, s.now())); }); |
| 53 | + s.scheduleAbsolute(null, time(0), function () { list.push(new Timestamped(1, s.now())); }); |
| 54 | + s.scheduleAbsolute(null, time(1), function () { list.push(new Timestamped(2, s.now())); }); |
| 55 | + s.scheduleAbsolute(null, time(2), function () { s.stop(); }); |
| 56 | + s.scheduleAbsolute(null, time(3), function () { list.push(new Timestamped(3, s.now())); }); |
| 57 | + s.scheduleAbsolute(null, time(4), function () { s.stop(); }); |
| 58 | + s.scheduleAbsolute(null, time(5), function () { s.start(); }); |
| 59 | + s.scheduleAbsolute(null, time(6), function () { list.push(new Timestamped(4, s.now())); }); |
57 | 60 |
|
58 | 61 | s.start();
|
59 | 62 |
|
|
88 | 91 |
|
89 | 92 | var list = [];
|
90 | 93 |
|
91 |
| - s.scheduleAbsolute(time(2), function () { list.push(new Timestamped(2, s.now())); }); |
| 94 | + s.scheduleAbsolute(null, time(2), function () { list.push(new Timestamped(2, s.now())); }); |
92 | 95 |
|
93 |
| - s.scheduleAbsolute(time(3), function () { list.push(new Timestamped(3, s.now())); }); |
| 96 | + s.scheduleAbsolute(null, time(3), function () { list.push(new Timestamped(3, s.now())); }); |
94 | 97 |
|
95 |
| - s.scheduleAbsolute(time(1), function () { list.push(new Timestamped(0, s.now())); }); |
96 |
| - s.scheduleAbsolute(time(1), function () { list.push(new Timestamped(1, s.now())); }); |
| 98 | + s.scheduleAbsolute(null, time(1), function () { list.push(new Timestamped(0, s.now())); }); |
| 99 | + s.scheduleAbsolute(null, time(1), function () { list.push(new Timestamped(1, s.now())); }); |
97 | 100 |
|
98 | 101 | s.start();
|
99 | 102 |
|
|
110 | 113 |
|
111 | 114 | var list = [];
|
112 | 115 |
|
113 |
| - var d = s.scheduleAbsolute(time(2), function () { list.push(new Timestamped(2, s.now())); }); |
| 116 | + var d = s.scheduleAbsolute(null, time(2), function () { list.push(new Timestamped(2, s.now())); }); |
114 | 117 |
|
115 |
| - s.scheduleAbsolute(time(1), function () { |
| 118 | + s.scheduleAbsolute(null, time(1), function () { |
116 | 119 | list.push(new Timestamped(0, s.now()));
|
117 | 120 | d.dispose();
|
118 | 121 | });
|
|
129 | 132 |
|
130 | 133 | var list = [];
|
131 | 134 |
|
132 |
| - s.scheduleAbsolute(time(0), function () { list.push(new Timestamped(0, s.now())); }); |
133 |
| - s.scheduleAbsolute(time(1), function () { list.push(new Timestamped(1, s.now())); }); |
134 |
| - s.scheduleAbsolute(time(2), function () { list.push(new Timestamped(2, s.now())); }); |
135 |
| - s.scheduleAbsolute(time(10), function () { list.push(new Timestamped(10, s.now())); }); |
136 |
| - s.scheduleAbsolute(time(11), function () { list.push(new Timestamped(11, s.now())); }); |
| 135 | + s.scheduleAbsolute(null, time(0), function () { list.push(new Timestamped(0, s.now())); }); |
| 136 | + s.scheduleAbsolute(null, time(1), function () { list.push(new Timestamped(1, s.now())); }); |
| 137 | + s.scheduleAbsolute(null, time(2), function () { list.push(new Timestamped(2, s.now())); }); |
| 138 | + s.scheduleAbsolute(null, time(10), function () { list.push(new Timestamped(10, s.now())); }); |
| 139 | + s.scheduleAbsolute(null, time(11), function () { list.push(new Timestamped(11, s.now())); }); |
137 | 140 |
|
138 | 141 | s.advanceTo(time(8));
|
139 | 142 |
|
|
157 | 160 | new Timestamped(2, time(2))
|
158 | 161 | ]);
|
159 | 162 |
|
160 |
| - s.scheduleAbsolute(time(7), function () { list.push(new Timestamped(7, s.now())); }); |
161 |
| - s.scheduleAbsolute(time(8), function () { list.push(new Timestamped(8, s.now())); }); |
| 163 | + s.scheduleAbsolute(null, time(7), function () { list.push(new Timestamped(7, s.now())); }); |
| 164 | + s.scheduleAbsolute(null, time(8), function () { list.push(new Timestamped(8, s.now())); }); |
162 | 165 |
|
163 | 166 | equal(time(8), s.now());
|
164 | 167 | equal(time(8), s.clock);
|
|
204 | 207 |
|
205 | 208 | var list = [];
|
206 | 209 |
|
207 |
| - s.scheduleAbsolute(time(0), function () { list.push(new Timestamped(0, s.now())); }); |
208 |
| - s.scheduleAbsolute(time(1), function () { list.push(new Timestamped(1, s.now())); }); |
209 |
| - s.scheduleAbsolute(time(2), function () { list.push(new Timestamped(2, s.now())); }); |
210 |
| - s.scheduleAbsolute(time(10), function () { list.push(new Timestamped(10, s.now())); }); |
211 |
| - s.scheduleAbsolute(time(11), function () { list.push(new Timestamped(11, s.now())); }); |
| 210 | + s.scheduleAbsolute(null, time(0), function () { list.push(new Timestamped(0, s.now())); }); |
| 211 | + s.scheduleAbsolute(null, time(1), function () { list.push(new Timestamped(1, s.now())); }); |
| 212 | + s.scheduleAbsolute(null, time(2), function () { list.push(new Timestamped(2, s.now())); }); |
| 213 | + s.scheduleAbsolute(null, time(10), function () { list.push(new Timestamped(10, s.now())); }); |
| 214 | + s.scheduleAbsolute(null, time(11), function () { list.push(new Timestamped(11, s.now())); }); |
212 | 215 |
|
213 | 216 | s.advanceBy(time(8) - s.now());
|
214 | 217 |
|
|
221 | 224 | new Timestamped(2, time(2))
|
222 | 225 | ]);
|
223 | 226 |
|
224 |
| - s.scheduleAbsolute(time(7), function () { list.push(new Timestamped(7, s.now())); }); |
225 |
| - s.scheduleAbsolute(time(8), function () { list.push(new Timestamped(8, s.now())); }); |
| 227 | + s.scheduleAbsolute(null, time(7), function () { list.push(new Timestamped(7, s.now())); }); |
| 228 | + s.scheduleAbsolute(null, time(8), function () { list.push(new Timestamped(8, s.now())); }); |
226 | 229 |
|
227 | 230 | equal(time(8), s.now());
|
228 | 231 | equal(time(8), s.clock);
|
|
330 | 333 |
|
331 | 334 | var res = [];
|
332 | 335 |
|
333 |
| - s.scheduleAbsolute(now - 1000, function () { res.push(1); }); |
334 |
| - s.scheduleAbsolute(now - 2000, function () { res.push(2); }); |
| 336 | + s.scheduleAbsolute(null, now - 1000, function () { res.push(1); }); |
| 337 | + s.scheduleAbsolute(null, now - 2000, function () { res.push(2); }); |
335 | 338 |
|
336 | 339 | s.start();
|
337 | 340 |
|
|
0 commit comments