Skip to content

Commit

Permalink
Merge pull request #7496 from OmarShehata/camera-test
Browse files Browse the repository at this point in the history
Make cameraMoveEvent spec more stable
  • Loading branch information
mramato authored Jan 22, 2019
2 parents ab7fc4c + efb44e0 commit 191c287
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Specs/Scene/SceneSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1098,10 +1098,12 @@ defineSuite([

var spyListener = jasmine.createSpy('listener');
s.camera.moveEnd.addEventListener(spyListener);

s.cameraEventWaitTime = 0.0;
// We use negative time here to ensure the event runs on the next frame.
s.cameraEventWaitTime = -1.0;
s.camera.moveLeft();
// The first render will trigger the moveStart event.
s.render();
// The second will trigger the moveEnd.
s.render();

expect(spyListener.calls.count()).toBe(1);
Expand Down

0 comments on commit 191c287

Please sign in to comment.