Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 }