browser/devtools/canvasdebugger/test/browser_canvas-frontend-reload-01.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial