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 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | function test() { |
michael@0 | 5 | waitForExplicitFinish(); |
michael@0 | 6 | ignoreAllUncaughtExceptions(); |
michael@0 | 7 | |
michael@0 | 8 | let doc; |
michael@0 | 9 | let objectNode; |
michael@0 | 10 | |
michael@0 | 11 | gBrowser.selectedTab = gBrowser.addTab(); |
michael@0 | 12 | gBrowser.selectedBrowser.addEventListener("load", function() { |
michael@0 | 13 | gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); |
michael@0 | 14 | doc = content.document; |
michael@0 | 15 | waitForFocus(setupObjectInspectionTest, content); |
michael@0 | 16 | }, true); |
michael@0 | 17 | |
michael@0 | 18 | content.location = "data:text/html,<object style='padding: 100px'><p>foobar</p></object>"; |
michael@0 | 19 | |
michael@0 | 20 | function setupObjectInspectionTest() { |
michael@0 | 21 | objectNode = doc.querySelector("object"); |
michael@0 | 22 | ok(objectNode, "we have the object node"); |
michael@0 | 23 | openInspector(runObjectInspectionTest); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | function runObjectInspectionTest(inspector) { |
michael@0 | 27 | inspector.once("inspector-updated", performTestComparison); |
michael@0 | 28 | inspector.selection.setNode(objectNode, ""); |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | function performTestComparison() { |
michael@0 | 32 | is(getActiveInspector().selection.node, objectNode, "selection matches node"); |
michael@0 | 33 | let target = TargetFactory.forTab(gBrowser.selectedTab); |
michael@0 | 34 | executeSoon(function() { |
michael@0 | 35 | gDevTools.closeToolbox(target); |
michael@0 | 36 | finishUp(); |
michael@0 | 37 | }); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | function finishUp() { |
michael@0 | 41 | doc = objectNode = null; |
michael@0 | 42 | gBrowser.removeCurrentTab(); |
michael@0 | 43 | finish(); |
michael@0 | 44 | } |
michael@0 | 45 | } |