browser_wa_reset-02.js 975 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /**
  4. * Tests reloading a tab with the tools open properly cleans up
  5. * the graph.
  6. */
  7. add_task(function* () {
  8. let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
  9. let { panelWin } = panel;
  10. let { gFront, $ } = panelWin;
  11. let events = Promise.all([
  12. get3(gFront, "create-node"),
  13. waitForGraphRendered(panelWin, 3, 2)
  14. ]);
  15. reload(target);
  16. yield events;
  17. let { nodes, edges } = countGraphObjects(panelWin);
  18. is(nodes, 3, "should only be 3 nodes.");
  19. is(edges, 2, "should only be 2 edges.");
  20. events = Promise.all([
  21. get3(gFront, "create-node"),
  22. waitForGraphRendered(panelWin, 3, 2)
  23. ]);
  24. reload(target);
  25. yield events;
  26. ({ nodes, edges } = countGraphObjects(panelWin));
  27. is(nodes, 3, "after reload, should only be 3 nodes.");
  28. is(edges, 2, "after reload, should only be 2 edges.");
  29. yield teardown(target);
  30. });