browser_perf-refresh.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. "use strict";
  4. /**
  5. * Rough test that the recording still continues after a refresh.
  6. */
  7. const { SIMPLE_URL } = require("devtools/client/performance/test/helpers/urls");
  8. const { initPerformanceInNewTab, teardownToolboxAndRemoveTab } = require("devtools/client/performance/test/helpers/panel-utils");
  9. const { startRecording, stopRecording, reload } = require("devtools/client/performance/test/helpers/actions");
  10. const { waitUntil } = require("devtools/client/performance/test/helpers/wait-utils");
  11. add_task(function* () {
  12. let { panel, target } = yield initPerformanceInNewTab({
  13. url: SIMPLE_URL,
  14. win: window
  15. });
  16. let { PerformanceController } = panel.panelWin;
  17. yield startRecording(panel);
  18. yield reload(target);
  19. let recording = PerformanceController.getCurrentRecording();
  20. let markersLength = recording.getAllData().markers.length;
  21. ok(recording.isRecording(),
  22. "RecordingModel should still be recording after reload");
  23. yield waitUntil(() => recording.getMarkers().length > markersLength);
  24. ok("Markers continue after reload.");
  25. yield stopRecording(panel);
  26. yield teardownToolboxAndRemoveTab(panel);
  27. });