Bug 1442153 - Convert browser_inspector_expand-collapse.js to async/await. r=ochameau
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 01 Mar 2018 00:23:36 -0800
changeset 409955 0a61a8fd3866b2a7a17bf866c9aaab8bff434c0b
parent 409954 a1bb89af06bac4d352fb2aca23fbe054a560e94e
child 409956 2924f11425af1640752793b06cf0528189687e45
push id61698
push userystartsev@mozilla.com
push dateMon, 26 Mar 2018 15:08:32 +0000
treeherderautoland@0a61a8fd3866 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1442153
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1442153 - Convert browser_inspector_expand-collapse.js to async/await. r=ochameau MozReview-Commit-ID: 39FYLGiDJCy
devtools/client/inspector/test/browser_inspector_expand-collapse.js
--- a/devtools/client/inspector/test/browser_inspector_expand-collapse.js
+++ b/devtools/client/inspector/test/browser_inspector_expand-collapse.js
@@ -4,27 +4,27 @@
 
 "use strict";
 
 // Tests that context menu items exapnd all and collapse are shown properly.
 
 const TEST_URL = "data:text/html;charset=utf-8," +
                  "<div id='parent-node'><div id='child-node'></div></div>";
 
-add_task(function* () {
+add_task(async function() {
   // Test is often exceeding time-out threshold, similar to Bug 1137765
   requestLongerTimeout(2);
 
-  let {inspector} = yield openInspectorForURL(TEST_URL);
+  let {inspector} = await openInspectorForURL(TEST_URL);
 
   info("Selecting the parent node");
 
-  let front = yield getNodeFrontForSelector("#parent-node", inspector);
+  let front = await getNodeFrontForSelector("#parent-node", inspector);
 
-  yield selectNode(front, inspector);
+  await selectNode(front, inspector);
 
   info("Simulating context menu click on the selected node container.");
   let allMenuItems = openContextMenuAndGetAllItems(inspector, {
     target: getContainerForNodeFront(front, inspector).tagLine,
   });
   let nodeMenuCollapseElement =
     allMenuItems.find(item => item.id === "node-menu-collapse");
   let nodeMenuExpandElement =
@@ -32,33 +32,33 @@ add_task(function* () {
 
   ok(nodeMenuCollapseElement.disabled, "Collapse option is disabled");
   ok(!nodeMenuExpandElement.disabled, "ExpandAll option is enabled");
 
   info("Testing whether expansion works properly");
   nodeMenuExpandElement.click();
 
   info("Waiting for expansion to occur");
-  yield waitForMultipleChildrenUpdates(inspector);
+  await waitForMultipleChildrenUpdates(inspector);
   let markUpContainer = getContainerForNodeFront(front, inspector);
   ok(markUpContainer.expanded, "node has been successfully expanded");
 
   // reselecting node after expansion
-  yield selectNode(front, inspector);
+  await selectNode(front, inspector);
 
   info("Testing whether collapse works properly");
   info("Simulating context menu click on the selected node container.");
   allMenuItems = openContextMenuAndGetAllItems(inspector, {
     target: getContainerForNodeFront(front, inspector).tagLine,
   });
   nodeMenuCollapseElement =
     allMenuItems.find(item => item.id === "node-menu-collapse");
   nodeMenuExpandElement =
     allMenuItems.find(item => item.id === "node-menu-expand");
 
   ok(!nodeMenuCollapseElement.disabled, "Collapse option is enabled");
   ok(!nodeMenuExpandElement.disabled, "ExpandAll option is enabled");
   nodeMenuCollapseElement.click();
 
   info("Waiting for collapse to occur");
-  yield waitForMultipleChildrenUpdates(inspector);
+  await waitForMultipleChildrenUpdates(inspector);
   ok(!markUpContainer.expanded, "node has been successfully collapsed");
 });