mirror of
https://github.com/classilla/tenfourfox.git
synced 2026-04-21 20:17:34 +00:00
46 lines
1.3 KiB
HTML
46 lines
1.3 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
Test Tree's autoExpandDepth.
|
|
-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Tree component test</title>
|
|
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
|
|
</head>
|
|
<body>
|
|
<pre id="test">
|
|
<script src="head.js" type="application/javascript;version=1.8"></script>
|
|
<script type="application/javascript;version=1.8">
|
|
window.onload = Task.async(function* () {
|
|
try {
|
|
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
|
|
let React = browserRequire("devtools/client/shared/vendor/react");
|
|
let Tree = React.createFactory(browserRequire("devtools/client/shared/components/tree"));
|
|
|
|
const tree = ReactDOM.render(Tree(TEST_TREE_INTERFACE), window.document.body);
|
|
|
|
yield setProps(tree, {
|
|
autoExpandDepth: 1
|
|
});
|
|
|
|
isRenderedTree(document.body.textContent, [
|
|
"A:false",
|
|
"-B:false",
|
|
"-C:false",
|
|
"-D:false",
|
|
"M:false",
|
|
"-N:false",
|
|
], "Tree should be auto expanded one level");
|
|
} catch(e) {
|
|
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
|
} finally {
|
|
SimpleTest.finish();
|
|
}
|
|
});
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|