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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/webaudioeditor/test/browser_wa_first-run.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/**
     1.8 + * Tests if the shader editor shows the appropriate UI when opened.
     1.9 + */
    1.10 +
    1.11 +function spawnTest() {
    1.12 +  let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
    1.13 +  let { gFront, $ } = panel.panelWin;
    1.14 +
    1.15 +  is($("#reload-notice").hidden, false,
    1.16 +    "The 'reload this page' notice should initially be visible.");
    1.17 +  is($("#waiting-notice").hidden, true,
    1.18 +    "The 'waiting for an audio context' notice should initially be hidden.");
    1.19 +  is($("#content").hidden, true,
    1.20 +    "The tool's content should initially be hidden.");
    1.21 +
    1.22 +  let navigating = once(target, "will-navigate");
    1.23 +  let started = once(gFront, "start-context");
    1.24 +
    1.25 +  reload(target);
    1.26 +
    1.27 +  yield navigating;
    1.28 +
    1.29 +  is($("#reload-notice").hidden, true,
    1.30 +    "The 'reload this page' notice should be hidden when navigating.");
    1.31 +  is($("#waiting-notice").hidden, false,
    1.32 +    "The 'waiting for an audio context' notice should be visible when navigating.");
    1.33 +  is($("#content").hidden, true,
    1.34 +    "The tool's content should still be hidden.");
    1.35 +
    1.36 +  yield started;
    1.37 +
    1.38 +  is($("#reload-notice").hidden, true,
    1.39 +    "The 'reload this page' notice should be hidden after context found.");
    1.40 +  is($("#waiting-notice").hidden, true,
    1.41 +    "The 'waiting for an audio context' notice should be hidden after context found.");
    1.42 +  is($("#content").hidden, false,
    1.43 +    "The tool's content should not be hidden anymore.");
    1.44 +
    1.45 +  yield teardown(panel);
    1.46 +  finish();
    1.47 +}

mercurial