Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* vim: set ts=2 et sw=2 tw=80: */
2 /* Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/ */
5 function test()
6 {
7 waitForExplicitFinish();
9 gBrowser.selectedTab = gBrowser.addTab();
10 let target = TargetFactory.forTab(gBrowser.selectedTab);
12 gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) {
13 gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true);
14 gDevTools.showToolbox(target).then(testReady);
15 }, true);
17 content.location = "data:text/html,test for dynamically registering and unregistering tools";
18 }
20 function testReady(toolbox)
21 {
22 ok(toolbox.isReady, "toolbox isReady is set");
23 testDouble(toolbox);
24 }
26 function testDouble(toolbox)
27 {
28 let target = toolbox.target;
29 let toolId = toolbox.currentToolId;
31 gDevTools.showToolbox(target, toolId).then(function(toolbox2) {
32 is(toolbox2, toolbox, "same toolbox");
33 cleanup(toolbox);
34 });
35 }
37 function cleanup(toolbox)
38 {
39 toolbox.destroy().then(function() {
40 gBrowser.removeCurrentTab();
41 finish();
42 });
43 }