The pause() is needed because this test is checking the transition from paused -> cancelled. The comment is wrong (which I have fixed).

The setTimeout is to yield back to the browser as mentioned above. Again, no idea if needed or not.