browser_canvas-frontend-reload-01.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /**
  4. * Tests that the frontend UI is properly reconfigured after reloading.
  5. */
  6. function* ifTestingSupported() {
  7. let { target, panel } = yield initCanvasDebuggerFrontend(SIMPLE_CANVAS_URL);
  8. let { window, $, EVENTS } = panel.panelWin;
  9. let reset = once(window, EVENTS.UI_RESET);
  10. let navigated = reload(target);
  11. yield reset;
  12. ok(true, "The UI was reset after the refresh button was clicked.");
  13. yield navigated;
  14. ok(true, "The target finished reloading.");
  15. is($("#snapshots-pane").hasAttribute("hidden"), false,
  16. "The snapshots pane should still be visible.");
  17. is($("#debugging-pane").hasAttribute("hidden"), false,
  18. "The debugging pane should still be visible.");
  19. is($("#record-snapshot").hasAttribute("checked"), false,
  20. "The 'record snapshot' button should not be checked.");
  21. is($("#record-snapshot").hasAttribute("disabled"), false,
  22. "The 'record snapshot' button should not be disabled.");
  23. is($("#record-snapshot").hasAttribute("hidden"), false,
  24. "The 'record snapshot' button should now be visible.");
  25. is($("#import-snapshot").hasAttribute("hidden"), false,
  26. "The 'import snapshot' button should still be visible.");
  27. is($("#clear-snapshots").hasAttribute("hidden"), false,
  28. "The 'clear snapshots' button should still be visible.");
  29. is($("#reload-notice").getAttribute("hidden"), "true",
  30. "The reload notice should now be hidden.");
  31. is($("#empty-notice").hasAttribute("hidden"), false,
  32. "The empty notice should now be visible.");
  33. is($("#waiting-notice").getAttribute("hidden"), "true",
  34. "The waiting notice should now be hidden.");
  35. is($("#snapshot-filmstrip").getAttribute("hidden"), "true",
  36. "The snapshot filmstrip should still be hidden.");
  37. is($("#screenshot-container").getAttribute("hidden"), "true",
  38. "The screenshot container should still be hidden.");
  39. is($("#debugging-pane-contents").getAttribute("hidden"), "true",
  40. "The rest of the UI should still be hidden.");
  41. yield teardown(panel);
  42. finish();
  43. }