Bug 1874684 - Part 4: Prefer const references instead of copying Instant values....
[gecko.git] / devtools / client / memory / test / chrome / test_DominatorTree_01.html
blob0067a0f412e3e265b0d838d055c46b862cb03314
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 Test that we show a place holder for a subtree we are lazily fetching.
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Tree component test</title>
9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
11 </head>
12 <body>
13 <!-- Give the container height so that the whole tree is rendered. -->
14 <div id="container" style="height: 900px;"></div>
16 <pre id="test">
17 <script src="head.js" type="application/javascript"></script>
18 <script type="application/javascript">
19 "use strict";
20 window.onload = async function() {
21 try {
22 const container = document.getElementById("container");
24 const root = makeTestDominatorTreeNode({ moreChildrenAvailable: true});
25 ok(!root.children);
27 const expanded = new Set();
28 expanded.add(root.nodeId);
30 await renderComponent(DominatorTreeComponent(immutableUpdate(
31 TEST_DOMINATOR_TREE_PROPS, {
32 dominatorTree: immutableUpdate(TEST_DOMINATOR_TREE_PROPS.dominatorTree, {
33 expanded,
34 root,
35 state: dominatorTreeState.INCREMENTAL_FETCHING,
36 activeFetchRequestCount: 1,
37 }),
38 })), container);
40 ok(container.querySelector(".subtree-fetching"),
41 "Expanded nodes with more children available, but no children " +
42 "loaded, should get a placeholder");
43 } catch (e) {
44 ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
45 } finally {
46 SimpleTest.finish();
49 </script>
50 </pre>
51 </body>
52 </html>