browser_canvas-frontend-stop-02.js 1.2 KB

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