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.
michael@0 | 1 | /* vim: set ts=2 et sw=2 tw=80: */ |
michael@0 | 2 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 4 | |
michael@0 | 5 | function test() |
michael@0 | 6 | { |
michael@0 | 7 | waitForExplicitFinish(); |
michael@0 | 8 | |
michael@0 | 9 | gBrowser.selectedTab = gBrowser.addTab(); |
michael@0 | 10 | let target = TargetFactory.forTab(gBrowser.selectedTab); |
michael@0 | 11 | |
michael@0 | 12 | gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) { |
michael@0 | 13 | gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true); |
michael@0 | 14 | gDevTools.showToolbox(target).then(testReady); |
michael@0 | 15 | }, true); |
michael@0 | 16 | |
michael@0 | 17 | content.location = "data:text/html,test for dynamically registering and unregistering tools"; |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | function testReady(toolbox) |
michael@0 | 21 | { |
michael@0 | 22 | ok(toolbox.isReady, "toolbox isReady is set"); |
michael@0 | 23 | testDouble(toolbox); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | function testDouble(toolbox) |
michael@0 | 27 | { |
michael@0 | 28 | let target = toolbox.target; |
michael@0 | 29 | let toolId = toolbox.currentToolId; |
michael@0 | 30 | |
michael@0 | 31 | gDevTools.showToolbox(target, toolId).then(function(toolbox2) { |
michael@0 | 32 | is(toolbox2, toolbox, "same toolbox"); |
michael@0 | 33 | cleanup(toolbox); |
michael@0 | 34 | }); |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | function cleanup(toolbox) |
michael@0 | 38 | { |
michael@0 | 39 | toolbox.destroy().then(function() { |
michael@0 | 40 | gBrowser.removeCurrentTab(); |
michael@0 | 41 | finish(); |
michael@0 | 42 | }); |
michael@0 | 43 | } |