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

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

mercurial