1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/inspector/test/browser_inspector_bug_665880.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +function test() { 1.8 + waitForExplicitFinish(); 1.9 + ignoreAllUncaughtExceptions(); 1.10 + 1.11 + let doc; 1.12 + let objectNode; 1.13 + 1.14 + gBrowser.selectedTab = gBrowser.addTab(); 1.15 + gBrowser.selectedBrowser.addEventListener("load", function() { 1.16 + gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); 1.17 + doc = content.document; 1.18 + waitForFocus(setupObjectInspectionTest, content); 1.19 + }, true); 1.20 + 1.21 + content.location = "data:text/html,<object style='padding: 100px'><p>foobar</p></object>"; 1.22 + 1.23 + function setupObjectInspectionTest() { 1.24 + objectNode = doc.querySelector("object"); 1.25 + ok(objectNode, "we have the object node"); 1.26 + openInspector(runObjectInspectionTest); 1.27 + } 1.28 + 1.29 + function runObjectInspectionTest(inspector) { 1.30 + inspector.once("inspector-updated", performTestComparison); 1.31 + inspector.selection.setNode(objectNode, ""); 1.32 + } 1.33 + 1.34 + function performTestComparison() { 1.35 + is(getActiveInspector().selection.node, objectNode, "selection matches node"); 1.36 + let target = TargetFactory.forTab(gBrowser.selectedTab); 1.37 + executeSoon(function() { 1.38 + gDevTools.closeToolbox(target); 1.39 + finishUp(); 1.40 + }); 1.41 + } 1.42 + 1.43 + function finishUp() { 1.44 + doc = objectNode = null; 1.45 + gBrowser.removeCurrentTab(); 1.46 + finish(); 1.47 + } 1.48 +}