browser/devtools/webaudioeditor/test/browser_wa_first-run.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:524829ef9dcb
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 /**
5 * Tests if the shader editor shows the appropriate UI when opened.
6 */
7
8 function spawnTest() {
9 let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
10 let { gFront, $ } = panel.panelWin;
11
12 is($("#reload-notice").hidden, false,
13 "The 'reload this page' notice should initially be visible.");
14 is($("#waiting-notice").hidden, true,
15 "The 'waiting for an audio context' notice should initially be hidden.");
16 is($("#content").hidden, true,
17 "The tool's content should initially be hidden.");
18
19 let navigating = once(target, "will-navigate");
20 let started = once(gFront, "start-context");
21
22 reload(target);
23
24 yield navigating;
25
26 is($("#reload-notice").hidden, true,
27 "The 'reload this page' notice should be hidden when navigating.");
28 is($("#waiting-notice").hidden, false,
29 "The 'waiting for an audio context' notice should be visible when navigating.");
30 is($("#content").hidden, true,
31 "The tool's content should still be hidden.");
32
33 yield started;
34
35 is($("#reload-notice").hidden, true,
36 "The 'reload this page' notice should be hidden after context found.");
37 is($("#waiting-notice").hidden, true,
38 "The 'waiting for an audio context' notice should be hidden after context found.");
39 is($("#content").hidden, false,
40 "The tool's content should not be hidden anymore.");
41
42 yield teardown(panel);
43 finish();
44 }

mercurial