browser_canvas-frontend-snapshot-select-02.js 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /**
  4. * Tests if selecting snapshots in the frontend displays the appropriate data
  5. * respective to their recorded animation frame.
  6. */
  7. function* ifTestingSupported() {
  8. let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_URL);
  9. let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin;
  10. yield reload(target);
  11. SnapshotsListView._onRecordButtonClick();
  12. let snapshotTarget = SnapshotsListView.getItemAtIndex(0).target;
  13. EventUtils.sendMouseEvent({ type: "mousedown" }, snapshotTarget, window);
  14. EventUtils.sendMouseEvent({ type: "mousedown" }, snapshotTarget, window);
  15. EventUtils.sendMouseEvent({ type: "mousedown" }, snapshotTarget, window);
  16. ok(true, "clicking in-progress snapshot does not fail");
  17. let finished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
  18. SnapshotsListView._onRecordButtonClick();
  19. yield finished;
  20. yield teardown(panel);
  21. finish();
  22. }