browser_perf-overview-render-01.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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 overview continuously renders content when recording.
  6. */
  7. const { Constants } = require("devtools/client/performance/modules/constants");
  8. const { SIMPLE_URL } = require("devtools/client/performance/test/helpers/urls");
  9. const { initPerformanceInNewTab, teardownToolboxAndRemoveTab } = require("devtools/client/performance/test/helpers/panel-utils");
  10. const { startRecording, stopRecording } = require("devtools/client/performance/test/helpers/actions");
  11. const { times } = require("devtools/client/performance/test/helpers/event-utils");
  12. add_task(function* () {
  13. let { panel } = yield initPerformanceInNewTab({
  14. url: SIMPLE_URL,
  15. win: window
  16. });
  17. let { EVENTS, OverviewView } = panel.panelWin;
  18. yield startRecording(panel);
  19. // Ensure overview keeps rendering.
  20. yield times(OverviewView, EVENTS.UI_OVERVIEW_RENDERED, 3, {
  21. expectedArgs: { "1": Constants.FRAMERATE_GRAPH_LOW_RES_INTERVAL }
  22. });
  23. ok(true, "Overview was rendered while recording.");
  24. yield stopRecording(panel);
  25. yield teardownToolboxAndRemoveTab(panel);
  26. });