diff options
author | Matt A. Tobin <email@mattatobin.com> | 2016-10-16 19:34:53 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2016-10-16 19:34:53 -0400 |
commit | 81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch) | |
tree | 6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /toolkit/devtools/webaudioeditor/test/browser_wa_inspector.js | |
parent | 28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff) | |
download | palemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz |
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'toolkit/devtools/webaudioeditor/test/browser_wa_inspector.js')
-rw-r--r-- | toolkit/devtools/webaudioeditor/test/browser_wa_inspector.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/toolkit/devtools/webaudioeditor/test/browser_wa_inspector.js b/toolkit/devtools/webaudioeditor/test/browser_wa_inspector.js new file mode 100644 index 000000000..083bf2671 --- /dev/null +++ b/toolkit/devtools/webaudioeditor/test/browser_wa_inspector.js @@ -0,0 +1,46 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Tests that inspector view opens on graph node click, and + * loads the correct node inside the inspector. + */ + +add_task(function*() { + let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL); + let { panelWin } = panel; + let { gFront, $, $$, EVENTS, InspectorView } = panelWin; + let gVars = InspectorView._propsView; + + let started = once(gFront, "start-context"); + + reload(target); + + let [actors] = yield Promise.all([ + get3(gFront, "create-node"), + waitForGraphRendered(panelWin, 3, 2) + ]); + let nodeIds = actors.map(actor => actor.actorID); + + ok(!InspectorView.isVisible(), "InspectorView hidden on start."); + ok(isVisible($("#web-audio-editor-details-pane-empty")), + "InspectorView empty message should show when no node's selected."); + ok(!isVisible($("#web-audio-editor-tabs")), + "InspectorView tabs view should be hidden when no node's selected."); + + // Wait for the node to be set as well as the inspector to come fully into the view + yield clickGraphNode(panelWin, findGraphNode(panelWin, nodeIds[1]), true); + + ok(InspectorView.isVisible(), "InspectorView shown once node selected."); + ok(!isVisible($("#web-audio-editor-details-pane-empty")), + "InspectorView empty message hidden when node selected."); + ok(isVisible($("#web-audio-editor-tabs")), + "InspectorView tabs view visible when node selected."); + + is($("#web-audio-editor-tabs").selectedIndex, 0, + "default tab selected should be the parameters tab."); + + yield clickGraphNode(panelWin, findGraphNode(panelWin, nodeIds[2])); + + yield teardown(target); +}); |