mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-11 13:59:23 -04:00
Make Scratch 3 project timer more compatible with Scratch 2 currentMSecs usage
These compatibility changes: - Use runtime.currentMSecs for the Clock timer "now" value - Start executing hats before other threads change values - Update test and fixtures to work with earlier hat execution - Add test for hat execution block order
This commit is contained in:
parent
c5abcf5888
commit
2a60391fb4
9 changed files with 31 additions and 17 deletions
test/unit
|
@ -23,12 +23,15 @@ test('cycle', t => {
|
|||
setTimeout(() => {
|
||||
c.resetProjectTimer();
|
||||
setTimeout(() => {
|
||||
t.ok(c.projectTimer() > 0);
|
||||
// The timer shouldn't advance until all threads have been stepped
|
||||
t.ok(c.projectTimer() === 0);
|
||||
c.pause();
|
||||
t.ok(c.projectTimer() > 0);
|
||||
t.ok(c.projectTimer() === 0);
|
||||
c.resume();
|
||||
t.ok(c.projectTimer() > 0);
|
||||
t.ok(c.projectTimer() === 0);
|
||||
t.end();
|
||||
}, 100);
|
||||
}, 100);
|
||||
rt._step();
|
||||
t.ok(c.projectTimer() > 0);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue