browser/devtools/webaudioeditor/test/browser_wa_params_view_edit.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 if the shader editor shows the appropriate UI when opened.
michael@0 6 */
michael@0 7
michael@0 8 function spawnTest() {
michael@0 9 let [target, debuggee, panel] = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
michael@0 10 let { gFront, $, $$, EVENTS, WebAudioParamView } = panel.panelWin;
michael@0 11 let gVars = WebAudioParamView._paramsView;
michael@0 12
michael@0 13 let started = once(gFront, "start-context");
michael@0 14
michael@0 15 reload(target);
michael@0 16
michael@0 17 let [[dest, osc, gain], [[_, destID], [_, oscID], [_, gainID]]] = yield Promise.all([
michael@0 18 get3(gFront, "create-node"),
michael@0 19 get3Spread(panel.panelWin, EVENTS.UI_ADD_NODE_LIST)
michael@0 20 ]);
michael@0 21
michael@0 22
michael@0 23 checkVariableView(gVars, 1, {
michael@0 24 "type": "\"sine\"",
michael@0 25 "frequency": 440,
michael@0 26 "detune": 0
michael@0 27 });
michael@0 28
michael@0 29 checkVariableView(gVars, 2, {
michael@0 30 "gain": 0
michael@0 31 });
michael@0 32
michael@0 33 yield modifyVariableView(panel.panelWin, gVars, 1, "type", "square");
michael@0 34
michael@0 35 checkVariableView(gVars, 1, {
michael@0 36 "type": "\"square\""
michael@0 37 });
michael@0 38
michael@0 39 yield teardown(panel);
michael@0 40 finish();
michael@0 41 }
michael@0 42

mercurial