browser_wa_first-run.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. //
  4. // Whitelisting this test.
  5. // As part of bug 1077403, the leaking uncaught rejection should be fixed.
  6. //
  7. thisTestLeaksUncaughtRejectionsAndShouldBeFixed("Error: Connection closed");
  8. /**
  9. * Tests that the reloading/onContentLoaded hooks work.
  10. */
  11. add_task(function* () {
  12. let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
  13. let { gFront, $ } = panel.panelWin;
  14. is($("#reload-notice").hidden, false,
  15. "The 'reload this page' notice should initially be visible.");
  16. is($("#waiting-notice").hidden, true,
  17. "The 'waiting for an audio context' notice should initially be hidden.");
  18. is($("#content").hidden, true,
  19. "The tool's content should initially be hidden.");
  20. let navigating = once(target, "will-navigate");
  21. let started = once(gFront, "start-context");
  22. reload(target);
  23. yield navigating;
  24. is($("#reload-notice").hidden, true,
  25. "The 'reload this page' notice should be hidden when navigating.");
  26. is($("#waiting-notice").hidden, false,
  27. "The 'waiting for an audio context' notice should be visible when navigating.");
  28. is($("#content").hidden, true,
  29. "The tool's content should still be hidden.");
  30. yield started;
  31. is($("#reload-notice").hidden, true,
  32. "The 'reload this page' notice should be hidden after context found.");
  33. is($("#waiting-notice").hidden, true,
  34. "The 'waiting for an audio context' notice should be hidden after context found.");
  35. is($("#content").hidden, false,
  36. "The tool's content should not be hidden anymore.");
  37. yield teardown(target);
  38. });