Bug 1237254 - Wait for focus event before checking the focus element in browser_profiler_tree-abstract-01.js, r=me a=testonly
authorVictor Porof <vporof@mozilla.com>
Thu, 07 Jan 2016 19:00:34 +0200
changeset 310801 90f795fffbc5f717f535ceb9295a7cfebb0eb539
parent 310800 d1b01bbed820cba873eb309e55209f3066f40aef
child 310802 fe7c8dfd0137bc59fdc36c1e32831632b1ab81ad
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, testonly
bugs1237254
milestone45.0a2
Bug 1237254 - Wait for focus event before checking the focus element in browser_profiler_tree-abstract-01.js, r=me a=testonly
devtools/client/performance/test/browser_profiler_tree-abstract-01.js
--- a/devtools/client/performance/test/browser_profiler_tree-abstract-01.js
+++ b/devtools/client/performance/test/browser_profiler_tree-abstract-01.js
@@ -39,21 +39,24 @@ function* spawnTest() {
   is(treeRoot.target.textContent, "root",
     "The root node's text contents are correct.");
   is(treeRoot.container, container,
     "The root node's container is correct.");
 
   // Expand the root and test the child items...
 
   let receivedExpandEvent = treeRoot.once("expand");
+  let receivedInitialFocusEvent = treeRoot.once("focus");
   EventUtils.sendMouseEvent({ type: "mousedown" }, treeRoot.target.querySelector(".arrow"));
 
   let eventItem = yield receivedExpandEvent;
   is(eventItem, treeRoot,
     "The 'expand' event target is correct.");
+
+  yield receivedInitialFocusEvent;
   is(document.commandDispatcher.focusedElement, treeRoot.target,
     "The root node is now focused.");
 
   let fooItem = treeRoot.getChild(0);
   let barItem = treeRoot.getChild(1);
 
   is(container.childNodes.length, 3,
     "The container node should now have three children available.");