Bug 1068273 - Remove time-based toggling in web audio editor tests. r=vp, a=test-only
☠☠ backed out by 1a848854d464 ☠ ☠
authorJordan Santell <jsantell@gmail.com>
Sun, 19 Oct 2014 10:29:00 +0200
changeset 233461 03a54839d256c80c3998373c19e7834c1d82aaca
parent 233460 d222568551bff32c97a48ed309833778f41cba1a
child 233462 da97b18e9e43674928cfd7ca87fa409cb2bb4afc
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvp, test-only
bugs1068273
milestone35.0a2
Bug 1068273 - Remove time-based toggling in web audio editor tests. r=vp, a=test-only
browser/devtools/webaudioeditor/test/browser.ini
browser/devtools/webaudioeditor/test/browser_wa_graph-render-03.js
browser/devtools/webaudioeditor/test/browser_wa_graph-render-05.js
browser/devtools/webaudioeditor/test/doc_connect-toggle-param.html
browser/devtools/webaudioeditor/test/doc_connect-toggle.html
browser/devtools/webaudioeditor/test/head.js
--- a/browser/devtools/webaudioeditor/test/browser.ini
+++ b/browser/devtools/webaudioeditor/test/browser.ini
@@ -2,18 +2,16 @@
 subsuite = devtools
 support-files =
   doc_simple-context.html
   doc_complex-context.html
   doc_simple-node-creation.html
   doc_buffer-and-array.html
   doc_media-node-creation.html
   doc_destroy-nodes.html
-  doc_connect-toggle.html
-  doc_connect-toggle-param.html
   doc_connect-param.html
   doc_connect-multi-param.html
   doc_iframe-context.html
   440hz_sine.ogg
   head.js
 
 [browser_audionode-actor-get-param-flags.js]
 [browser_audionode-actor-get-params-01.js]
--- a/browser/devtools/webaudioeditor/test/browser_wa_graph-render-03.js
+++ b/browser/devtools/webaudioeditor/test/browser_wa_graph-render-03.js
@@ -1,34 +1,37 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests to ensure that selected nodes stay selected on graph redraw.
  */
 
 function spawnTest() {
-  let { target, panel } = yield initWebAudioEditor(CONNECT_TOGGLE_URL);
+  let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
   let { panelWin } = panel;
   let { gFront, $, $$, EVENTS } = panelWin;
 
   reload(target);
 
   let [actors] = yield Promise.all([
     getN(gFront, "create-node", 3),
     waitForGraphRendered(panelWin, 3, 2)
   ]);
 
-  let nodeIDs = actors.map(actor => actor.actorID);
+  let [dest, osc, gain] = actors;
 
-  yield clickGraphNode(panelWin, nodeIDs[1]);
-  ok(findGraphNode(panelWin, nodeIDs[1]).classList.contains("selected"),
+  yield clickGraphNode(panelWin, gain.actorID);
+  ok(findGraphNode(panelWin, gain.actorID).classList.contains("selected"),
     "Node selected once.");
 
+  // Disconnect a node to trigger a rerender
+  osc.disconnect();
+
   yield once(panelWin, EVENTS.UI_GRAPH_RENDERED);
   
-  ok(findGraphNode(panelWin, nodeIDs[1]).classList.contains("selected"),
+  ok(findGraphNode(panelWin, gain.actorID).classList.contains("selected"),
     "Node still selected after rerender.");
 
   yield teardown(panel);
   finish();
 }
 
--- a/browser/devtools/webaudioeditor/test/browser_wa_graph-render-05.js
+++ b/browser/devtools/webaudioeditor/test/browser_wa_graph-render-05.js
@@ -1,27 +1,31 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests to ensure that param connections trigger graph redraws
  */
 
 function spawnTest() {
-  let { target, panel } = yield initWebAudioEditor(CONNECT_TOGGLE_PARAM_URL);
+  let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
   let { panelWin } = panel;
   let { gFront, $, $$, EVENTS } = panelWin;
 
   reload(target);
 
   let [actors] = yield Promise.all([
     getN(gFront, "create-node", 3),
-    waitForGraphRendered(panelWin, 3, 1, 0)
+    waitForGraphRendered(panelWin, 3, 2, 0)
   ]);
-  ok(true, "Graph rendered without param connection");
+
+  let [dest, osc, gain] = actors;
 
+  yield osc.disconnect();
+
+  osc.connectParam(gain, "gain");
   yield waitForGraphRendered(panelWin, 3, 1, 1);
   ok(true, "Graph re-rendered upon param connection");
 
   yield teardown(panel);
   finish();
 }
 
deleted file mode 100644
--- a/browser/devtools/webaudioeditor/test/doc_connect-toggle-param.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!doctype html>
-
-<html>
-  <head>
-    <meta charset="utf-8"/>
-    <title>Web Audio Editor test page</title>
-  </head>
-
-  <body>
-
-    <script type="text/javascript;version=1.8">
-      "use strict";
-
-      let i = 0;
-      let ctx = new AudioContext();
-      let osc = ctx.createOscillator();
-      let gain = ctx.createGain();
-      gain.gain.value = 0;
-      gain.connect(ctx.destination);
-      osc.start(0);
-      setTimeout(() => osc.connect(gain.gain), 500);
-    </script>
-  </body>
-
-</html>
deleted file mode 100644
--- a/browser/devtools/webaudioeditor/test/doc_connect-toggle.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!doctype html>
-
-<html>
-  <head>
-    <meta charset="utf-8"/>
-    <title>Web Audio Editor test page</title>
-  </head>
-
-  <body>
-
-    <script type="text/javascript;version=1.8">
-      "use strict";
-
-      let i = 0;
-      let ctx = new AudioContext();
-      let osc = ctx.createOscillator();
-      let gain = ctx.createGain();
-      gain.gain.value = 0;
-      gain.connect(ctx.destination);
-      osc.start(0);
-      setInterval(() => ++i && (i % 2 ? osc.connect(gain) : osc.disconnect()), 1000);
-    </script>
-  </body>
-
-</html>
--- a/browser/devtools/webaudioeditor/test/head.js
+++ b/browser/devtools/webaudioeditor/test/head.js
@@ -22,18 +22,16 @@ let TargetFactory = devtools.TargetFacto
 
 const EXAMPLE_URL = "http://example.com/browser/browser/devtools/webaudioeditor/test/";
 const SIMPLE_CONTEXT_URL = EXAMPLE_URL + "doc_simple-context.html";
 const COMPLEX_CONTEXT_URL = EXAMPLE_URL + "doc_complex-context.html";
 const SIMPLE_NODES_URL = EXAMPLE_URL + "doc_simple-node-creation.html";
 const MEDIA_NODES_URL = EXAMPLE_URL + "doc_media-node-creation.html";
 const BUFFER_AND_ARRAY_URL = EXAMPLE_URL + "doc_buffer-and-array.html";
 const DESTROY_NODES_URL = EXAMPLE_URL + "doc_destroy-nodes.html";
-const CONNECT_TOGGLE_URL = EXAMPLE_URL + "doc_connect-toggle.html";
-const CONNECT_TOGGLE_PARAM_URL = EXAMPLE_URL + "doc_connect-toggle-param.html";
 const CONNECT_PARAM_URL = EXAMPLE_URL + "doc_connect-param.html";
 const CONNECT_MULTI_PARAM_URL = EXAMPLE_URL + "doc_connect-multi-param.html";
 const IFRAME_CONTEXT_URL = EXAMPLE_URL + "doc_iframe-context.html";
 
 // All tests are asynchronous.
 waitForExplicitFinish();
 
 let gToolEnabled = Services.prefs.getBoolPref("devtools.webaudioeditor.enabled");