Bug 1312236 - Fix Memory tool for React 15 update r=jsnajdr
authorGreg Tatum <tatum.creative@gmail.com>
Mon, 28 Nov 2016 14:38:00 +0100
changeset 324659 98b965a62c11f6b92af704089ea2c6f2945489cc
parent 324658 4a3b9385a2e231be238863c780313351d2d7b263
child 324660 e50389904bee75f75f391b5ea18246a7a5591272
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjsnajdr
bugs1312236
milestone53.0a1
Bug 1312236 - Fix Memory tool for React 15 update r=jsnajdr MozReview-Commit-ID: 97VoPl6tXUy
devtools/client/memory/test/browser/browser_memory_displays_01.js
devtools/client/memory/test/chrome/head.js
devtools/client/memory/test/chrome/test_DominatorTree_03.html
--- a/devtools/client/memory/test/browser/browser_memory_displays_01.js
+++ b/devtools/client/memory/test/browser/browser_memory_displays_01.js
@@ -22,20 +22,21 @@ this.test = makeMemoryTest(TEST_URL, fun
 
   yield takeSnapshot(panel.panelWin);
 
   yield waitUntilState(gStore, state =>
     state.snapshots[0].census &&
     state.snapshots[0].census.state === censusState.SAVED);
 
   info("Check coarse type heap view");
+
   ["Function", "js::Shape", "Object", "strings"].forEach(findNameCell);
 
   yield setCensusDisplay(panel.panelWin, censusDisplays.allocationStack);
   info("Check allocation stack heap view");
   [L10N.getStr("tree-item.nostack")].forEach(findNameCell);
 
   function findNameCell(name) {
-    const el = $$(".tree .heap-tree-item-name span")
+    const el = $$(".tree .heap-tree-item-name")
       .find(e => e.textContent === name);
     ok(el, `Found heap tree item cell for ${name}.`);
   }
 });
--- a/devtools/client/memory/test/chrome/head.js
+++ b/devtools/client/memory/test/chrome/head.js
@@ -313,23 +313,11 @@ function renderComponent(element, contai
     let component = ReactDOM.render(element, container,
       onNextAnimationFrame(() => {
         dumpn("Rendered = " + container.innerHTML);
         resolve(component);
       }));
   });
 }
 
-function setState(component, newState) {
-  return new Promise(resolve => {
-    component.setState(newState, onNextAnimationFrame(resolve));
-  });
-}
-
-function setProps(component, newProps) {
-  return new Promise(resolve => {
-    component.setProps(newProps, onNextAnimationFrame(resolve));
-  });
-}
-
 function dumpn(msg) {
   dump(`MEMORY-TEST: ${msg}\n`);
 }
--- a/devtools/client/memory/test/chrome/test_DominatorTree_03.html
+++ b/devtools/client/memory/test/chrome/test_DominatorTree_03.html
@@ -43,24 +43,26 @@ Test that expanded DominatorTreeItems ar
                 })), container);
             ok(true, "Dominator tree rendered");
 
             is(container.querySelectorAll(".tree-node").length, 2,
                 "Should display two rows");
             is(container.querySelectorAll(".arrow.open").length, 1,
                 "Should display one expanded arrow");
 
-            yield setProps(component, immutableUpdate(
-              TEST_DOMINATOR_TREE_PROPS,
-              {
-                dominatorTree: immutableUpdate(
-                  TEST_DOMINATOR_TREE_PROPS.dominatorTree,
-                  { expanded: new Set(), root }
-                )
-              }));
+            yield renderComponent(
+              DominatorTreeComponent(immutableUpdate(
+                TEST_DOMINATOR_TREE_PROPS,
+                {
+                  dominatorTree: immutableUpdate(
+                    TEST_DOMINATOR_TREE_PROPS.dominatorTree,
+                    { expanded: new Set(), root }
+                  )
+                })), container);
+
             ok(true, "Dominator tree props updated to collapse all nodes");
 
             is(container.querySelectorAll(".tree-node").length, 1,
                 "Should display only one row");
             is(container.querySelectorAll(".arrow.open").length, 0,
                 "Should display no expanded arrow");
 
           } catch(e) {