browser_canvas-frontend-stop-03.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /**
  4. * Tests that a recording that has a rAF cycle, but no draw calls, fails
  5. * after timeout.
  6. */
  7. function* ifTestingSupported() {
  8. let { target, panel } = yield initCanvasDebuggerFrontend(RAF_NO_CANVAS_URL);
  9. let { window, EVENTS, $, SnapshotsListView } = panel.panelWin;
  10. yield reload(target);
  11. let recordingStarted = once(window, EVENTS.SNAPSHOT_RECORDING_STARTED);
  12. SnapshotsListView._onRecordButtonClick();
  13. yield recordingStarted;
  14. is($("#empty-notice").hidden, true, "Empty notice not shown");
  15. is($("#waiting-notice").hidden, false, "Waiting notice shown");
  16. let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
  17. let recordingCancelled = once(window, EVENTS.SNAPSHOT_RECORDING_CANCELLED);
  18. yield promise.all([recordingFinished, recordingCancelled]);
  19. ok(true, "Recording stopped and was considered failed.");
  20. is(SnapshotsListView.itemCount, 0, "No snapshots in the list.");
  21. is($("#empty-notice").hidden, false, "Empty notice shown");
  22. is($("#waiting-notice").hidden, true, "Waiting notice not shown");
  23. yield teardown(panel);
  24. finish();
  25. }