Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: devtools/server/tests/chrome/chrome.toml
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<meta charset="utf-8">
<script type="application/javascript" src="inspector-helpers.js"></script>
<script type="application/javascript">
"use strict";
window.onload = function() {
SimpleTest.waitForExplicitFinish();
runNextTest();
};
let gWalker;
addTest(async function() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = await target.getFront("inspector");
gWalker = inspector.walker;
runNextTest();
});
addTest(function() {
info("Try to get a NodeFront from an invalid actorID");
gWalker.getNodeFromActor("invalid", ["node"]).then(node => {
ok(!node, "The node returned is null");
runNextTest();
});
});
addTest(function() {
info("Try to get a NodeFront from a valid actorID but invalid path");
gWalker.getNodeFromActor(gWalker.actorID, ["invalid", "path"]).then(node => {
ok(!node, "The node returned is null");
runNextTest();
});
});
addTest(function() {
info("Try to get a NodeFront from a valid actorID and valid path");
gWalker.getNodeFromActor(gWalker.actorID, ["rootDoc"]).then(rootDocNode => {
ok(rootDocNode, "A node was returned");
is(rootDocNode, gWalker.rootNode, "The right node was returned");
runNextTest();
});
});
addTest(function() {
info("Try to get a NodeFront from a valid actorID and valid complex path");
gWalker.getNodeFromActor(gWalker.actorID,
["targetActor", "window", "document", "body"]).then(bodyNode => {
ok(bodyNode, "A node was returned");
gWalker.querySelector(gWalker.rootNode, "body").then(node => {
is(bodyNode, node, "The body node was returned");
runNextTest();
});
});
});
addTest(function() {
gWalker = null;
runNextTest();
});
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1155653">Mozilla Bug 1155653</a>
<a id="inspectorContent" target="_blank" href="inspector_getImageData.html">Test Document</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>