From 8893af28222d1370c8d89add42dd7207ea7baac0 Mon Sep 17 00:00:00 2001 From: Omar Shehata Date: Mon, 21 Jan 2019 12:24:16 -0500 Subject: [PATCH 1/2] Stabilize cameraMoveEvent spec --- Specs/Scene/SceneSpec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Specs/Scene/SceneSpec.js b/Specs/Scene/SceneSpec.js index 3c3bdf371795..1b373fc20bde 100644 --- a/Specs/Scene/SceneSpec.js +++ b/Specs/Scene/SceneSpec.js @@ -1099,9 +1099,11 @@ defineSuite([ var spyListener = jasmine.createSpy('listener'); s.camera.moveEnd.addEventListener(spyListener); - s.cameraEventWaitTime = 0.0; + 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); From efb44e0e76f3cdb99a5c4bf8529fb59ebb070c06 Mon Sep 17 00:00:00 2001 From: Omar Shehata Date: Tue, 22 Jan 2019 15:22:45 -0500 Subject: [PATCH 2/2] Add comment about negative time --- Specs/Scene/SceneSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Specs/Scene/SceneSpec.js b/Specs/Scene/SceneSpec.js index 1b373fc20bde..aa677ab18cd5 100644 --- a/Specs/Scene/SceneSpec.js +++ b/Specs/Scene/SceneSpec.js @@ -1098,7 +1098,7 @@ defineSuite([ var spyListener = jasmine.createSpy('listener'); s.camera.moveEnd.addEventListener(spyListener); - + // 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.