|
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 ifWebGLSupported() { |
|
9 let [target, debuggee, panel] = yield initShaderEditor(SIMPLE_CANVAS_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 a WebGL 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 linked = once(gFront, "program-linked"); |
|
21 reload(target); |
|
22 |
|
23 yield navigating; |
|
24 |
|
25 is($("#reload-notice").hidden, true, |
|
26 "The 'reload this page' notice should be hidden when navigating."); |
|
27 is($("#waiting-notice").hidden, false, |
|
28 "The 'waiting for a WebGL context' notice should be visible when navigating."); |
|
29 is($("#content").hidden, true, |
|
30 "The tool's content should still be hidden."); |
|
31 |
|
32 yield linked; |
|
33 |
|
34 is($("#reload-notice").hidden, true, |
|
35 "The 'reload this page' notice should be hidden after linking."); |
|
36 is($("#waiting-notice").hidden, true, |
|
37 "The 'waiting for a WebGL context' notice should be hidden after linking."); |
|
38 is($("#content").hidden, false, |
|
39 "The tool's content should not be hidden anymore."); |
|
40 |
|
41 yield teardown(panel); |
|
42 finish(); |
|
43 } |