browser_perf-details-render-00-waterfall.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. "use strict";
  4. /**
  5. * Tests that the waterfall view renders content after recording.
  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 } = require("devtools/client/performance/test/helpers/actions");
  10. add_task(function* () {
  11. let { panel } = yield initPerformanceInNewTab({
  12. url: SIMPLE_URL,
  13. win: window
  14. });
  15. let { DetailsView, WaterfallView } = panel.panelWin;
  16. yield startRecording(panel);
  17. // Already waits for EVENTS.UI_WATERFALL_RENDERED.
  18. yield stopRecording(panel);
  19. ok(DetailsView.isViewSelected(WaterfallView),
  20. "The waterfall view is selected by default in the details view.");
  21. ok(true, "WaterfallView rendered after recording is stopped.");
  22. yield startRecording(panel);
  23. // Already waits for EVENTS.UI_WATERFALL_RENDERED.
  24. yield stopRecording(panel);
  25. ok(DetailsView.isViewSelected(WaterfallView),
  26. "The waterfall view is still selected in the details view.");
  27. ok(true, "WaterfallView rendered again after recording completed a second time.");
  28. yield teardownToolboxAndRemoveTab(panel);
  29. });