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">
<title>Test for Bug </title>
<script type="application/javascript" src="inspector-helpers.js"></script>
<script type="application/javascript">
"use strict";
window.onload = function() {
SimpleTest.waitForExplicitFinish();
runNextTest();
};
let gWalker = null;
let gStyles = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = await target.getFront("inspector");
gWalker = inspector.walker;
gStyles = await inspector.getPageStyle();
runNextTest();
});
addTest(function inheritedUserStyles() {
promiseDone(gWalker.querySelector(gWalker.rootNode, "#svgcontent rect").then(node => {
return gStyles.getApplied(node, { inherited: true, filter: "user" });
}).then(applied => {
is(applied.length, 2, "Should have 2 rules");
is(applied[1].rule.cssText, "fill: rgb(1, 2, 3);", "cssText is right");
}).then(runNextTest));
});
addTest(function cleanup() {
gStyles = null;
gWalker = null;
runNextTest();
});
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=921191">Mozilla Bug 921191</a>
<a id="inspectorContent" target="_blank" href="inspector-styles-data.html">Test Document</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>