2014-09-22 14:28:00 +00:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests naviating from a page to another will repopulate
|
|
|
|
* the audio graph if both pages have an AudioContext.
|
|
|
|
*/
|
|
|
|
|
2014-12-19 01:55:00 +00:00
|
|
|
add_task(function*() {
|
2014-09-25 02:23:39 +00:00
|
|
|
let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
|
2014-09-22 14:28:00 +00:00
|
|
|
let { panelWin } = panel;
|
|
|
|
let { gFront, $ } = panelWin;
|
|
|
|
|
|
|
|
reload(target);
|
|
|
|
|
|
|
|
var [actors] = yield Promise.all([
|
|
|
|
get3(gFront, "create-node"),
|
|
|
|
waitForGraphRendered(panelWin, 3, 2)
|
|
|
|
]);
|
|
|
|
|
|
|
|
var { nodes, edges } = countGraphObjects(panelWin);
|
|
|
|
ise(nodes, 3, "should only be 3 nodes.");
|
|
|
|
ise(edges, 2, "should only be 2 edges.");
|
|
|
|
|
|
|
|
navigate(target, SIMPLE_NODES_URL);
|
|
|
|
|
|
|
|
var [actors] = yield Promise.all([
|
2015-01-06 10:23:00 +00:00
|
|
|
getN(gFront, "create-node", 15),
|
|
|
|
waitForGraphRendered(panelWin, 15, 0)
|
2014-09-22 14:28:00 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
is($("#reload-notice").hidden, true,
|
|
|
|
"The 'reload this page' notice should be hidden after context found after navigation.");
|
|
|
|
is($("#waiting-notice").hidden, true,
|
|
|
|
"The 'waiting for an audio context' notice should be hidden after context found after navigation.");
|
|
|
|
is($("#content").hidden, false,
|
|
|
|
"The tool's content should reappear without closing and reopening the toolbox.");
|
|
|
|
|
|
|
|
var { nodes, edges } = countGraphObjects(panelWin);
|
2015-01-06 10:23:00 +00:00
|
|
|
ise(nodes, 15, "after navigation, should have 15 nodes");
|
2014-09-22 14:28:00 +00:00
|
|
|
ise(edges, 0, "after navigation, should have 0 edges.");
|
|
|
|
|
2014-12-19 01:55:00 +00:00
|
|
|
yield teardown(target);
|
|
|
|
});
|