michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests that the frontend UI is properly reconfigured after reloading. michael@0: */ michael@0: michael@0: function ifTestingSupported() { michael@0: let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); michael@0: let { window, $, EVENTS } = panel.panelWin; michael@0: michael@0: let reset = once(window, EVENTS.UI_RESET); michael@0: let navigated = reload(target); michael@0: michael@0: yield reset; michael@0: ok(true, "The UI was reset after the refresh button was clicked."); michael@0: michael@0: yield navigated; michael@0: ok(true, "The target finished reloading."); michael@0: michael@0: is($("#snapshots-pane").hasAttribute("hidden"), false, michael@0: "The snapshots pane should still be visible."); michael@0: is($("#debugging-pane").hasAttribute("hidden"), false, michael@0: "The debugging pane should still be visible."); michael@0: michael@0: is($("#record-snapshot").hasAttribute("checked"), false, michael@0: "The 'record snapshot' button should not be checked."); michael@0: is($("#record-snapshot").hasAttribute("disabled"), false, michael@0: "The 'record snapshot' button should not be disabled."); michael@0: michael@0: is($("#record-snapshot").hasAttribute("hidden"), false, michael@0: "The 'record snapshot' button should now be visible."); michael@0: is($("#import-snapshot").hasAttribute("hidden"), false, michael@0: "The 'import snapshot' button should still be visible."); michael@0: is($("#clear-snapshots").hasAttribute("hidden"), false, michael@0: "The 'clear snapshots' button should still be visible."); michael@0: michael@0: is($("#reload-notice").getAttribute("hidden"), "true", michael@0: "The reload notice should now be hidden."); michael@0: is($("#empty-notice").hasAttribute("hidden"), false, michael@0: "The empty notice should now be visible."); michael@0: is($("#import-notice").getAttribute("hidden"), "true", michael@0: "The import notice should now be hidden."); michael@0: michael@0: is($("#snapshot-filmstrip").getAttribute("hidden"), "true", michael@0: "The snapshot filmstrip should still be hidden."); michael@0: is($("#screenshot-container").getAttribute("hidden"), "true", michael@0: "The screenshot container should still be hidden."); michael@0: michael@0: is($("#debugging-pane-contents").getAttribute("hidden"), "true", michael@0: "The rest of the UI should still be hidden."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }