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