browser/devtools/inspector/test/browser_inspector_bug_665880.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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 }

mercurial