Bug 1443184 - update browser_markup_accessibility_semantics.js to use async/await. r=ochameau
authoryulia <ystartsev@mozilla.com>
Thu, 05 Apr 2018 11:10:39 +0200
changeset 412599 8a9f8278bf31e93e7277a4a6a9adb53845419918
parent 412571 6ced908a1f35ac4544e6a01bdc8edbc98c6db1bf
child 412600 d186bcce12353c5e51ec1857d24fac367003564c
push id33813
push userccoroiu@mozilla.com
push dateTue, 10 Apr 2018 21:54:55 +0000
treeherdermozilla-central@d42671c2e69d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1443184
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 1443184 - update browser_markup_accessibility_semantics.js to use async/await. r=ochameau MozReview-Commit-ID: AzLZwI43YU0
devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js
--- a/devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js
+++ b/devtools/client/inspector/markup/test/browser_markup_accessibility_semantics.js
@@ -4,33 +4,33 @@
 
 "use strict";
 
 // Test that inspector markup view has all expected ARIA properties set and
 // updated.
 
 const TOP_CONTAINER_LEVEL = 3;
 
-add_task(function* () {
-  let {inspector} = yield openInspectorForURL(`
+add_task(async function() {
+  let {inspector} = await openInspectorForURL(`
     data:text/html;charset=utf-8,
     <h1>foo</h1>
     <span>bar</span>
     <ul>
       <li></li>
     </ul>`);
   let markup = inspector.markup;
   let doc = markup.doc;
   let win = doc.defaultView;
 
   let rootElt = markup.getContainer(markup._rootNode).elt;
-  let bodyContainer = yield getContainerForSelector("body", inspector);
-  let spanContainer = yield getContainerForSelector("span", inspector);
-  let headerContainer = yield getContainerForSelector("h1", inspector);
-  let listContainer = yield getContainerForSelector("ul", inspector);
+  let bodyContainer = await getContainerForSelector("body", inspector);
+  let spanContainer = await getContainerForSelector("span", inspector);
+  let headerContainer = await getContainerForSelector("h1", inspector);
+  let listContainer = await getContainerForSelector("ul", inspector);
 
   // Focus on the tree element.
   rootElt.focus();
 
   // Test tree related semantics
   is(rootElt.getAttribute("role"), "tree",
     "Root container should have tree semantics");
   is(rootElt.getAttribute("aria-dropeffect"), "none",
@@ -66,33 +66,33 @@ add_task(function* () {
   ok(!spanContainer.tagLine.hasAttribute("aria-expanded"),
     "Non expandable tree items should not have aria-expanded attribute");
   ok(!headerContainer.tagLine.hasAttribute("aria-expanded"),
     "Non expandable tree items should not have aria-expanded attribute");
   is(listContainer.tagLine.getAttribute("aria-expanded"), "false",
     "Closed tree item should have aria-expanded unset");
 
   info("Selecting and expanding list container");
-  yield selectNode("ul", inspector);
+  await selectNode("ul", inspector);
   EventUtils.synthesizeKey("VK_RIGHT", {}, win);
-  yield waitForMultipleChildrenUpdates(inspector);
+  await waitForMultipleChildrenUpdates(inspector);
 
   is(rootElt.getAttribute("aria-activedescendant"),
     listContainer.tagLine.getAttribute("id"),
     "Active descendant should not be set to list container tagLine");
   is(listContainer.tagLine.getAttribute("aria-expanded"), "true",
     "Open tree item should have aria-expanded set");
-  let listItemContainer = yield getContainerForSelector("li", inspector);
+  let listItemContainer = await getContainerForSelector("li", inspector);
   is(listItemContainer.tagLine.getAttribute("aria-level"),
     TOP_CONTAINER_LEVEL + 1,
     "Grand child container tagLine should have nested level up to date");
   is(listItemContainer.children.getAttribute("role"), "presentation",
     "Container with no children should have its children element ignored by " +
     "accessibility");
 
   info("Collapsing list container");
   EventUtils.synthesizeKey("VK_LEFT", {}, win);
-  yield waitForMultipleChildrenUpdates(inspector);
+  await waitForMultipleChildrenUpdates(inspector);
 
   is(listContainer.tagLine.getAttribute("aria-expanded"), "false",
     "Closed tree item should have aria-expanded unset");
 });