Bug 1453881: Part 1a - Automatically write add_task(function*) to add_task(async function) r=ochameau
authorKris Maglione <maglione.k@gmail.com>
Thu, 12 Apr 2018 21:10:04 -0700
changeset 467722 56c287941f2a60a7ea18baf45ffc526c4cd137e2
parent 467721 73615fe67ab6424c9334f95c39a74fc224977993
child 467723 b05440a8fe3fbb8406354eaadfb213760c2723b3
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1453881
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 1453881: Part 1a - Automatically write add_task(function*) to add_task(async function) r=ochameau This was done using the script at: https://bitbucket.org/kmaglione/m-c-rewrites/src/bc5629735d8c7e4150f376d4a906e7c7c23132ba/processors/add-task-async.jsm?at=default&fileviewer=file-view-default MozReview-Commit-ID: KxuS9Cen87
browser/components/syncedtabs/test/browser/head.js
browser/modules/test/unit/test_SitePermissions.js
devtools/client/aboutdebugging/test/test_addon_path.js
devtools/client/commandline/test/browser_cmd_csscoverage_oneshot.js
devtools/client/commandline/test/browser_cmd_csscoverage_startstop.js
devtools/client/commandline/test/browser_cmd_csscoverage_util.js
devtools/client/debugger/test/mochitest/browser_dbg_on-pause-raise.js
devtools/client/debugger/test/mochitest/browser_dbg_post-page.js
devtools/client/debugger/test/mochitest/browser_dbg_sources-iframe-reload.js
devtools/client/debugger/test/mochitest/browser_dbg_worker-console-01.js
devtools/client/debugger/test/mochitest/browser_dbg_worker-console-02.js
devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js
devtools/client/debugger/test/mochitest/browser_dbg_worker-console-04.js
devtools/client/debugger/test/mochitest/browser_dbg_worker-window.js
devtools/client/debugger/test/mochitest/head.js
devtools/client/framework/test/browser_toolbox_theme.js
devtools/client/memory/test/unit/test_action-filter-01.js
devtools/client/memory/test/unit/test_action-toggle-inverted.js
devtools/client/memory/test/unit/test_tree-map-01.js
devtools/client/memory/test/unit/test_tree-map-02.js
devtools/client/memory/test/unit/test_utils.js
devtools/client/netmonitor/test/browser_net_resend.js
devtools/client/shared/test/browser_flame-graph-utils-hash.js
devtools/client/shared/test/browser_keycodes.js
devtools/client/shared/test/browser_theme.js
devtools/client/shared/test/unit/test_source-utils.js
devtools/client/storage/test/browser_storage_file_url.js
devtools/client/storage/test/browser_storage_localstorage_rapid_add_remove.js
devtools/client/webconsole/test/mochitest/browser_webconsole_stacktrace_location_debugger_link.js
devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
devtools/shared/tests/browser/browser_l10n_localizeMarkup.js
mobile/android/components/extensions/test/mochitest/test_ext_browserAction_onClicked.html
mobile/android/components/extensions/test/mochitest/test_ext_tab_runtimeConnect.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_captureVisibleTab.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_create.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_events.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_bad.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_good.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_no_create.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_runAt.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_insertCSS.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_onUpdated.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload_bypass_cache.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_sendMessage.html
mobile/android/components/extensions/test/mochitest/test_ext_tabs_update_url.html
mobile/android/tests/browser/chrome/test_about_logins.html
mobile/android/tests/browser/chrome/test_accounts.html
mobile/android/tests/browser/chrome/test_desktop_useragent.html
mobile/android/tests/browser/chrome/test_get_last_visited.html
mobile/android/tests/browser/chrome/test_home_provider.html
mobile/android/tests/browser/chrome/test_media_playback.html
mobile/android/tests/browser/chrome/test_offline_page.html
mobile/android/tests/browser/chrome/test_reader_view.html
mobile/android/tests/browser/chrome/test_resource_substitutions.html
mobile/android/tests/browser/chrome/test_selectoraddtab.html
mobile/android/tests/browser/chrome/test_session_clear_history.html
mobile/android/tests/browser/chrome/test_session_form_data.html
mobile/android/tests/browser/chrome/test_session_parentid.html
mobile/android/tests/browser/chrome/test_session_scroll_position.html
mobile/android/tests/browser/chrome/test_session_zombification.html
mobile/android/tests/browser/chrome/test_settings_fontinflation.html
mobile/android/tests/browser/chrome/test_shared_preferences.html
mobile/android/tests/browser/chrome/test_web_channel.html
mobile/android/tests/browser/robocop/testAccessibleCarets.js
mobile/android/tests/browser/robocop/testFindInPage.js
mobile/android/tests/browser/robocop/testHistoryService.js
mobile/android/tests/browser/robocop/testReadingListCache.js
mobile/android/tests/browser/robocop/testRuntimePermissionsAPI.js
mobile/android/tests/browser/robocop/testSnackbarAPI.js
mobile/android/tests/browser/robocop/testTrackingProtection.js
testing/mochitest/chrome/test_sanityAddTask.xul
testing/mochitest/tests/Harness_sanity/test_add_task.html
toolkit/components/extensions/test/mochitest/test_ext_webrequest_redirect_data_uri.html
toolkit/components/extensions/test/mochitest/test_ext_webrequest_upgrade.html
toolkit/components/normandy/test/unit/test_SandboxManager.js
toolkit/modules/tests/xpcshell/test_Log.js
widget/headless/tests/test_headless.js
--- a/browser/components/syncedtabs/test/browser/head.js
+++ b/browser/components/syncedtabs/test/browser/head.js
@@ -2,12 +2,12 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 
 // Load mocking/stubbing library, sinon
 // docs: http://sinonjs.org/docs/
 /* global sinon */
 Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js");
 
-registerCleanupFunction(function* () {
+registerCleanupFunction(async function() {
   // Cleanup window or the test runner will throw an error
   delete window.sinon;
 });
--- a/browser/modules/test/unit/test_SitePermissions.js
+++ b/browser/modules/test/unit/test_SitePermissions.js
@@ -143,17 +143,17 @@ add_task(async function testExactHostMat
     Assert.equal(SitePermissions.get(subUri, permission).state, SitePermissions.PROMPT);
     Assert.equal(SitePermissions.get(uri, permission).state, SitePermissions.ALLOW);
 
     SitePermissions.remove(subUri, permission);
     SitePermissions.remove(uri, permission);
   }
 });
 
-add_task(function* testDefaultPrefs() {
+add_task(async function testDefaultPrefs() {
   let uri = Services.io.newURI("https://example.com");
 
   // Check that without a pref the default return value is UNKNOWN.
   Assert.deepEqual(SitePermissions.get(uri, "camera"), {
     state: SitePermissions.UNKNOWN,
     scope: SitePermissions.SCOPE_PERSISTENT,
   });
 
--- a/devtools/client/aboutdebugging/test/test_addon_path.js
+++ b/devtools/client/aboutdebugging/test/test_addon_path.js
@@ -1,16 +1,16 @@
 /* global equal */
 
 "use strict";
 
 const { parseFileUri } =
   require("devtools/client/aboutdebugging/modules/addon");
 
-add_task(function* testParseFileUri() {
+add_task(async function testParseFileUri() {
   equal(
     parseFileUri("file:///home/me/my-extension/"),
     "/home/me/my-extension/",
     "UNIX paths are supported");
 
   equal(
     parseFileUri("file:///C:/Documents/my-extension/"),
     "C:/Documents/my-extension/",
--- a/devtools/client/commandline/test/browser_cmd_csscoverage_oneshot.js
+++ b/devtools/client/commandline/test/browser_cmd_csscoverage_oneshot.js
@@ -9,34 +9,34 @@ const PAGE_1 = TEST_BASE_HTTPS + "browse
 const PAGE_2 = TEST_BASE_HTTPS + "browser_cmd_csscoverage_page2.html";
 const PAGE_3 = TEST_BASE_HTTPS + "browser_cmd_csscoverage_page3.html";
 
 const SHEET_A = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetA.css";
 const SHEET_B = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetB.css";
 const SHEET_C = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetC.css";
 const SHEET_D = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetD.css";
 
-add_task(function* () {
-  let options = yield helpers.openTab(PAGE_3);
-  yield helpers.openToolbar(options);
+add_task(async function() {
+  let options = await helpers.openTab(PAGE_3);
+  await helpers.openToolbar(options);
 
-  let usage = yield csscoverage.getUsage(options.target);
+  let usage = await csscoverage.getUsage(options.target);
 
-  yield navigate(usage, options);
-  yield checkPages(usage);
-  yield checkEditorReport(usage);
+  await navigate(usage, options);
+  await checkPages(usage);
+  await checkEditorReport(usage);
   // usage.createPageReport is not supported for usage.oneshot data as of
   // bug 1035300 because the page report assumed we have preload data which
   // oneshot can't gather. The ideal solution is to have a special no-preload
   // mode for the page report, but since oneshot isn't needed for the UI to
   // function, we're currently not supporting page report for oneshot data
   // yield checkPageReport(usage);
 
-  yield helpers.closeToolbar(options);
-  yield helpers.closeTab(options);
+  await helpers.closeToolbar(options);
+  await helpers.closeTab(options);
 });
 
 /**
  * Just check current page
  */
 function* navigate(usage, options) {
   ok(!usage.isRunning(), "csscoverage is not running");
 
--- a/devtools/client/commandline/test/browser_cmd_csscoverage_startstop.js
+++ b/devtools/client/commandline/test/browser_cmd_csscoverage_startstop.js
@@ -10,29 +10,29 @@ const PAGE_1 = TEST_BASE_HTTPS + "browse
 const PAGE_2 = TEST_BASE_HTTPS + "browser_cmd_csscoverage_page2.html";
 const PAGE_3 = TEST_BASE_HTTPS + "browser_cmd_csscoverage_page3.html";
 
 const SHEET_A = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetA.css";
 const SHEET_B = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetB.css";
 const SHEET_C = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetC.css";
 const SHEET_D = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetD.css";
 
-add_task(function* () {
-  let options = yield helpers.openTab("about:blank");
-  yield helpers.openToolbar(options);
+add_task(async function() {
+  let options = await helpers.openTab("about:blank");
+  await helpers.openToolbar(options);
 
-  let usage = yield csscoverage.getUsage(options.target);
+  let usage = await csscoverage.getUsage(options.target);
 
-  yield navigate(usage, options);
-  yield checkPages(usage);
-  yield checkEditorReport(usage);
-  yield checkPageReport(usage);
+  await navigate(usage, options);
+  await checkPages(usage);
+  await checkEditorReport(usage);
+  await checkPageReport(usage);
 
-  yield helpers.closeToolbar(options);
-  yield helpers.closeTab(options);
+  await helpers.closeToolbar(options);
+  await helpers.closeTab(options);
 });
 
 /**
  * Visit all the pages in the test
  */
 function* navigate(usage, options) {
   yield usage.start(options.chromeWindow, options.target);
 
--- a/devtools/client/commandline/test/browser_cmd_csscoverage_util.js
+++ b/devtools/client/commandline/test/browser_cmd_csscoverage_util.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that the addon commands works as they should
 
 const csscoverage = require("devtools/server/actors/csscoverage");
 
-add_task(function* () {
+add_task(async function() {
   testDeconstructRuleId();
 });
 
 function testDeconstructRuleId() {
   // This is the easy case
   let rule = csscoverage.deconstructRuleId("http://thing/blah|10|20");
   is(rule.url, "http://thing/blah", "1 url");
   is(rule.line, 10, "1 line");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_on-pause-raise.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_on-pause-raise.js
@@ -4,49 +4,49 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that the toolbox is raised when the debugger gets paused.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
 
-add_task(function *() {
+add_task(async function() {
   let options = {
     source: TAB_URL,
     line: 1
   };
-  let [tab,, panel] = yield initDebugger(TAB_URL, options);
+  let [tab,, panel] = await initDebugger(TAB_URL, options);
   let panelWin = panel.panelWin;
   let toolbox = panel._toolbox;
   let toolboxTab = toolbox.doc.getElementById("toolbox-tab-jsdebugger");
 
-  let newTab = yield addTab(TAB_URL);
+  let newTab = await addTab(TAB_URL);
   isnot(newTab, tab,
     "The newly added tab is different from the debugger's tab.");
   is(gBrowser.selectedTab, newTab,
     "Debugger's tab is not the selected tab.");
 
   info("Run tests against bottom host.");
-  yield testPause();
-  yield testResume();
+  await testPause();
+  await testResume();
 
   // testResume selected the console, select back the debugger.
-  yield toolbox.selectTool("jsdebugger");
+  await toolbox.selectTool("jsdebugger");
 
   info("Switching to a toolbox window host.");
-  yield toolbox.switchHost(Toolbox.HostType.WINDOW);
+  await toolbox.switchHost(Toolbox.HostType.WINDOW);
 
   info("Run tests against window host.");
-  yield testPause();
-  yield testResume();
+  await testPause();
+  await testResume();
 
   info("Cleanup after the test.");
-  yield toolbox.switchHost(Toolbox.HostType.BOTTOM);
-  yield closeDebuggerAndFinish(panel);
+  await toolbox.switchHost(Toolbox.HostType.BOTTOM);
+  await closeDebuggerAndFinish(panel);
 
   function* testPause() {
     is(panelWin.gThreadClient.paused, false,
       "Should be running after starting the test.");
 
     let onFocus, onTabSelect;
     if (toolbox.hostType == Toolbox.HostType.WINDOW) {
       onFocus = new Promise(done => {
--- a/devtools/client/debugger/test/mochitest/browser_dbg_post-page.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_post-page.js
@@ -8,49 +8,49 @@
  */
 
 const TAB_URL = EXAMPLE_URL + "sjs_post-page.sjs";
 
 const FORM = "<form method=\"POST\"><input type=\"submit\"></form>";
 const GET_CONTENT = "<script>\"GET\";</script>" + FORM;
 const POST_CONTENT = "<script>\"POST\";</script>" + FORM;
 
-add_task(function* () {
+add_task(async function() {
   // Disable rcwn to make cache behavior deterministic.
-  yield pushPref("network.http.rcwn.enabled", false);
+  await pushPref("network.http.rcwn.enabled", false);
 
   let options = {
     source: TAB_URL,
     line: 1
   };
-  let [tab,, panel] = yield initDebugger(TAB_URL, options);
+  let [tab,, panel] = await initDebugger(TAB_URL, options);
   let win = panel.panelWin;
   let editor = win.DebuggerView.editor;
   let queries = win.require("./content/queries");
   let getState = win.DebuggerController.getState;
 
   let source = queries.getSelectedSource(getState());
 
   is(queries.getSourceCount(getState()), 1,
     "There should be one source displayed in the view.");
   is(source.url, TAB_URL,
     "The correct source is currently selected in the view.");
   is(editor.getText(), GET_CONTENT,
     "The currently shown source contains bacon. Mmm, delicious!");
 
   // Submit the form and wait for debugger update
   let onSourceUpdated = waitForSourceShown(panel, TAB_URL);
-  yield ContentTask.spawn(tab.linkedBrowser, null, function () {
+  await ContentTask.spawn(tab.linkedBrowser, null, function () {
     content.document.querySelector("input[type=\"submit\"]").click();
   });
-  yield onSourceUpdated;
+  await onSourceUpdated;
 
   // Verify that the source updates to the POST page content
   source = queries.getSelectedSource(getState());
   is(queries.getSourceCount(getState()), 1,
     "There should be one source displayed in the view.");
   is(source.url, TAB_URL,
     "The correct source is currently selected in the view.");
   is(editor.getText(), POST_CONTENT,
     "The currently shown source contains bacon. Mmm, delicious!");
 
-  yield closeDebuggerAndFinish(panel);
+  await closeDebuggerAndFinish(panel);
 });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_sources-iframe-reload.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_sources-iframe-reload.js
@@ -9,27 +9,27 @@
 
 "use strict";
 
 const IFRAME_URL = "data:text/html;charset=utf-8," +
   "<script>function fn() { console.log('hello'); }</script>" +
   "<div onclick='fn()'>hello</div>";
 const TAB_URL = `data:text/html;charset=utf-8,<iframe src="${IFRAME_URL}"/>`;
 
-add_task(function* () {
-  let [,, panel] = yield initDebugger();
+add_task(async function() {
+  let [,, panel] = await initDebugger();
   let dbg = panel.panelWin;
   let newSource;
 
   newSource = waitForDebuggerEvents(panel, dbg.EVENTS.NEW_SOURCE);
   reload(panel, TAB_URL);
-  yield newSource;
+  await newSource;
   ok(true, "Source event fired on initial load");
 
   for (let i = 0; i < 5; i++) {
     newSource = waitForDebuggerEvents(panel, dbg.EVENTS.NEW_SOURCE);
     reload(panel);
-    yield newSource;
+    await newSource;
     ok(true, `Source event fired after ${i + 1} reloads`);
   }
 
-  yield closeDebuggerAndFinish(panel);
+  await closeDebuggerAndFinish(panel);
 });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-01.js
@@ -1,21 +1,21 @@
 // Check to make sure that a worker can be attached to a toolbox
 // and that the console works.
 
 var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
 var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
 
-add_task(function* testNormalExecution() {
+add_task(async function testNormalExecution() {
   let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
-    yield initWorkerDebugger(TAB_URL, WORKER_URL);
+    await initWorkerDebugger(TAB_URL, WORKER_URL);
 
-  let jsterm = yield getSplitConsole(toolbox);
-  let executed = yield jsterm.execute("this.location.toString()");
+  let jsterm = await getSplitConsole(toolbox);
+  let executed = await jsterm.execute("this.location.toString()");
   ok(executed.textContent.includes(WORKER_URL),
       "Evaluating the global's location works");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  yield waitForWorkerClose(workerClient);
-  yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
-  yield close(client);
-  yield removeTab(tab);
+  await waitForWorkerClose(workerClient);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await close(client);
+  await removeTab(tab);
 });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-02.js
@@ -1,58 +1,58 @@
 // Check to make sure that a worker can be attached to a toolbox
 // and that the console works.
 
 var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
 var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
 
-add_task(function* testWhilePaused() {
+add_task(async function testWhilePaused() {
   let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
-    yield initWorkerDebugger(TAB_URL, WORKER_URL);
+    await initWorkerDebugger(TAB_URL, WORKER_URL);
 
   let gTarget = gDebugger.gTarget;
   let gResumeButton = gDebugger.document.getElementById("resume");
   let gResumeKey = gDebugger.document.getElementById("resumeKey");
 
   // Execute some basic math to make sure evaluations are working.
-  let jsterm = yield getSplitConsole(toolbox);
-  let executed = yield jsterm.execute("10000+1");
+  let jsterm = await getSplitConsole(toolbox);
+  let executed = await jsterm.execute("10000+1");
   ok(executed.textContent.includes("10001"), "Text for message appeared correct");
 
   // Pause the worker by waiting for next execution and then sending a message to
   // it from the main thread.
   let oncePaused = gTarget.once("thread-paused");
   EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
   once(gDebugger.gClient, "willInterrupt").then(() => {
     info("Posting message to worker, then waiting for a pause");
     postMessageToWorkerInTab(tab, WORKER_URL, "ping");
   });
-  yield oncePaused;
+  await oncePaused;
 
   let command1 = jsterm.execute("10000+2");
   let command2 = jsterm.execute("10000+3");
   let command3 = jsterm.execute("foobar"); // throw an error
 
   info("Trying to get the result of command1");
-  executed = yield command1;
+  executed = await command1;
   ok(executed.textContent.includes("10002"),
       "command1 executed successfully");
 
   info("Trying to get the result of command2");
-  executed = yield command2;
+  executed = await command2;
   ok(executed.textContent.includes("10003"),
       "command2 executed successfully");
 
   info("Trying to get the result of command3");
-  executed = yield command3;
+  executed = await command3;
   ok(executed.textContent.includes("ReferenceError: foobar is not defined"),
      "command3 executed successfully");
 
   let onceResumed = gTarget.once("thread-resumed");
   EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
-  yield onceResumed;
+  await onceResumed;
 
   terminateWorkerInTab(tab, WORKER_URL);
-  yield waitForWorkerClose(workerClient);
-  yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
-  yield close(client);
-  yield removeTab(tab);
+  await waitForWorkerClose(workerClient);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await close(client);
+  await removeTab(tab);
 });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js
@@ -1,46 +1,46 @@
 // Check to make sure that a worker can be attached to a toolbox
 // and that the console works.
 
 var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
 var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
 
 // Test to see if creating the pause from the console works.
-add_task(function* testPausedByConsole() {
+add_task(async function testPausedByConsole() {
   let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
-    yield initWorkerDebugger(TAB_URL, WORKER_URL);
+    await initWorkerDebugger(TAB_URL, WORKER_URL);
 
   let gTarget = gDebugger.gTarget;
   let gResumeButton = gDebugger.document.getElementById("resume");
   let gResumeKey = gDebugger.document.getElementById("resumeKey");
 
-  let jsterm = yield getSplitConsole(toolbox);
-  let executed = yield jsterm.execute("10000+1");
+  let jsterm = await getSplitConsole(toolbox);
+  let executed = await jsterm.execute("10000+1");
   ok(executed.textContent.includes("10001"),
       "Text for message appeared correct");
 
   let oncePaused = gTarget.once("thread-paused");
   EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
   let pausedExecution = jsterm.execute("10000+2");
 
   info("Executed a command with 'break on next' active, waiting for pause");
-  yield oncePaused;
+  await oncePaused;
 
-  executed = yield jsterm.execute("10000+3");
+  executed = await jsterm.execute("10000+3");
   ok(executed.textContent.includes("10003"),
       "Text for message appeared correct");
 
   info("Waiting for a resume");
   let onceResumed = gTarget.once("thread-resumed");
   EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
-  yield onceResumed;
+  await onceResumed;
 
-  executed = yield pausedExecution;
+  executed = await pausedExecution;
   ok(executed.textContent.includes("10002"),
       "Text for message appeared correct");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  yield waitForWorkerClose(workerClient);
-  yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
-  yield close(client);
-  yield removeTab(tab);
+  await waitForWorkerClose(workerClient);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await close(client);
+  await removeTab(tab);
 });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-04.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-04.js
@@ -5,29 +5,29 @@
 // There are shutdown issues for which multiple rejections are left uncaught.
 // See bug 1018184 for resolving these issues.
 const { PromiseTestUtils } = scopedCuImport("resource://testing-common/PromiseTestUtils.jsm");
 PromiseTestUtils.whitelistRejectionsGlobally(/connection just closed/);
 
 const TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
 const WORKER_URL = "code_WorkerActor.attachThread-worker.js";
 
-add_task(function* testPausedByConsole() {
+add_task(async function testPausedByConsole() {
   let {client, tab, workerClient, toolbox} =
-    yield initWorkerDebugger(TAB_URL, WORKER_URL);
+    await initWorkerDebugger(TAB_URL, WORKER_URL);
 
   info("Check Date objects can be used in the console");
-  let jsterm = yield getSplitConsole(toolbox);
-  let executed = yield jsterm.execute("new Date(0)");
+  let jsterm = await getSplitConsole(toolbox);
+  let executed = await jsterm.execute("new Date(0)");
   ok(executed.textContent.includes("1970-01-01T00:00:00.000Z"),
       "Text for message appeared correct");
 
   info("Check RegExp objects can be used in the console");
-  executed = yield jsterm.execute("new RegExp('.*')");
+  executed = await jsterm.execute("new RegExp('.*')");
   ok(executed.textContent.includes("/.*/"),
       "Text for message appeared correct");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  yield waitForWorkerClose(workerClient);
-  yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
-  yield close(client);
-  yield removeTab(tab);
+  await waitForWorkerClose(workerClient);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await close(client);
+  await removeTab(tab);
 });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_worker-window.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-window.js
@@ -6,43 +6,43 @@
 // The following "connectionClosed" rejection should not be left uncaught. This
 // test has been whitelisted until the issue is fixed.
 ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", this);
 PromiseTestUtils.expectUncaughtRejection(/[object Object]/);
 
 var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
 var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
 
-add_task(function* () {
-  yield pushPrefs(["devtools.scratchpad.enabled", true]);
+add_task(async function() {
+  await pushPrefs(["devtools.scratchpad.enabled", true]);
 
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
-  yield connect(client);
+  await connect(client);
 
-  let tab = yield addTab(TAB_URL);
-  let { tabs } = yield listTabs(client);
-  let [, tabClient] = yield attachTab(client, findTab(tabs, TAB_URL));
+  let tab = await addTab(TAB_URL);
+  let { tabs } = await listTabs(client);
+  let [, tabClient] = await attachTab(client, findTab(tabs, TAB_URL));
 
-  yield listWorkers(tabClient);
-  yield createWorkerInTab(tab, WORKER_URL);
+  await listWorkers(tabClient);
+  await createWorkerInTab(tab, WORKER_URL);
 
-  let { workers } = yield listWorkers(tabClient);
-  let [, workerClient] = yield attachWorker(tabClient,
+  let { workers } = await listWorkers(tabClient);
+  let [, workerClient] = await attachWorker(tabClient,
                                              findWorker(workers, WORKER_URL));
 
-  let toolbox = yield gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
+  let toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
                                             "jsdebugger",
                                             Toolbox.HostType.WINDOW);
 
   is(toolbox.hostType, "window", "correct host");
 
-  yield new Promise(done => {
+  await new Promise(done => {
     toolbox.win.parent.addEventListener("message", function onmessage(event) {
       if (event.data.name == "set-host-title") {
         toolbox.win.parent.removeEventListener("message", onmessage);
         done();
       }
     });
   });
   ok(toolbox.win.parent.document.title.includes(WORKER_URL),
@@ -50,13 +50,13 @@ add_task(function* () {
 
   let toolTabs = toolbox.doc.querySelectorAll(".devtools-tab");
   let activeTools = [...toolTabs].map(tab=>tab.getAttribute("data-id"));
 
   is(activeTools.join(","), "webconsole,jsdebugger,scratchpad",
     "Correct set of tools supported by worker");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  yield waitForWorkerClose(workerClient);
-  yield close(client);
+  await waitForWorkerClose(workerClient);
+  await close(client);
 
-  yield toolbox.destroy();
+  await toolbox.destroy();
 });
--- a/devtools/client/debugger/test/mochitest/head.js
+++ b/devtools/client/debugger/test/mochitest/head.js
@@ -30,37 +30,37 @@ promise = require("devtools/shared/depre
 
 const EXAMPLE_URL = "http://example.com/browser/devtools/client/debugger/test/mochitest/";
 const FRAME_SCRIPT_URL = getRootDirectory(gTestPath) + "code_frame-script.js";
 const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/";
 const CHROME_URI = Services.io.newURI(CHROME_URL);
 
 Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
 
-registerCleanupFunction(function* () {
+registerCleanupFunction(async function() {
   Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
 
   info("finish() was called, cleaning up...");
   Services.prefs.setBoolPref("devtools.debugger.log", gEnableLogging);
 
   while (gBrowser && gBrowser.tabs && gBrowser.tabs.length > 1) {
     info("Destroying toolbox.");
     let target = TargetFactory.forTab(gBrowser.selectedTab);
-    yield gDevTools.closeToolbox(target);
+    await gDevTools.closeToolbox(target);
 
     info("Removing tab.");
     gBrowser.removeCurrentTab();
   }
 
   // Properly shut down the server to avoid memory leaks.
   DebuggerServer.destroy();
 
   // Debugger tests use a lot of memory, so force a GC to help fragmentation.
   info("Forcing GC/CC after debugger test.");
-  yield new Promise(resolve => {
+  await new Promise(resolve => {
     Cu.forceGC();
     Cu.forceCC();
     Cu.schedulePreciseGC(resolve);
   });
 });
 
 // Import the GCLI test helper
 var testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
--- a/devtools/client/framework/test/browser_toolbox_theme.js
+++ b/devtools/client/framework/test/browser_toolbox_theme.js
@@ -5,17 +5,17 @@
 
 const PREF_DEVTOOLS_THEME = "devtools.theme";
 
 registerCleanupFunction(() => {
   // Set preferences back to their original values
   Services.prefs.clearUserPref(PREF_DEVTOOLS_THEME);
 });
 
-add_task(function* testDevtoolsTheme() {
+add_task(async function testDevtoolsTheme() {
   info("Checking stylesheet and :root attributes based on devtools theme.");
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
   is(document.getElementById("browser-bottombox").getAttribute("devtoolstheme"), "light",
     "The element has an attribute based on devtools theme.");
   is(document.getElementById("appcontent").getAttribute("devtoolstheme"), "light",
     "The element has an attribute based on devtools theme.");
 
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
--- a/devtools/client/memory/test/unit/test_action-filter-01.js
+++ b/devtools/client/memory/test/unit/test_action-filter-01.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test setting the filter string.
 
 let { setFilterString } = require("devtools/client/memory/actions/filter");
 
-add_task(function* () {
+add_task(async function() {
   let store = Store();
   const { getState, dispatch } = store;
 
   equal(getState().filter, null, "no filter by default");
 
   dispatch(setFilterString("my filter"));
   equal(getState().filter, "my filter", "now we have the expected filter");
 
--- a/devtools/client/memory/test/unit/test_action-toggle-inverted.js
+++ b/devtools/client/memory/test/unit/test_action-toggle-inverted.js
@@ -3,17 +3,17 @@
 
 "use strict";
 
 // Test toggling the top level inversion state of the tree.
 
 const { censusDisplays } = require("devtools/client/memory/constants");
 const { setCensusDisplay } = require("devtools/client/memory/actions/census-display");
 
-add_task(function* () {
+add_task(async function() {
   let store = Store();
   const { getState, dispatch } = store;
 
   dispatch(setCensusDisplay(censusDisplays.allocationStack));
   equal(getState().censusDisplay.inverted, false,
         "not inverted initially");
 
   dispatch(setCensusDisplay(censusDisplays.invertedAllocationStack));
--- a/devtools/client/memory/test/unit/test_tree-map-01.js
+++ b/devtools/client/memory/test/unit/test_tree-map-01.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const { drawBox } = require("devtools/client/memory/components/tree-map/draw");
 
-add_task(function* () {
+add_task(async function() {
   let fillRectValues, strokeRectValues;
   let ctx = {
     fillRect: (...args) => {
       fillRectValues = args;
     },
     strokeRect: (...args) => {
       strokeRectValues = args;
     }
--- a/devtools/client/memory/test/unit/test_tree-map-02.js
+++ b/devtools/client/memory/test/unit/test_tree-map-02.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const { drawText } = require("devtools/client/memory/components/tree-map/draw");
 
-add_task(function* () {
+add_task(async function() {
   // Mock out the Canvas2dContext
   let ctx = {
     fillText: (...args) => fillTextValues.push(args),
     measureText: (text) => {
       let width = text ? text.length * 10 : 0;
       return { width };
     }
   };
--- a/devtools/client/memory/test/unit/test_utils.js
+++ b/devtools/client/memory/test/unit/test_utils.js
@@ -8,17 +8,17 @@
  * taking a snapshot, and its sub-actions. Tests the formatNumber and
  * formatPercent methods.
  */
 
 let utils = require("devtools/client/memory/utils");
 let { snapshotState: states, viewState } = require("devtools/client/memory/constants");
 let { Preferences } = require("resource://gre/modules/Preferences.jsm");
 
-add_task(function* () {
+add_task(async function() {
   let s1 = utils.createSnapshot({ view: { state: viewState.CENSUS } });
   let s2 = utils.createSnapshot({ view: { state: viewState.CENSUS } });
   equal(s1.state, states.SAVING,
         "utils.createSnapshot() creates snapshot in saving state");
   ok(s1.id !== s2.id, "utils.createSnapshot() creates snapshot with unique ids");
 
   let custom = { by: "internalType", then: { by: "count", bytes: true }};
   Preferences.set("devtools.memory.custom-census-displays",
--- a/devtools/client/netmonitor/test/browser_net_resend.js
+++ b/devtools/client/netmonitor/test/browser_net_resend.js
@@ -7,67 +7,67 @@
  * Tests if resending a request works.
  */
 
 const ADD_QUERY = "t1=t2";
 const ADD_HEADER = "Test-header: true";
 const ADD_UA_HEADER = "User-Agent: Custom-Agent";
 const ADD_POSTDATA = "&t3=t4";
 
-add_task(function* () {
-  let { tab, monitor } = yield initNetMonitor(POST_DATA_URL);
+add_task(async function() {
+  let { tab, monitor } = await initNetMonitor(POST_DATA_URL);
   info("Starting test... ");
 
   let { document, store, windowRequire, connector } = monitor.panelWin;
   let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
   let {
     getSelectedRequest,
     getSortedRequests,
   } = windowRequire("devtools/client/netmonitor/src/selectors/index");
 
   store.dispatch(Actions.batchEnable(false));
 
   // Execute requests.
-  yield performRequests(monitor, tab, 2);
+  await performRequests(monitor, tab, 2);
 
   let origItem = getSortedRequests(store.getState()).get(0);
 
   store.dispatch(Actions.selectRequest(origItem.id));
 
   // add a new custom request cloned from selected request
 
   store.dispatch(Actions.cloneSelectedRequest());
   testCustomForm(origItem);
 
   let customItem = getSelectedRequest(store.getState());
   testCustomItem(customItem, origItem);
 
   // edit the custom request
-  yield editCustomForm();
+  await editCustomForm();
 
   // FIXME: reread the customItem, it's been replaced by a new object (immutable!)
   customItem = getSelectedRequest(store.getState());
   testCustomItemChanged(customItem, origItem);
 
   // send the new request
   wait = waitForNetworkEvents(monitor, 1);
   store.dispatch(Actions.sendCustomRequest(connector));
-  yield wait;
+  await wait;
 
   let sentItem;
   // Testing sent request will require updated requestHeaders and requestPostData,
   // we must wait for both properties get updated before starting test.
-  yield waitUntil(() => {
+  await waitUntil(() => {
     sentItem = getSelectedRequest(store.getState());
     origItem = getSortedRequests(store.getState()).get(0);
     return sentItem.requestHeaders && sentItem.requestPostData &&
       origItem.requestHeaders && origItem.requestPostData;
   });
 
-  yield testSentRequest(sentItem, origItem);
+  await testSentRequest(sentItem, origItem);
 
   // Ensure the UI shows the new request, selected, and that the detail panel was closed.
   is(getSortedRequests(store.getState()).length, 3, "There are 3 requests shown");
   is(document.querySelector(".request-list-item.selected").getAttribute("data-id"),
     sentItem.id, "The sent request is selected");
   is(document.querySelector(".network-details-panel"), null,
     "The detail panel is hidden");
 
--- a/devtools/client/shared/test/browser_flame-graph-utils-hash.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-hash.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Tests if (idle) nodes are added when necessary in the flame graph data.
 
 const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
 
-add_task(function* () {
+add_task(async function() {
   let hash1 = FlameGraphUtils._getStringHash("abc");
   let hash2 = FlameGraphUtils._getStringHash("acb");
   let hash3 = FlameGraphUtils._getStringHash(Array.from(Array(100000)).join("a"));
   let hash4 = FlameGraphUtils._getStringHash(Array.from(Array(100000)).join("b"));
 
   isnot(hash1, hash2, "The hashes should not be equal (1).");
   isnot(hash2, hash3, "The hashes should not be equal (2).");
   isnot(hash3, hash4, "The hashes should not be equal (3).");
--- a/devtools/client/shared/test/browser_keycodes.js
+++ b/devtools/client/shared/test/browser_keycodes.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const {KeyCodes} = require("devtools/client/shared/keycodes");
 
-add_task(function* () {
+add_task(async function() {
   for (let key in KeyCodes) {
     is(KeyCodes[key], KeyboardEvent[key], "checking value for " + key);
   }
 });
--- a/devtools/client/shared/test/browser_theme.js
+++ b/devtools/client/shared/test/browser_theme.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 // Tests that theme utilities work
 
 const {getColor, getTheme, setTheme} = require("devtools/client/shared/theme");
 const {PrefObserver} = require("devtools/client/shared/prefs");
 
-add_task(function* () {
+add_task(async function() {
   testGetTheme();
   testSetTheme();
   testGetColor();
   testColorExistence();
 });
 
 function testGetTheme() {
   let originalTheme = getTheme();
--- a/devtools/client/shared/test/unit/test_source-utils.js
+++ b/devtools/client/shared/test/unit/test_source-utils.js
@@ -15,93 +15,93 @@ const CHROME_URLS = [
 ];
 
 const CONTENT_URLS = [
   "http://mozilla.org", "https://mozilla.org", "file:///Users/root", "app://fxosapp",
   "blob:http://mozilla.org", "blob:https://mozilla.org"
 ];
 
 // Test `sourceUtils.parseURL`
-add_task(function* () {
+add_task(async function() {
   let parsed = sourceUtils.parseURL("https://foo.com:8888/boo/bar.js?q=query");
   equal(parsed.fileName, "bar.js", "parseURL parsed valid fileName");
   equal(parsed.host, "foo.com:8888", "parseURL parsed valid host");
   equal(parsed.hostname, "foo.com", "parseURL parsed valid hostname");
   equal(parsed.port, "8888", "parseURL parsed valid port");
   equal(parsed.href, "https://foo.com:8888/boo/bar.js?q=query", "parseURL parsed valid href");
 
   parsed = sourceUtils.parseURL("https://foo.com");
   equal(parsed.host, "foo.com", "parseURL parsed valid host when no port given");
   equal(parsed.hostname, "foo.com", "parseURL parsed valid hostname when no port given");
 
   equal(sourceUtils.parseURL("self-hosted"), null,
         "parseURL returns `null` for invalid URLs");
 });
 
 // Test `sourceUtils.isContentScheme`.
-add_task(function* () {
+add_task(async function() {
   for (let url of CHROME_URLS) {
     ok(!sourceUtils.isContentScheme(url),
        `${url} correctly identified as not content scheme`);
   }
   for (let url of CONTENT_URLS) {
     ok(sourceUtils.isContentScheme(url), `${url} correctly identified as content scheme`);
   }
 });
 
 // Test `sourceUtils.isChromeScheme`.
-add_task(function* () {
+add_task(async function() {
   for (let url of CHROME_URLS) {
     ok(sourceUtils.isChromeScheme(url), `${url} correctly identified as chrome scheme`);
   }
   for (let url of CONTENT_URLS) {
     ok(!sourceUtils.isChromeScheme(url),
        `${url} correctly identified as not chrome scheme`);
   }
 });
 
 // Test `sourceUtils.isWASM`.
-add_task(function* () {
+add_task(async function() {
   ok(sourceUtils.isWASM("wasm-function[66240] (?:13870536)"),
                         "wasm function correctly identified");
   ok(!sourceUtils.isWASM(CHROME_URLS[0]), `A chrome url does not identify as wasm.`);
 });
 
 // Test `sourceUtils.isDataScheme`.
-add_task(function* () {
+add_task(async function() {
   let dataURI = "data:text/html;charset=utf-8,<!DOCTYPE html></html>";
   ok(sourceUtils.isDataScheme(dataURI), `${dataURI} correctly identified as data scheme`);
 
   for (let url of CHROME_URLS) {
     ok(!sourceUtils.isDataScheme(url), `${url} correctly identified as not data scheme`);
   }
   for (let url of CONTENT_URLS) {
     ok(!sourceUtils.isDataScheme(url), `${url} correctly identified as not data scheme`);
   }
 });
 
 // Test `sourceUtils.getSourceNames`.
-add_task(function* () {
+add_task(async function() {
   testAbbreviation("http://example.com/foo/bar/baz/boo.js",
                    "boo.js",
                    "http://example.com/foo/bar/baz/boo.js",
                    "example.com");
 });
 
 // Test `sourceUtils.isScratchpadTheme`
-add_task(function* () {
+add_task(async function() {
   ok(sourceUtils.isScratchpadScheme("Scratchpad/1"),
      "Scratchpad/1 identified as scratchpad");
   ok(sourceUtils.isScratchpadScheme("Scratchpad/20"),
      "Scratchpad/20 identified as scratchpad");
   ok(!sourceUtils.isScratchpadScheme("http://www.mozilla.org"), "http://www.mozilla.org not identified as scratchpad");
 });
 
 // Test `sourceUtils.getSourceNames`.
-add_task(function* () {
+add_task(async function() {
   // Check length
   let longMalformedURL = `example.com${new Array(100).fill("/a").join("")}/file.js`;
   ok(sourceUtils.getSourceNames(longMalformedURL).short.length <= 100,
     "`short` names are capped at 100 characters");
 
   testAbbreviation("self-hosted", "self-hosted", "self-hosted");
   testAbbreviation("", "(unknown)", "(unknown)");
 
@@ -157,17 +157,17 @@ add_task(function* () {
   // Check query with trailing slash
   testAbbreviation("http://example.com/foo/?bar=1&baz=2",
                    "foo",
                    "http://example.com/foo/",
                    "example.com");
 });
 
 // Test for source mapped file name
-add_task(function* () {
+add_task(async function() {
   const { getSourceMappedFile } = sourceUtils;
   const source = "baz.js";
   const output = getSourceMappedFile(source);
   equal(output, "baz.js", "correctly formats file name");
   // Test for OSX file path
   const source1 = "/foo/bar/baz.js";
   const output1 = getSourceMappedFile(source1);
   equal(output1, "baz.js", "correctly formats Linux file path");
--- a/devtools/client/storage/test/browser_storage_file_url.js
+++ b/devtools/client/storage/test/browser_storage_file_url.js
@@ -3,50 +3,50 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from head.js */
 
 // Test to verify that various storage types work when using file:// URLs.
 
 "use strict";
 
-add_task(function* () {
+add_task(async function() {
   const TESTPAGE = "storage-file-url.html";
 
   // We need to load TESTPAGE using a file:// path so we need to get that from
   // the current test path.
   const testPath = getResolvedURI(gTestPath);
   let dir = getChromeDir(testPath);
 
   // Then append TESTPAGE to the test path.
   dir.append(TESTPAGE);
 
   // Then generate a FileURI to ensure the path is valid.
   const uriString = Services.io.newFileURI(dir).spec;
 
   // Now we have a valid file:// URL pointing to TESTPAGE.
-  yield openTabAndSetupStorage(uriString);
+  await openTabAndSetupStorage(uriString);
 
   // uriString points to the test inside objdir e.g.
   // `/path/to/fx/objDir/_tests/testing/mochitest/browser/devtools/client/
   // storage/test/storage-file-url.html`.
   //
   // When opened in the browser this may resolve to a different path e.g.
   // `path/to/fx/repo/devtools/client/storage/test/storage-file-url.html`.
   //
   // The easiest way to get the actual path is to request it from the content
   // process.
   let browser = gBrowser.selectedBrowser;
-  let actualPath = yield ContentTask.spawn(browser, null, () => {
+  let actualPath = await ContentTask.spawn(browser, null, () => {
     return content.document.location.href;
   });
 
   const cookiePath = actualPath.substr(0, actualPath.lastIndexOf("/") + 1)
                                .replace(/file:\/\//g, "");
-  yield checkState([
+  await checkState([
     [
       ["cookies", actualPath],
       [
         getCookieId("test1", "", cookiePath),
         getCookieId("test2", "", cookiePath)
       ]
     ], [
       ["indexedDB", actualPath, "MyDatabase (default)", "MyObjectStore"],
@@ -55,10 +55,10 @@ add_task(function* () {
       ["localStorage", actualPath],
       ["test3", "test4"]
     ], [
       ["sessionStorage", actualPath],
       ["test5", "test6"]
     ]
   ]);
 
-  yield finishTests();
+  await finishTests();
 });
--- a/devtools/client/storage/test/browser_storage_localstorage_rapid_add_remove.js
+++ b/devtools/client/storage/test/browser_storage_localstorage_rapid_add_remove.js
@@ -3,27 +3,27 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from head.js */
 
 // Basic test to check the rapid adding and removing of localStorage entries.
 
 "use strict";
 
-add_task(function* () {
-  yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-blank.html");
-  yield selectTreeItem(["localStorage", "http://test1.example.org"]);
+add_task(async function() {
+  await openTabAndSetupStorage(MAIN_DOMAIN + "storage-blank.html");
+  await selectTreeItem(["localStorage", "http://test1.example.org"]);
 
   ok(isTableEmpty(), "Table empty on init");
 
   for (let i = 0; i < 10; i++) {
-    yield addRemove(`test${i}`);
+    await addRemove(`test${i}`);
   }
 
-  yield finishTests();
+  await finishTests();
 });
 
 function* addRemove(name) {
   yield ContentTask.spawn(gBrowser.selectedBrowser, name, innerName => {
     content.localStorage.setItem(innerName, "true");
     content.localStorage.removeItem(innerName);
   });
 
--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_stacktrace_location_debugger_link.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_stacktrace_location_debugger_link.js
@@ -18,17 +18,17 @@ const TEST_URI = "http://example.com/bro
                  "test/mochitest/" +
                  "test-stacktrace-location-debugger-link.html";
 
 add_task(async function() {
   // Force the new debugger UI, in case this gets uplifted with the old
   // debugger still turned on
   Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", true);
   Services.prefs.setBoolPref("devtools.webconsole.filter.log", true);
-  registerCleanupFunction(function* () {
+  registerCleanupFunction(async function() {
     Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
     Services.prefs.clearUserPref("devtools.webconsole.filter.log");
   });
 
   let hud = await openNewTabAndConsole(TEST_URI);
   let target = TargetFactory.forTab(gBrowser.selectedTab);
   let toolbox = gDevTools.getToolbox(target);
 
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 // Test that the HeapAnalyses{Client,Worker} can send SavedFrame stacks from
 // by-allocation-stack reports from the worker.
 
-add_task(function* test() {
+add_task(async function test() {
   const client = new HeapAnalysesClient();
 
   // Track some allocation stacks.
 
   const g = newGlobal();
   const dbg = new Debugger(g);
   g.eval(`                                                   // 1
          this.log = [];                                      // 2
@@ -35,23 +35,23 @@ add_task(function* test() {
       func();
       dbg.memory.trackingAllocationSites = false;
     }
   }
 
   // Take a heap snapshot.
 
   const snapshotFilePath = saveNewHeapSnapshot({ debugger: dbg });
-  yield client.readHeapSnapshot(snapshotFilePath);
+  await client.readHeapSnapshot(snapshotFilePath);
   ok(true, "Should have read the heap snapshot");
 
   // Run a census broken down by class name -> allocation stack so we can grab
   // only the AllocationMarker objects we have complete control over.
 
-  const { report } = yield client.takeCensus(
+  const { report } = await client.takeCensus(
     snapshotFilePath,
     {
       breakdown: {
         by: "objectClass",
         then: {
           by: "allocationStack",
           then: {
             by: "count",
--- a/devtools/shared/tests/browser/browser_l10n_localizeMarkup.js
+++ b/devtools/shared/tests/browser/browser_l10n_localizeMarkup.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Tests that the markup localization works properly.
 
 const { localizeMarkup, LocalizationHelper } = require("devtools/shared/l10n");
 
-add_task(function* () {
+add_task(async function() {
   info("Check that the strings used for this test are still valid");
   let STARTUP_L10N = new LocalizationHelper("devtools/client/locales/startup.properties");
   let TOOLBOX_L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties");
   let str1 = STARTUP_L10N.getStr("inspector.label");
   let str2 = STARTUP_L10N.getStr("inspector.accesskey");
   let str3 = TOOLBOX_L10N.getStr("toolbox.defaultTitle");
   ok(str1 && str2 && str3, "If this failed, strings should be updated in the test");
 
--- a/mobile/android/components/extensions/test/mochitest/test_ext_browserAction_onClicked.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_browserAction_onClicked.html
@@ -42,53 +42,53 @@ function createExtension(name) {
 
 function* checkBrowserAction(extension, id, tab) {
   ok(BrowserActions.isShown(id), "The BrowerAction should be shown");
   BrowserActions.synthesizeClick(id);
   const clickedTab = yield extension.awaitMessage("browser-action-clicked");
   is(clickedTab.id, tab.id, "Got the expected tab id in the browserAction.onClicked event");
 }
 
-add_task(function* test_browserAction() {
+add_task(async function test_browserAction() {
   const extension = createExtension("BrowserAction Extension");
-  yield extension.startup();
-  const tab = yield extension.awaitMessage("ready");
+  await extension.startup();
+  const tab = await extension.awaitMessage("ready");
   let id = `{${extension.uuid}}`;
-  yield checkBrowserAction(extension, id, tab);
-  yield extension.unload();
+  await checkBrowserAction(extension, id, tab);
+  await extension.unload();
 
   ok(!BrowserActions.isShown(id), "The BrowserAction should be removed after the extension unloads");
 });
 
-add_task(function* test_multiple_browserActions() {
+add_task(async function test_multiple_browserActions() {
   const ext1 = createExtension("BrowserAction Extension 1");
   const ext2 = createExtension("BrowserAction Extension 2");
 
   // Start the first extension and test its browser action.
-  yield ext1.startup();
-  const tab1 = yield ext1.awaitMessage("ready");
+  await ext1.startup();
+  const tab1 = await ext1.awaitMessage("ready");
   let id1 = `{${ext1.uuid}}`;
-  yield checkBrowserAction(ext1, id1, tab1);
+  await checkBrowserAction(ext1, id1, tab1);
 
   // Start the second extension and test its browser action.
-  yield ext2.startup();
-  const tab2 = yield ext2.awaitMessage("ready");
+  await ext2.startup();
+  const tab2 = await ext2.awaitMessage("ready");
   let id2 = `{${ext2.uuid}}`;
-  yield checkBrowserAction(ext2, id2, tab2);
+  await checkBrowserAction(ext2, id2, tab2);
 
   // Verify that the first browser action is still active.
-  yield checkBrowserAction(ext1, id1, tab1);
+  await checkBrowserAction(ext1, id1, tab1);
 
   // Unload the first extension and verify that the browser action is removed.
-  yield ext1.unload();
+  await ext1.unload();
   ok(!BrowserActions.isShown(id1), "The first BrowserAction should be removed after ext1 unloads");
 
   // Verify that the second browser action is still active.
-  yield checkBrowserAction(ext2, id2, tab2);
+  await checkBrowserAction(ext2, id2, tab2);
 
   // Unload the second extension and verify that the browser action is removed.
-  yield ext2.unload();
+  await ext2.unload();
   ok(!BrowserActions.isShown(id2), "The second BrowserAction should be removed after ext2 unloads");
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tab_runtimeConnect.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tab_runtimeConnect.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* () {
+add_task(async function() {
   let win = window.open("http://mochi.test:8888/");
 
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     background: function() {
@@ -72,18 +72,18 @@ add_task(function* () {
           <body>
             <h1>test tab extension page</h1>
           </body>
         </html>
       `,
     },
   });
 
-  yield extension.startup();
-  yield extension.awaitFinish("tabRuntimeConnect.pass");
-  yield extension.unload();
+  await extension.startup();
+  await extension.awaitFinish("tabRuntimeConnect.pass");
+  await extension.unload();
 
   win.close();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_captureVisibleTab.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_captureVisibleTab.html
@@ -128,41 +128,41 @@ function* runTest(options) {
 
   yield extension.awaitFinish("captureVisibleTab");
 
   yield extension.unload();
 
   win.close();
 }
 
-add_task(function* testCaptureVisibleTab() {
-  yield SpecialPowers.pushPrefEnv({
+add_task(async function testCaptureVisibleTab() {
+  await SpecialPowers.pushPrefEnv({
     "set": [["security.data_uri.block_toplevel_data_uri_navigations", false]],
   });
 
-  yield runTest({color: [0, 0, 0]});
+  await runTest({color: [0, 0, 0]});
 
-  yield runTest({color: [255, 255, 255]});
+  await runTest({color: [255, 255, 255]});
 });
 
-add_task(function* testCaptureVisibleTabPermissions() {
+add_task(async function testCaptureVisibleTabPermissions() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     background: function() {
       browser.test.assertEq(undefined, browser.tabs.captureVisibleTab,
                             'Extension without "<all_urls>" permission should not have access to captureVisibleTab');
       browser.test.notifyPass("captureVisibleTabPermissions");
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitFinish("captureVisibleTabPermissions");
+  await extension.awaitFinish("captureVisibleTabPermissions");
 
-  yield extension.unload();
+  await extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_create.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_create.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* () {
+add_task(async function() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
 
       "background": {"page": "bg/background.html"},
     },
 
     files: {
@@ -124,16 +124,16 @@ add_task(function* () {
           activeWindow = tabs[0].windowId;
 
           runTests();
         });
       },
     },
   });
 
-  yield extension.startup();
-  yield extension.awaitFinish("tabs.create");
-  yield extension.unload();
+  await extension.startup();
+  await extension.awaitFinish("tabs.create");
+  await extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_events.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_events.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* testTabEvents() {
+add_task(async function testTabEvents() {
   async function background() {
     let events = [];
     let eventPromise;
     let checkEvents = () => {
       if (eventPromise && events.length >= eventPromise.names.length) {
         eventPromise.resolve();
       }
     };
@@ -93,22 +93,22 @@ add_task(function* testTabEvents() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     background,
   });
 
-  yield extension.startup();
-  yield extension.awaitFinish("tabs-events");
-  yield extension.unload();
+  await extension.startup();
+  await extension.awaitFinish("tabs-events");
+  await extension.unload();
 });
 
-add_task(function* testTabRemovalEvent() {
+add_task(async function testTabRemovalEvent() {
   async function background() {
     function awaitLoad(tabId) {
       return new Promise(resolve => {
         browser.tabs.onUpdated.addListener(function listener(tabId_, changed, tab) {
           if (tabId == tabId_ && changed.status == "complete") {
             browser.tabs.onUpdated.removeListener(listener);
             resolve();
           }
@@ -141,16 +141,16 @@ add_task(function* testTabRemovalEvent()
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     background,
   });
 
-  yield extension.startup();
-  yield extension.awaitFinish("tabs-events");
-  yield extension.unload();
+  await extension.startup();
+  await extension.awaitFinish("tabs-events");
+  await extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript.html
@@ -8,22 +8,22 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* testExecuteScript() {
+add_task(async function testExecuteScript() {
   const BASE = "http://mochi.test:8888/tests/mobile/android/components/extensions/test/mochitest/";
   const URL = BASE + "file_iframe_document.html";
 
   let win = window.open(URL);
-  yield new Promise(resolve => win.addEventListener("load", resolve, {once: true}));
+  await new Promise(resolve => win.addEventListener("load", resolve, {once: true}));
 
   async function background() {
     try {
       let [tab] = await browser.tabs.query({active: true, currentWindow: true});
       let frames = await browser.webNavigation.getAllFrames({tabId: tab.id});
 
       browser.test.log(`FRAMES: ${frames[1].frameId} ${JSON.stringify(frames)}\n`);
       await Promise.all([
@@ -227,20 +227,20 @@ add_task(function* testExecuteScript() {
       },
 
       "script2.js": "27",
 
       "script3.js": "window",
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitFinish("executeScript");
+  await extension.awaitFinish("executeScript");
 
-  yield extension.unload();
+  await extension.unload();
 
   win.close();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_bad.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_bad.html
@@ -72,37 +72,37 @@ function* testHasNoPermission(params) {
   }
 
   extension.sendMessage("execute-script");
 
   yield extension.awaitFinish("executeScript");
   yield extension.unload();
 }
 
-add_task(function* testBadPermissions() {
+add_task(async function testBadPermissions() {
   let win1 = window.open("http://example.com/");
   let win2 = window.open("http://mochi.test:8888/");
 
-  yield new Promise(resolve => setTimeout(resolve, 0));
+  await new Promise(resolve => setTimeout(resolve, 0));
 
   info("Test no special permissions");
-  yield testHasNoPermission({
+  await testHasNoPermission({
     manifest: {"permissions": ["http://example.com/"]},
   });
 
   info("Test tabs permissions");
-  yield testHasNoPermission({
+  await testHasNoPermission({
     manifest: {"permissions": ["http://example.com/", "tabs"]},
   });
 
   win2.close();
   win1.close();
 });
 
-add_task(function* testBadURL() {
+add_task(async function testBadURL() {
   async function background() {
     let promises = [
       new Promise(resolve => {
         browser.tabs.executeScript({
           file: "http://example.com/script.js",
         }, result => {
           browser.test.assertEq(undefined, result, "Result value");
 
@@ -152,21 +152,21 @@ add_task(function* testBadURL() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["<all_urls>"],
     },
 
     background,
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitFinish("executeScript-lastError");
+  await extension.awaitFinish("executeScript-lastError");
 
-  yield extension.unload();
+  await extension.unload();
 });
 
 // TODO: Test that |executeScript| fails if the tab has navigated to a
 // new page, and no longer matches our expected state. This involves
 // intentionally trying to trigger a race condition, and is probably not
 // even worth attempting until we have proper |executeScript| callbacks.
 </script>
 
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_good.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_good.html
@@ -60,31 +60,31 @@ function* testHasPermission(params) {
 
   if (params.tearDown) {
     yield params.tearDown(extension);
   }
 
   yield extension.unload();
 }
 
-add_task(function* testGoodPermissions() {
+add_task(async function testGoodPermissions() {
   let win = window.open("http://mochi.test:8888/");
 
   info("Test explicit host permission");
-  yield testHasPermission({
+  await testHasPermission({
     manifest: {"permissions": ["http://mochi.test/"]},
   });
 
   info("Test explicit host subdomain permission");
-  yield testHasPermission({
+  await testHasPermission({
     manifest: {"permissions": ["http://*.mochi.test/"]},
   });
 
   info("Test explicit <all_urls> permission");
-  yield testHasPermission({
+  await testHasPermission({
     manifest: {"permissions": ["<all_urls>"]},
   });
 
   win.close();
 });
 </script>
 
 </body>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_no_create.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_no_create.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* testExecuteScriptAtOnUpdated() {
+add_task(async function testExecuteScriptAtOnUpdated() {
   const BASE = "http://mochi.test:8888/tests/mobile/android/components/extensions/test/mochitest/";
   const URL = BASE + "file_iframe_document.html";
   // This is a regression test for bug 1325830.
   // The bug (executeScript not completing any more) occurred when executeScript
   // was called early at the onUpdated event, unless the tabs.create method is
   // called. So this test does not use tabs.create to open new tabs.
   // Note that if this test is run together with other tests that do call
   // tabs.create, then this test case does not properly test the conditions of
@@ -60,24 +60,24 @@ add_task(function* testExecuteScriptAtOn
 
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["http://mochi.test/", "tabs"],
     },
     background,
   });
 
-  yield extension.startup();
+  await extension.startup();
 
   extension.sendMessage(URL);
-  yield extension.awaitMessage("open-test-tab");
+  await extension.awaitMessage("open-test-tab");
 
   let tab = window.open(URL);
-  yield extension.awaitFinish("executeScript-at-onUpdated");
+  await extension.awaitFinish("executeScript-at-onUpdated");
 
-  yield extension.unload();
+  await extension.unload();
 
   tab.close();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_runAt.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_executeScript_runAt.html
@@ -20,17 +20,17 @@
  * Since tests of this nature are especially race-prone, it relies on a
  * server-JS script to delay the completion of our test page's load cycle long
  * enough for us to attempt to load our scripts in the earlies phase we support.
  *
  * And since we can't actually rely on that timing, it retries any attempts that
  * fail to load as early as expected, but don't load at any illegal time.
  */
 
-add_task(function* testExecuteScript() {
+add_task(async function testExecuteScript() {
   let win = window.open("about:blank");
 
   async function background(DEBUG) {
     let tab;
 
     const BASE = "http://mochi.test:8888/tests/mobile/android/components/extensions/test/mochitest/";
     const URL = BASE + "file_slowed_document.sjs";
 
@@ -110,20 +110,20 @@ add_task(function* testExecuteScript() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["http://mochi.test/", "tabs"],
     },
 
     background: `(${background})(${AppConstants.DEBUG})`,
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitFinish("executeScript-runAt");
+  await extension.awaitFinish("executeScript-runAt");
 
-  yield extension.unload();
+  await extension.unload();
 
   win.close();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_getCurrent.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* () {
+add_task(async function() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     files: {
       "tab.js": function() {
         let url = document.location.href;
@@ -51,20 +51,20 @@ add_task(function* () {
         browser.test.assertEq(tab, undefined, "getCurrent in background script");
         browser.test.sendMessage("background-finished");
       });
 
       browser.tabs.create({url: "tab.html", active: false});
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitMessage("background-finished");
-  yield extension.awaitMessage("tab-finished");
+  await extension.awaitMessage("background-finished");
+  await extension.awaitMessage("tab-finished");
 
   // The extension tab is automatically closed when the extension unloads.
-  yield extension.unload();
+  await extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_insertCSS.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_insertCSS.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* testExecuteScript() {
+add_task(async function testExecuteScript() {
   let win = window.open("http://mochi.test:8888/");
 
   async function background() {
     let tasks = [
       {
         background: "rgba(0, 0, 0, 0)",
         foreground: "rgb(0, 113, 4)",
         promise: () => {
@@ -98,20 +98,20 @@ add_task(function* testExecuteScript() {
 
     background,
 
     files: {
       "file2.css": "* { color: rgb(0, 113, 4) }",
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitFinish("insertCSS");
+  await extension.awaitFinish("insertCSS");
 
-  yield extension.unload();
+  await extension.unload();
 
   win.close();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_onUpdated.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_onUpdated.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* test_onUpdated() {
+add_task(async function test_onUpdated() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
       "content_scripts": [{
         "matches": ["http://mochi.test/*/context_tabs_onUpdated_page.html"],
         "js": ["content-script.js"],
         "run_at": "document_start",
       }],
@@ -80,22 +80,22 @@ add_task(function* test_onUpdated() {
           if (evt.data == "frame-updated") {
             browser.runtime.sendMessage("load-completed");
           }
         }, true);
       `,
     },
   });
 
-  yield Promise.all([
+  await Promise.all([
     extension.startup(),
     extension.awaitFinish("tabs.onUpdated"),
   ]);
 
-  yield extension.unload();
+  await extension.unload();
 });
 
 function* do_test_update(background, withPermissions = true) {
   let manifest = {};
   if (withPermissions) {
     manifest.permissions = ["tabs", "http://mochi.test/"];
   }
   let extension = ExtensionTestUtils.loadExtension({manifest, background});
@@ -103,18 +103,18 @@ function* do_test_update(background, wit
   yield Promise.all([
     yield extension.startup(),
     yield extension.awaitFinish("finish"),
   ]);
 
   yield extension.unload();
 }
 
-add_task(function* test_url() {
-  yield do_test_update(function background() {
+add_task(async function test_url() {
+  await do_test_update(function background() {
     // Create a new tab for testing update.
     browser.tabs.create({}, function(tab) {
       browser.tabs.onUpdated.addListener(async function onUpdated(tabId, changeInfo) {
         // Check callback
         browser.test.assertEq(tabId, tab.id, "Check tab id");
         browser.test.log("onUpdate: " + JSON.stringify(changeInfo));
         if ("url" in changeInfo) {
           browser.test.assertEq("about:blank", changeInfo.url,
@@ -125,18 +125,18 @@ add_task(function* test_url() {
           browser.test.notifyPass("finish");
         }
       });
       browser.tabs.update(tab.id, {url: "about:blank"});
     });
   });
 });
 
-add_task(function* test_title() {
-  yield do_test_update(async function background() {
+add_task(async function test_title() {
+  await do_test_update(async function background() {
     const url = "http://mochi.test:8888/tests/mobile/android/components/extensions/test/mochitest/context_tabs_onUpdated_page.html";
     const tab = await browser.tabs.create({url});
 
     browser.tabs.onUpdated.addListener(async function onUpdated(tabId, changeInfo) {
       browser.test.assertEq(tabId, tab.id, "Check tab id");
       browser.test.log(`onUpdated: ${JSON.stringify(changeInfo)}`);
       if ("title" in changeInfo && changeInfo.title === "New Message (1)") {
         browser.test.log("changeInfo.title is correct");
@@ -145,18 +145,18 @@ add_task(function* test_title() {
         browser.test.notifyPass("finish");
       }
     });
 
     browser.tabs.executeScript(tab.id, {code: "document.title = 'New Message (1)'"});
   });
 });
 
-add_task(function* test_without_tabs_permission() {
-  yield do_test_update(async function background() {
+add_task(async function test_without_tabs_permission() {
+  await do_test_update(async function background() {
     const url = "http://mochi.test:8888/tests/mobile/android/components/extensions/test/mochitest/context_tabs_onUpdated_page.html";
     const tab = await browser.tabs.create({url});
     let count = 0;
 
     browser.tabs.onUpdated.addListener(async function onUpdated(tabId, changeInfo) {
       browser.test.assertEq(tabId, tab.id, "Check tab id");
       browser.test.log(`onUpdated: ${JSON.stringify(changeInfo)}`);
 
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* () {
+add_task(async function() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     files: {
       "tab.js": function() {
         browser.runtime.sendMessage("tab-loaded");
@@ -54,16 +54,16 @@ add_task(function* () {
           if (tabLoadedCount == 3) {
             browser.test.notifyPass("tabs.reload");
           }
         }
       });
     },
   });
 
-  yield extension.startup();
-  yield extension.awaitFinish("tabs.reload");
-  yield extension.unload();
+  await extension.startup();
+  await extension.awaitFinish("tabs.reload");
+  await extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload_bypass_cache.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_reload_bypass_cache.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* () {
+add_task(async function() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs", "<all_urls>"],
     },
 
     async background() {
       const BASE = "http://mochi.test:8888/tests/mobile/android/components/extensions/test/mochitest/";
       const URL = BASE + "file_bypass_cache.sjs";
@@ -58,16 +58,16 @@ add_task(function* () {
         browser.test.notifyPass("tabs.reload_bypass_cache");
       } catch (error) {
         browser.test.fail(`${error} :: ${error.stack}`);
         browser.test.notifyFail("tabs.reload_bypass_cache");
       }
     },
   });
 
-  yield extension.startup();
-  yield extension.awaitFinish("tabs.reload_bypass_cache");
-  yield extension.unload();
+  await extension.startup();
+  await extension.awaitFinish("tabs.reload_bypass_cache");
+  await extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_sendMessage.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_sendMessage.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* tabsSendMessageReply() {
+add_task(async function tabsSendMessageReply() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
 
       "content_scripts": [{
         "matches": ["http://example.com/"],
         "js": ["content-script.js"],
         "run_at": "document_start",
@@ -110,25 +110,25 @@ add_task(function* tabsSendMessageReply(
         });
 
         let response = await browser.runtime.sendMessage("content-script-ready");
         browser.runtime.sendMessage(["got-response", response]);
       },
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitFinish("sendMessage");
+  await extension.awaitFinish("sendMessage");
 
-  yield extension.unload();
+  await extension.unload();
 });
 
 
-add_task(function* tabsSendHidden() {
+add_task(async function tabsSendHidden() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
 
       "content_scripts": [{
         "matches": ["http://example.com/content*"],
         "js": ["content-script.js"],
         "run_at": "document_start",
@@ -193,25 +193,25 @@ add_task(function* tabsSendHidden() {
           return Promise.resolve(href);
         });
 
         browser.runtime.sendMessage(["content-ready", href]);
       },
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
 
-  yield extension.awaitFinish("contentscript-bfcache-window");
+  await extension.awaitFinish("contentscript-bfcache-window");
 
-  yield extension.unload();
+  await extension.unload();
 });
 
 
-add_task(function* tabsSendMessageNoExceptionOnNonExistentTab() {
+add_task(async function tabsSendMessageNoExceptionOnNonExistentTab() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs"],
     },
 
     async background() {
       let url = "http://example.com/mochitest/tests/mobile/android/components/extensions/test/mochitest/file_dummy.html";
       let tab = await browser.tabs.create({url});
@@ -224,22 +224,22 @@ add_task(function* tabsSendMessageNoExce
       }
 
       await browser.tabs.remove(tab.id);
 
       browser.test.notifyPass("tabs.sendMessage");
     },
   });
 
-  yield Promise.all([
+  await Promise.all([
     extension.startup(),
     extension.awaitFinish("tabs.sendMessage"),
   ]);
 
-  yield extension.unload();
+  await extension.unload();
 });
 
 
 add_task(async function tabsSendAndReceiveMessageTabId0() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "permissions": ["tabs", "<all_urls>"],
     },
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_update_url.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_update_url.html
@@ -68,17 +68,17 @@ function* testTabsUpdateURL(existentTabU
 
   extension.sendMessage("start", tabsUpdateURL, isErrorExpected);
   yield extension.awaitMessage("done");
 
   tab1.close();
   yield extension.unload();
 }
 
-add_task(function* () {
+add_task(async function() {
   info("Start testing tabs.update on javascript URLs");
 
   let dataURLPage = `data:text/html,
     <!DOCTYPE html>
     <html>
       <head>
         <meta charset="utf-8">
       </head>
@@ -109,17 +109,17 @@ add_task(function* () {
       isErrorExpected: true,
     },
   ];
 
   let testCases = checkList
         .map((check) => Object.assign({}, check, {existentTabURL: "about:blank"}));
 
   for (let {existentTabURL, tabsUpdateURL, isErrorExpected} of testCases) {
-    yield* testTabsUpdateURL(existentTabURL, tabsUpdateURL, isErrorExpected);
+    await testTabsUpdateURL(existentTabURL, tabsUpdateURL, isErrorExpected);
   }
 
   info("done");
 });
 </script>
 
 </body>
 </html>
--- a/mobile/android/tests/browser/chrome/test_about_logins.html
+++ b/mobile/android/tests/browser/chrome/test_about_logins.html
@@ -38,24 +38,24 @@ Migrated from Robocop: https://bugzilla.
                                  login.username,
                                  login.password,
                                  login.usernameField,
                                  login.passwordField);
 
     Services.logins.addLogin(newLogin);
   }
 
-  add_task(function* test_passwords_list() {
+  add_task(async function test_passwords_list() {
     add_login(LOGIN_FIELDS);
 
     // Load about:logins.
     let BrowserApp = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
     let browser = BrowserApp.addTab("about:logins", { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
 
-    yield promiseBrowserEvent(browser, "load");
+    await promiseBrowserEvent(browser, "load");
 
     let logins_list_parent = browser.contentDocument.getElementById("logins-list").parentNode;
 
     let waitForLoginToBeAdded = new Promise((resolve) => {
       let observer = new MutationObserver((mutations) => {
         for (let mutation of mutations) {
           for (let node of mutation.addedNodes) {
             if (node.id == "logins-list") {
@@ -68,17 +68,17 @@ Migrated from Robocop: https://bugzilla.
         info("Skipping spurious mutation not replacing 'logins-list'");
       });
       observer.observe(logins_list_parent, {
         childList: true,
       });
       info("Now waiting for mutation to replace 'logins-list'");
     });
 
-    yield waitForLoginToBeAdded;
+    await waitForLoginToBeAdded;
 
     let logins_list = browser.contentDocument.getElementById("logins-list");
 
     // Test that the (single) entry added in setup is correct.
     let hostname = logins_list.querySelector(".hostname");
     is(hostname.textContent, LOGIN_FIELDS.hostname, "hostname is correct");
 
     let username = logins_list.querySelector(".username");
--- a/mobile/android/tests/browser/chrome/test_accounts.html
+++ b/mobile/android/tests/browser/chrome/test_accounts.html
@@ -10,20 +10,20 @@ Migrated from Robocop: https://bugzilla.
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
   ChromeUtils.import("resource://gre/modules/Accounts.jsm");
 
-  add_task(function* () {
-    let firefoxExists = yield Accounts.firefoxAccountsExist();
+  add_task(async function() {
+    let firefoxExists = await Accounts.firefoxAccountsExist();
     info("Firefox account exists? " + firefoxExists + "\n");
-    let anyExists = yield Accounts.anySyncAccountsExist();
+    let anyExists = await Accounts.anySyncAccountsExist();
     info("Any accounts exist? " + anyExists + "\n");
 
     is(anyExists, firefoxExists, "sync/firefox account existence consistent with any existence");
 
     // TODO: How can this be cleaned up?
     // info("Launching setup.\n");
     // Accounts.launchSetup();
   });
--- a/mobile/android/tests/browser/chrome/test_desktop_useragent.html
+++ b/mobile/android/tests/browser/chrome/test_desktop_useragent.html
@@ -16,39 +16,39 @@ Migrated from Robocop: https://bugzilla.
 
   "use strict";
 
   ChromeUtils.import("resource://gre/modules/Services.jsm");
 
   // Load a custom sjs script that echos our "User-Agent" header back at us
   const TestURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/desktopmode_user_agent.sjs");
 
-  add_task(function* test_desktopmode() {
+  add_task(async function test_desktopmode() {
     let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
     let BrowserApp = chromeWin.BrowserApp;
 
     // Add a new 'desktop mode' tab with our test page
     let desktopTab = BrowserApp.addTab(TestURI.spec, { selected: true, parentId: BrowserApp.selectedTab.id, desktopMode: true });
     let desktopBrowser = desktopTab.browser;
-    yield promiseBrowserEvent(desktopBrowser, "load");
+    await promiseBrowserEvent(desktopBrowser, "load");
 
     // Some debugging
     info("desktop: " + desktopBrowser.contentWindow.navigator.userAgent);
     info("desktop: " + desktopBrowser.contentDocument.body.innerHTML);
 
     // Check the server UA and the navigator UA for 'desktop'
     ok(desktopBrowser.contentWindow.navigator.userAgent.includes("Linux x86_64"), "window.navigator.userAgent has 'Linux' in it");
     ok(desktopBrowser.contentDocument.body.innerHTML.includes("Linux x86_64"), "HTTP header 'User-Agent' has 'Linux' in it");
 
     BrowserApp.closeTab(desktopTab);
 
     // Add a new 'mobile mode' tab with our test page
     let mobileTab = BrowserApp.addTab(TestURI.spec, { selected: true, parentId: BrowserApp.selectedTab.id });
     let mobileBrowser = mobileTab.browser;
-    yield promiseBrowserEvent(mobileBrowser, "load");
+    await promiseBrowserEvent(mobileBrowser, "load");
 
     // Some debugging
     info("mobile: " + mobileBrowser.contentWindow.navigator.userAgent);
     info("mobile: " + mobileBrowser.contentDocument.body.innerHTML);
 
     // Check the server UA and the navigator UA for 'mobile'
     // We only check for 'Android' because we don't know the version or if it's phone or tablet
     ok(mobileBrowser.contentWindow.navigator.userAgent.includes("Android"), "window.navigator.userAgent has 'Android' in it");
--- a/mobile/android/tests/browser/chrome/test_get_last_visited.html
+++ b/mobile/android/tests/browser/chrome/test_get_last_visited.html
@@ -55,44 +55,44 @@ var browser = BrowserApp.addTab("about:b
 // they can write to the history database.
 
 // The apparent mis-ordering here just uses simpler pages (01 and 03) for the
 // real test, and a more complex page (02) for a final delay.  See comment below.
 const url1 = "http://example.org/tests/robocop/robocop_blank_01.html";
   const url2 = "http://example.org/tests/robocop/robocop_blank_03.html";
   const url3 = "http://example.org/tests/robocop/robocop_blank_02.html";
 
-  add_task(function* test_get_last_visited() {
-    var v = yield get_last_visited("https://random.com/");
+  add_task(async function test_get_last_visited() {
+    var v = await get_last_visited("https://random.com/");
     is(v, 0, `Last visited timestamp is 0 for unknown prePath: ${v}`);
 
     let prePath = Services.io.newURI(url1).prePath + "/";
     is(prePath, Services.io.newURI(url2).prePath + "/", "url1 and url2 have the same prePath");
 
     let t0 = Date.now();
-    yield add_history_visit(url1);
-    v = yield get_last_visited(prePath);
+    await add_history_visit(url1);
+    v = await get_last_visited(prePath);
     let t1 = Date.now();
     ok(t0 <= v, `Last visited timestamp is after visit: ${t0} <= ${v}.`);
     ok(v <= t1, `Last visited timestamp is before present ${v} <= ${t1}.`);
 
     let t2 = Date.now();
-    yield add_history_visit(url1);
-    v = yield get_last_visited(prePath);
+    await add_history_visit(url1);
+    v = await get_last_visited(prePath);
     ok(t2 <= v, `Last visited timestamp is updated after visit: ${t2} <= ${v}`);
 
     let t3 = Date.now();
-    yield add_history_visit(url2);
-    v = yield get_last_visited(prePath);
+    await add_history_visit(url2);
+    v = await get_last_visited(prePath);
     ok(t3 <= v, `Last visited timestamp is updated after visit to URL with same prePath: ${t3} <= ${v}`);
 
     // This whole system is flaky, so we wait for an unrelated visit, so that we
     // can witness "link-visited" events a little after the test completes
     // while debugging.
-    yield add_history_visit(url3);
+    await add_history_visit(url3);
   });
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1214366">Mozilla Bug 1214366</a>
 <p id="display"></p>
 <div id="content" style="display: none">
--- a/mobile/android/tests/browser/chrome/test_home_provider.html
+++ b/mobile/android/tests/browser/chrome/test_home_provider.html
@@ -51,108 +51,108 @@ Migrated from Robocop: https://bugzilla.
     // Lower the check interval for testing purposes.
     Services.prefs.setIntPref(PREF_SYNC_CHECK_INTERVAL_SECS, TEST_INTERVAL_SECS);
 
     HomeProvider.addPeriodicSync(TEST_DATASET_ID, TEST_INTERVAL_SECS, function callback(datasetId) {
       is(datasetId, TEST_DATASET_ID, "expected dataset ID");
     });
   }
 
-  add_task(function* test_save_and_delete() {
+  add_task(async function test_save_and_delete() {
     // Use the HomeProvider API to save some data.
     let storage = HomeProvider.getStorage(TEST_DATASET_ID);
-    yield storage.save([{
+    await storage.save([{
       title: TEST_TITLE,
       url: TEST_URL,
       background_url: TEST_BACKGROUND_URL,
       background_color: TEST_BACKGROUND_COLOR
     }]);
 
     // Peek in the DB to make sure we have the right data.
-    let db = yield Sqlite.openConnection({ path: DB_PATH });
+    let db = await Sqlite.openConnection({ path: DB_PATH });
 
     // Make sure the items table was created.
-    ok((yield db.tableExists("items")), "items table exists");
+    ok((await db.tableExists("items")), "items table exists");
 
     // Make sure the correct values for the item ended up in there.
-    let result = yield db.execute("SELECT * FROM items", null, function onRow(row) {
+    let result = await db.execute("SELECT * FROM items", null, function onRow(row) {
       is(row.getResultByName("dataset_id"), TEST_DATASET_ID, "expected dataset ID");
       is(row.getResultByName("url"), TEST_URL, "expected test url");
       is(row.getResultByName("background_url"), TEST_BACKGROUND_URL, "expected background url");
       is(row.getResultByName("background_color"), TEST_BACKGROUND_COLOR, "expected background color");
     });
 
     // Use the HomeProvider API to delete the data.
-    yield storage.deleteAll();
+    await storage.deleteAll();
 
     // Make sure the data was deleted.
-    result = yield db.execute("SELECT * FROM items");
+    result = await db.execute("SELECT * FROM items");
     is(result.length, 0, "length is 0");
 
     db.close();
   });
 
-  add_task(function* test_row_validation() {
+  add_task(async function test_row_validation() {
     // Use the HomeProvider API to save some data.
     let storage = HomeProvider.getStorage(TEST_DATASET_ID);
 
     let invalidRows = [
       { url: "url" },
       { title: "title" },
       { description: "description" },
       { image_url: "image_url" }
     ];
 
     // None of these save calls should save anything
     for (let row of invalidRows) {
       try {
-        yield storage.save([row]);
+        await storage.save([row]);
       } catch (e) {
         // Just catch and ignore validation errors
         if (!(e instanceof HomeProvider.ValidationError)) {
           throw e;
         }
       }
     }
 
     // Peek in the DB to make sure we have the right data.
-    let db = yield Sqlite.openConnection({ path: DB_PATH });
+    let db = await Sqlite.openConnection({ path: DB_PATH });
 
     // Make sure no data has been saved.
-    let result = yield db.execute("SELECT * FROM items");
+    let result = await db.execute("SELECT * FROM items");
     is(result.length, 0, "length is 0");
 
     db.close();
   });
 
-  add_task(function* test_save_transaction() {
+  add_task(async function test_save_transaction() {
     // Use the HomeProvider API to save some data.
     let storage = HomeProvider.getStorage(TEST_DATASET_ID);
 
     // One valid, one invalid
     let rows = [
       { title: TEST_TITLE, url: TEST_URL },
       { image_url: "image_url" }
     ];
 
     // Try to save all the rows at once
     try {
-      yield storage.save(rows);
+      await storage.save(rows);
     } catch (e) {
       // Just catch and ignore validation errors
       if (!(e instanceof HomeProvider.ValidationError)) {
         throw e;
       }
     }
 
     // Peek in the DB to make sure we have the right data.
-    let db = yield Sqlite.openConnection({ path: DB_PATH });
+    let db = await Sqlite.openConnection({ path: DB_PATH });
 
     // Make sure no data has been saved.
-    let result = yield db.execute("SELECT * FROM items");
+    let result = await db.execute("SELECT * FROM items");
     is(result.length, 0, "length is 0");
 
     db.close();
   });
 
   </script>
 </head>
 <body>
--- a/mobile/android/tests/browser/chrome/test_media_playback.html
+++ b/mobile/android/tests/browser/chrome/test_media_playback.html
@@ -54,91 +54,91 @@ function isAudioStarted(browser) {
   return !audio.paused;
 }
 
 function setup_browser() {
   gChromeWin = Services.wm.getMostRecentWindow("navigator:browser");
   gBrowserApp = gChromeWin.BrowserApp;
 }
 
-add_task(function* test_media_control() {
+add_task(async function test_media_control() {
   info("- open a new tab -");
   let tab = gBrowserApp.addTab(URL);
   let browser = tab.browser;
 
   info("- wait for loading tab's content -");
-  yield promiseBrowserEvent(browser, "load");
+  await promiseBrowserEvent(browser, "load");
 
   info("- check whether audio starts playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStarted");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStarted");
   ok(isAudioStarted(browser), "audio has started playing.");
   ok(tab.playingAudio, "tab is playing audio.");
 
   info("- pause from control -");
   Services.obs.notifyObservers(browser, "mediaControl", "mediaControlPaused");
 
   info("- check whether audio stops playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStopped");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStopped");
   ok(!isAudioStarted(browser), "audio has stopped playing.");
   ok(!tab.playingAudio, "tab isn't playing audio.");
 
   info("- resume from control -");
   Services.obs.notifyObservers(browser, "mediaControl", "resumeMedia");
 
   info("- check whether audio starts playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStarted");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStarted");
   ok(isAudioStarted(browser), "audio has started playing.");
   ok(tab.playingAudio, "tab is playing audio.");
 
   info("- stop from control -");
   Services.obs.notifyObservers(browser, "mediaControl", "mediaControlStopped");
 
   info("- check whether audio stops playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStopped");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStopped");
   ok(!isAudioStarted(browser), "audio has stopped playing.");
   ok(!tab.playingAudio, "tab isn't playing audio.");
 
   info("- remove tab -");
   gBrowserApp.closeTab(tab);
 });
 
-add_task(function* test_audio_focus() {
+add_task(async function test_audio_focus() {
   info("- open a new tab -");
   let tab = gBrowserApp.addTab(URL);
   let browser = tab.browser;
 
   info("- wait for loading tab's content -");
-  yield promiseBrowserEvent(browser, "load");
+  await promiseBrowserEvent(browser, "load");
 
   info("- check whether audio starts playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStarted");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStarted");
   ok(isAudioStarted(browser), "audio has started playing.");
   ok(tab.playingAudio, "tab is playing audio.");
 
   info("- pause when transiently lossing audio focus -");
   Services.obs.notifyObservers(browser, "audioFocusChanged", "lostAudioFocusTransiently");
 
   info("- check whether audio stops playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStopped");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStopped");
   ok(!isAudioStarted(browser), "audio has stopped playing.");
   ok(!tab.playingAudio, "tab isn't playing audio.");
 
   info("- resume when gain audio focus again -");
   Services.obs.notifyObservers(browser, "audioFocusChanged", "gainAudioFocus");
 
   info("- check whether audio starts playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStarted");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStarted");
   ok(isAudioStarted(browser), "audio has started playing.");
   ok(tab.playingAudio, "tab is playing audio.");
 
   info("- pause when lossing audio focus -");
   Services.obs.notifyObservers(browser, "audioFocusChanged", "lostAudioFocus");
 
   info("- check whether audio stops playing -");
-  yield promiseTabEvent(browser, "DOMAudioPlaybackStopped");
+  await promiseTabEvent(browser, "DOMAudioPlaybackStopped");
   ok(!isAudioStarted(browser), "audio has stopped playing.");
   ok(!tab.playingAudio, "tab isn't playing audio.");
 
   info("- remove tab -");
   gBrowserApp.closeTab(tab);
 });
 
   </script>
--- a/mobile/android/tests/browser/chrome/test_offline_page.html
+++ b/mobile/android/tests/browser/chrome/test_offline_page.html
@@ -39,17 +39,17 @@ Migrated from Robocop: https://bugzilla.
   // Track the <browser> where the tests are happening
   let browser;
 
   // The proxy setting
   let proxyPrefValue;
 
   const kUniqueURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/video_controls.html");
 
-  add_task(function* test_offline() {
+  add_task(async function test_offline() {
     // Tests always connect to localhost, and per bug 87717, localhost is now
     // reachable in offline mode.  To avoid this, disable any proxy.
     proxyPrefValue = Services.prefs.getIntPref("network.proxy.type");
     Services.prefs.setIntPref("network.proxy.type", 0);
 
     // Clear network cache.
     Services.cache2.clear();
 
@@ -61,38 +61,38 @@ Migrated from Robocop: https://bugzilla.
 
     SimpleTest.registerCleanupFunction(function() {
       BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
       Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
       Services.io.offline = false;
     });
 
     // Go offline, expecting the error page.
-    yield promiseOffline(true);
+    await promiseOffline(true);
 
     // Load our test web page
     browser.loadURI(kUniqueURI.spec, null, null);
-    yield promiseBrowserEvent(browser, "DOMContentLoaded");
+    await promiseBrowserEvent(browser, "DOMContentLoaded");
 
     // This is an error page.
     is(browser.contentDocument.documentURI.substring(0, 27), "about:neterror?e=netOffline", "Document URI is the error page.");
 
     // But location bar should show the original request.
     is(browser.contentWindow.location.href, kUniqueURI.spec, "Docshell URI is the original URI.");
 
     Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
 
     // Go online and try to load the page again
-    yield promiseOffline(false);
+    await promiseOffline(false);
 
     ok(browser.contentDocument.getElementById("errorTryAgain"), "The error page has got a #errorTryAgain element");
 
     // Click "Try Again" button to start the page load
     browser.contentDocument.getElementById("errorTryAgain").click();
-    yield promiseBrowserEvent(browser, "DOMContentLoaded");
+    await promiseBrowserEvent(browser, "DOMContentLoaded");
 
     // This is not an error page.
     is(browser.contentDocument.documentURI, kUniqueURI.spec, "Document URI is not the offline-error page, but the original URI.");
   });
 
   </script>
 </head>
 <body>
--- a/mobile/android/tests/browser/chrome/test_reader_view.html
+++ b/mobile/android/tests/browser/chrome/test_reader_view.html
@@ -11,35 +11,35 @@ Migrated from Robocop: https://bugzilla.
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
   <script type="application/javascript" src="head.js"></script>
   <script type="application/javascript">
 
   ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-  add_task(function* test_reader_view_visibility() {
+  add_task(async function test_reader_view_visibility() {
     let gWin = Services.wm.getMostRecentWindow("navigator:browser");
     let BrowserApp = gWin.BrowserApp;
 
     let url = "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/basic_article.html";
     let browser = BrowserApp.addTab("about:reader?url=" + url).browser;
 
     SimpleTest.registerCleanupFunction(function() {
       BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
     });
 
-    yield promiseBrowserEvent(browser, "load");
+    await promiseBrowserEvent(browser, "load");
 
     let doc = browser.contentDocument;
     let title = doc.querySelector(".reader-title");
 
     // We need to wait for reader content to appear because AboutReader.jsm
     // asynchronously fetches the content after about:reader loads.
-    yield promiseNotification("AboutReader:Ready");
+    await promiseNotification("AboutReader:Ready");
     is(title.textContent, "Article title", "found expected content");
   });
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1158885">Mozilla Bug 1158885</a>
 <br>
--- a/mobile/android/tests/browser/chrome/test_resource_substitutions.html
+++ b/mobile/android/tests/browser/chrome/test_resource_substitutions.html
@@ -32,25 +32,25 @@ Migrated from Robocop: https://bugzilla.
 
       let content = NetUtil.readInputStreamToString(inputStream, inputStream.available());
       deferred.resolve(content);
     });
 
     return deferred.promise;
   }
 
-  add_task(function* () {
+  add_task(async function() {
     let protocolHandler = Services.io
        .getProtocolHandler("resource")
        .QueryInterface(Ci.nsIResProtocolHandler);
 
     ok(protocolHandler.hasSubstitution("android"));
 
     // This can be any file that we know exists in the root of every APK.
-    let packageName = yield readChannel("resource://android/package-name.txt");
+    let packageName = await readChannel("resource://android/package-name.txt");
     info(packageName);
 
     // It's difficult to fish ANDROID_PACKAGE_NAME from JavaScript, so we test the
     // following weaker condition.
     let expectedPrefix = "org.mozilla.";
     is(packageName.substring(0, expectedPrefix.length), expectedPrefix);
   });
 
--- a/mobile/android/tests/browser/chrome/test_selectoraddtab.html
+++ b/mobile/android/tests/browser/chrome/test_selectoraddtab.html
@@ -40,72 +40,72 @@ https://bugzilla.mozilla.org/show_bug.cg
   }
 
   SimpleTest.registerCleanupFunction(function() {
     cleanupTabs();
   });
 
   const kTestPage = "http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/basic_article.html";
 
-  add_task(function* test_selectOrAdd() {
+  add_task(async function test_selectOrAdd() {
     // Add a new tab with a blank page
     tabBlank = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id });
 
     // Now, let's force the target tab to be added
     tabTest = BrowserApp.selectOrAddTab(kTestPage, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
 
     // Check that basic_article is now selected
     is(BrowserApp.selectedBrowser, tabTest.browser, "Target tab is selected after being added.");
 
     // Switch back to about:blank
     BrowserApp.selectTab(tabBlank);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
 
     // Check that about:blank is selected
     is(BrowserApp.selectedTab, tabBlank, "about:blank is selected.");
 
     // Use selectOrAddTab to select the existing tab
     BrowserApp.selectOrAddTab(kTestPage, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
 
     // Check that basic_article is now selected
     is(BrowserApp.selectedTab, tabTest, "Target tab is selected.");
 
     // Switch back to about:blank
     BrowserApp.selectTab(tabBlank);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
 
     // Check that about:blank is selected
     is(BrowserApp.selectedTab, tabBlank, "about:blank is selected.");
 
     // Use selectOrAddTab to select the existing tab using the startsWith flag
     BrowserApp.selectOrAddTab(kTestPage, { selected: true, parentId: BrowserApp.selectedTab.id }, { startsWith: kTestPage });
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
 
     // Check that basic_article is now selected
     is(BrowserApp.selectedTab, tabTest, "Target tab is selected.");
 
     // Switch back to about:blank
     BrowserApp.selectTab(tabBlank);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
 
     // Check that about:blank is selected
     is(BrowserApp.selectedTab, tabBlank, "about:blank is selected.");
 
     // Zombify basic_article
     tabTest.zombify();
 
     // Check that basic_article is actually zombified
     ok(tabTest.browser.__SS_restore, "Target tab is set for delay loading.");
     is(tabTest.browser.currentURI.spec, "about:blank", "Target tab is zombified.");
 
     // Use selectOrAddTab to select the existing tab
     BrowserApp.selectOrAddTab(kTestPage, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
 
     // Check that basic_article is now selected
     is(BrowserApp.selectedTab, tabTest, "Target tab is selected.");
 
     cleanupTabs();
   });
 
   </script>
--- a/mobile/android/tests/browser/chrome/test_session_clear_history.html
+++ b/mobile/android/tests/browser/chrome/test_session_clear_history.html
@@ -63,17 +63,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   // URLs for testing
   const url1 = "http://example.org/chrome/mobile/android/tests/browser/chrome/basic_article_mobile.html";
   const url2 = "http://example.org/chrome/mobile/android/tests/browser/chrome/basic_article.html";
   const url3 = "data:text/html;charset=utf-8,It%20was%20a%20dark%20and%20stormy%20night.";
 
   // Outside of shutting down, clearing history will trigger an async delete
   // of the session files. To avoid any interference from that here, this test
   // therefore has to run first.
-  add_task(function* test_sessionStoreClearFiles() {
+  add_task(async function test_sessionStoreClearFiles() {
     // Temporarily set the session store to shutdown mode to test the
     // synchronous deletion code path.
     // This also means that nothing gets written to disk until explicitly
     // flushed, so we can test that all files have been deleted and don't
     // have to worry about them already having been recreated before we get
     // around checking on them.
     ss.setLoadState(STATE_QUITTING);
 
@@ -97,101 +97,101 @@ https://bugzilla.mozilla.org/show_bug.cg
     ok(sessionFilePrevious.exists(), "last session file exists");
     ok(sessionFileTemp.exists(), "temp file exists");
 
     // Clear browsing history
     let sanitize = { history: true };
     let notification = promiseNotification("sessionstore-state-purge-complete");
 
     BrowserApp.sanitize(sanitize);
-    yield notification;
+    await notification;
 
     ok(!sessionFile.exists(), "session file was deleted");
     ok(!sessionFileBackup.exists(), "backup file was deleted");
     ok(!sessionFilePrevious.exists(), "last session file was deleted");
     ok(!sessionFileTemp.exists(), "temp file was deleted");
 
     // Revert back to normal
     ss.setLoadState(STATE_RUNNING);
   });
 
-  add_task(function* test_sessionStoreClearTabHistory() {
+  add_task(async function test_sessionStoreClearTabHistory() {
     // Add a new tab with some content
     tabTest = BrowserApp.addTab(url1, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
 
     // Navigate to create some history
     tabTest.browser.loadURI(url2);
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
     tabTest.browser.loadURI(url3);
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
     is(tabTest.browser.canGoBack, true, "can go back");
     tabTest.browser.goBack();
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
 
     // Check that the session store has recorded this history
     let data = tabTest.browser.__SS_data;
     is(data.entries.length, 3, "the session store has captured 3 history entries");
     is(data.index, 2, "history index is correct");
     is(data.entries[0].url, url1, "URL of first history entry is correct");
 
     // Clear browsing history
     let sanitize = { history: true };
     let notification = promiseNotification("sessionstore-state-purge-complete");
 
     BrowserApp.sanitize(sanitize);
-    yield notification;
+    await notification;
 
     // Only the current session history entry should remain
     data = tabTest.browser.__SS_data;
     is(data.entries.length, 1, "the session store has cleared all previous entries");
     is(data.index, 1, "history index is correct");
     is(data.entries[0].url, url2, "URL of first history entry is correct after data clearing");
 
     cleanupTabs();
   });
 
-  add_task(function* test_sessionStoreClearZombieTabHistory() {
+  add_task(async function test_sessionStoreClearZombieTabHistory() {
     // Add a new tab with some content
     tabTest = BrowserApp.addTab(url1, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
 
     // Navigate to create some history
     tabTest.browser.loadURI(url2);
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
     tabTest.browser.loadURI(url3);
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
     is(tabTest.browser.canGoBack, true, "can go back");
     tabTest.browser.goBack();
-    yield promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
+    await promiseBrowserEvent(tabTest.browser, "DOMTitleChanged");
 
     // Check that the session store has recorded this history
     let data = tabTest.browser.__SS_data;
     is(data.entries.length, 3, "the session store has captured 3 history entries");
     is(data.index, 2, "history index is correct");
     is(data.entries[0].url, url1, "URL of first history entry is correct");
 
     // Open a new tab and zombify the original one
     tabBlank = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
 
     // Zombify the backgrounded test tab
     tabTest.zombify();
 
     // Check that the test tab is actually zombified
     ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
     is(tabTest.browser.currentURI.spec, "about:blank", "Test tab is zombified.");
 
     // Clear browsing history
     let sanitize = { history: true };
     let notification = promiseNotification("sessionstore-state-purge-complete");
 
     BrowserApp.sanitize(sanitize);
-    yield notification;
+    await notification;
 
     // Only the current session history entry should remain
     data = tabTest.browser.__SS_data;
     is(data.entries.length, 1, "the session store has cleared all previous entries");
     is(data.index, 1, "history index is correct");
     is(data.entries[0].url, url2, "URL of first history entry is correct after data clearing");
 
     cleanupTabs();
--- a/mobile/android/tests/browser/chrome/test_session_form_data.html
+++ b/mobile/android/tests/browser/chrome/test_session_form_data.html
@@ -76,17 +76,17 @@ function setup_browser() {
   gChromeWin = Services.wm.getMostRecentWindow("navigator:browser");
   gBrowserApp = gChromeWin.BrowserApp;
 }
 
 /**
  * This test ensures that form data collection respects the privacy level as
  * set by the user.
  */
-add_task(function* test_formdata() {
+add_task(async function test_formdata() {
   const URL = "http://example.org/chrome/mobile/android/tests/browser/chrome/session_formdata_sample.html";
 
   const OUTER_VALUE = "browser_formdata_" + Math.random();
   const INNER_VALUE = "browser_formdata_" + Math.random();
 
   // Creates a tab, loads a page with some form fields,
   // modifies their values and closes the tab.
   function createAndRemoveTab() {
@@ -103,47 +103,47 @@ add_task(function* test_formdata() {
       yield promiseTabEvent(browser, "SSTabInputCaptured");
 
       // Remove the tab.
       gBrowserApp.closeTab(tab);
       yield promiseTabEvent(browser, "SSTabCloseProcessed");
     });
   }
 
-  yield createAndRemoveTab();
+  await createAndRemoveTab();
   let state = ss.getClosedTabs(gChromeWin);
   let [{formdata}] = state;
   is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
   is(formdata.children[0].id.txt, INNER_VALUE, "inner value is correct");
 
   // Disable saving data for encrypted sites.
   Services.prefs.setIntPref("browser.sessionstore.privacy_level", 1);
 
-  yield createAndRemoveTab();
+  await createAndRemoveTab();
   state = ss.getClosedTabs(gChromeWin);
   [{formdata}] = state;
   is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
   ok(!formdata.children, "inner value was *not* stored");
 
   // Disable saving data for any site.
   Services.prefs.setIntPref("browser.sessionstore.privacy_level", 2);
 
-  yield createAndRemoveTab();
+  await createAndRemoveTab();
   state = ss.getClosedTabs(gChromeWin);
   [{formdata}] = state;
   ok(!formdata, "form data has *not* been stored");
 
   // Restore the default privacy level.
   Services.prefs.clearUserPref("browser.sessionstore.privacy_level");
 });
 
 /**
  * This test ensures that form data collection restores correctly.
  */
-add_task(function* test_formdata2() {
+add_task(async function test_formdata2() {
   const URL = "http://example.org/chrome/mobile/android/tests/browser/chrome/session_formdata_sample.html";
 
   const OUTER_VALUE = "browser_formdata_" + Math.random();
   const INNER_VALUE = "browser_formdata_" + Math.random();
 
   // Creates a tab, loads a page with some form fields,
   // modifies their values and closes the tab.
   function createAndRemoveTab() {
@@ -159,40 +159,40 @@ add_task(function* test_formdata2() {
       yield promiseTabEvent(browser, "SSTabInputCaptured");
 
       // Remove the tab.
       gBrowserApp.closeTab(tab);
       yield promiseTabEvent(browser, "SSTabCloseProcessed");
     });
   }
 
-  yield createAndRemoveTab();
+  await createAndRemoveTab();
   let state = ss.getClosedTabs(gChromeWin);
   let [{formdata}] = state;
   is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
   is(formdata.children[0].id.txt, INNER_VALUE, "inner value is correct");
 
   // Restore the closed tab.
   let closedTabData = ss.getClosedTabs(gChromeWin)[0];
   let browser = ss.undoCloseTab(gChromeWin, closedTabData);
-  yield promiseBrowserEvent(browser, "load", { resolveAtNextTick: true });
+  await promiseBrowserEvent(browser, "load", { resolveAtNextTick: true });
 
   // Check the form data.
   is(getInputValue(browser, {id: "txt"}), OUTER_VALUE, "outer value restored correctly");
   is(getInputValue(browser, {id: "txt", frame: 0}), INNER_VALUE, "inner value restored correctly");
 
   // Remove the tab.
   gBrowserApp.closeTab(gBrowserApp.getTabForBrowser(browser));
 });
 
 /**
  * This test ensures that form data collection restores correctly even after
  * navigating to a different page and then returning via hitting back.
  */
-add_task(function* test_formdata_navigation() {
+add_task(async function test_formdata_navigation() {
   const URL = "http://example.org/chrome/mobile/android/tests/browser/chrome/session_formdata_sample.html";
   const otherURL = "http://example.org/chrome/mobile/android/tests/browser/chrome/basic_article.html";
 
   const OUTER_VALUE = "browser_formdata_" + Math.random();
   const INNER_VALUE = "browser_formdata_" + Math.random();
 
   // Make sure the bfcache remains enabled during this test,
   // otherwise the inner value will not be restored correctly.
@@ -239,26 +239,26 @@ add_task(function* test_formdata_navigat
       is(getInputValue(browser, {id: "txt", frame: 0}), INNER_VALUE, "inner value present after navigation");
 
       // Remove the tab.
       gBrowserApp.closeTab(tab);
       yield promiseTabEvent(browser, "SSTabCloseProcessed");
     });
   }
 
-  yield createNavigateAndRemoveTab();
+  await createNavigateAndRemoveTab();
   let state = ss.getClosedTabs(gChromeWin);
   let [{formdata}] = state;
   is(formdata.id.txt, OUTER_VALUE, "outer value is correct");
   is(formdata.children[0].id.txt, INNER_VALUE, "inner value is correct");
 
   // Restore the closed tab.
   let closedTabData = ss.getClosedTabs(gChromeWin)[0];
   let browser = ss.undoCloseTab(gChromeWin, closedTabData);
-  yield promiseBrowserEvent(browser, "load", { resolveAtNextTick: true });
+  await promiseBrowserEvent(browser, "load", { resolveAtNextTick: true });
 
   // Check the form data.
   is(getInputValue(browser, {id: "txt"}), OUTER_VALUE, "outer value restored correctly");
   is(getInputValue(browser, {id: "txt", frame: 0}), INNER_VALUE, "inner value restored correctly");
 
   // Remove the tab.
   gBrowserApp.closeTab(gBrowserApp.getTabForBrowser(browser));
 });
--- a/mobile/android/tests/browser/chrome/test_session_parentid.html
+++ b/mobile/android/tests/browser/chrome/test_session_parentid.html
@@ -46,70 +46,70 @@ https://bugzilla.mozilla.org/show_bug.cg
     if (tabChild2) {
       BrowserApp.closeTab(tabChild2);
       tabChild2 = null;
     }
   }
 
   const url = "data:text/html;charset=utf-8,It%20was%20a%20dark%20and%20stormy%20night.";
 
-  add_task(function* test_sessionStoreParentId() {
+  add_task(async function test_sessionStoreParentId() {
     SimpleTest.registerCleanupFunction(function() {
       cleanupTabs();
     });
 
     // First, check that passing a parent tab ID works as expected
     tabParent = BrowserApp.addTab(url, { selected: true });
-    yield promiseBrowserEvent(tabParent.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabParent.browser, "DOMContentLoaded");
 
     // Open tabs without passing a parent tab ID
     tabChild1 = BrowserApp.addTab(url, { selected: false });
     tabChild2 = BrowserApp.addTab(url, { selected: true });
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabChild2, "2nd child tab is selected");
 
     // After closing that tab, its neighbour should be selected
     BrowserApp.closeTab(tabChild2);
     tabChild2 = null;
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabChild1, "1st child tab is selected");
 
     // Add a new tab and pass a parent tab ID this time
     tabChild2 = BrowserApp.addTab(url, { selected: true, parentId: tabParent.id });
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabChild2, "2nd child tab is selected");
 
     // After closing that tab, its parent should be selected
     BrowserApp.closeTab(tabChild2);
     tabChild2 = null;
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabParent, "parent tab is selected");
 
     // Reset selection and switch to the other child tab
     BrowserApp.selectTab(tabChild1);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabChild1, "1st child tab is selected");
 
     // Now check that this works even if the child tab is closed and subsequently restored
     tabChild2 = BrowserApp.addTab(url, { selected: false, parentId: tabParent.id });
-    yield promiseTabEvent(tabChild2.browser, "SSTabDataUpdated");
+    await promiseTabEvent(tabChild2.browser, "SSTabDataUpdated");
     BrowserApp.closeTab(tabChild2);
-    yield promiseTabEvent(tabChild2.browser, "SSTabCloseProcessed");
+    await promiseTabEvent(tabChild2.browser, "SSTabCloseProcessed");
 
     // Restore the tab
     let closedTabData = ss.getClosedTabs(chromeWin)[0];
     let browser = ss.undoCloseTab(chromeWin, closedTabData);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     tabChild2 = BrowserApp.getTabForBrowser(browser);
     is(BrowserApp.selectedTab, tabChild2, "restored 2nd child tab is selected");
 
     // After closing that tab, its parent should be selected
     BrowserApp.closeTab(tabChild2);
     tabChild2 = null;
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabParent, "parent tab is selected after restoring");
 
     cleanupTabs();
   });
 
   </script>
 </head>
 <body>
--- a/mobile/android/tests/browser/chrome/test_session_scroll_position.html
+++ b/mobile/android/tests/browser/chrome/test_session_scroll_position.html
@@ -76,17 +76,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   }
 
   SimpleTest.registerCleanupFunction(function() {
     cleanupTabs();
   });
 
   let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
 
-  add_task(function* test_sessionStoreScrollPositionReaderMode() {
+  add_task(async function test_sessionStoreScrollPositionReaderMode() {
     // Creates a tab, sets a scroll position and closes the tab.
     function createAndRemoveReaderTab() {
       return Task.spawn(function* () {
         // Create a new tab.
         tabScroll = BrowserApp.addTab(URL_reader);
         let browser = tabScroll.browser;
         yield promiseBrowserEvent(browser, "AboutReaderContentReady");
 
@@ -103,39 +103,39 @@ https://bugzilla.mozilla.org/show_bug.cg
         is(scrollY.value, SCROLL_Y, "scrollY set correctly");
 
         // Remove the tab.
         BrowserApp.closeTab(tabScroll);
         yield promiseTabEvent(browser, "SSTabCloseProcessed");
       });
     }
 
-    yield createAndRemoveReaderTab();
+    await createAndRemoveReaderTab();
     let state = ss.getClosedTabs(chromeWin);
     let [{scrolldata}] = state;
     is(scrolldata.scroll, SCROLL_STR_Y_ONLY, "stored scroll position is correct");
 
     // Restore the closed tab.
     let closedTabData = ss.getClosedTabs(chromeWin)[0];
     let browser = ss.undoCloseTab(chromeWin, closedTabData);
-    yield promiseBrowserEvent(browser, "AboutReaderContentReady");
+    await promiseBrowserEvent(browser, "AboutReaderContentReady");
 
     // Check the scroll position.
     let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
     let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
     let scrollX = {}, scrollY = {};
     utils.getScrollXY(false, scrollX, scrollY);
     is(scrollX.value, 0, "scrollX restored correctly");
     is(scrollY.value, SCROLL_Y, "scrollY restored correctly");
 
     // Remove the tab.
     BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
   });
 
-  add_task(function* test_sessionStoreScrollPositionAndZoomLevel() {
+  add_task(async function test_sessionStoreScrollPositionAndZoomLevel() {
     // Creates a tab, sets a scroll position and zoom level and closes the tab.
     function createAndRemoveTab() {
       return Task.spawn(function* () {
         // Create a new tab.
         tabScroll = BrowserApp.addTab(URL);
         let browser = tabScroll.browser;
         yield promiseBrowserEvent(browser, "pageshow");
 
@@ -169,29 +169,29 @@ https://bugzilla.mozilla.org/show_bug.cg
         is(scrollY.value, SCROLL2_Y, "scrollY set correctly");
 
         // Remove the tab.
         BrowserApp.closeTab(tabScroll);
         yield promiseTabEvent(browser, "SSTabCloseProcessed");
       });
     }
 
-    yield createAndRemoveTab();
+    await createAndRemoveTab();
     let state = ss.getClosedTabs(chromeWin);
     let [{scrolldata}] = state;
     is(scrolldata.scroll, SCROLL2_STR, "stored scroll position is correct");
     ok(fuzzyEquals(scrolldata.zoom.resolution, ZOOM2), "stored zoom level is correct");
 
     // Restore the closed tab.
     let closedTabData = ss.getClosedTabs(chromeWin)[0];
     let browser = ss.undoCloseTab(chromeWin, closedTabData);
     let pageshow = promiseBrowserEvent(browser, "pageshow");
     let scroll = promiseBrowserEvent(browser, "scroll");
-    yield pageshow;
-    yield scroll;
+    await pageshow;
+    await scroll;
 
     // Check the scroll position and zoom level.
     let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
     let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
     let scrollX = {}, scrollY = {}, zoom = {};
     utils.getResolution(zoom);
     utils.getScrollXY(false, scrollX, scrollY);
     ok(fuzzyEquals(zoom.value, ZOOM2), "zoom restored correctly");
@@ -199,30 +199,30 @@ https://bugzilla.mozilla.org/show_bug.cg
     is(scrollY.value, SCROLL2_Y, "scrollY restored correctly");
 
     // Now go back in history and check that the scroll position
     // is restored there as well.
     is(browser.canGoBack, true, "can go back");
     pageshow = promiseBrowserEvent(browser, "pageshow");
     scroll = promiseBrowserEvent(browser, "scroll");
     browser.goBack();
-    yield pageshow;
-    yield scroll;
+    await pageshow;
+    await scroll;
 
     utils.getResolution(zoom);
     utils.getScrollXY(false, scrollX, scrollY);
     ok(fuzzyEquals(zoom.value, ZOOM), "zoom restored correctly");
     is(scrollX.value, SCROLL_X, "scrollX restored correctly");
     is(scrollY.value, SCROLL_Y, "scrollY restored correctly");
 
     // Remove the tab.
     BrowserApp.closeTab(BrowserApp.getTabForBrowser(browser));
   });
 
-  add_task(function* test_sessionStoreZoomLevelRecalc() {
+  add_task(async function test_sessionStoreZoomLevelRecalc() {
     // Creates a tab, sets a scroll position and zoom level and closes the tab.
     function createAndRemoveTab() {
       return Task.spawn(function* () {
         // Create a new tab.
         tabScroll = BrowserApp.addTab(URL);
         let browser = tabScroll.browser;
         yield promiseBrowserEvent(browser, "pageshow");
 
@@ -242,32 +242,32 @@ https://bugzilla.mozilla.org/show_bug.cg
         is(scrollY.value, SCROLL_Y, "scrollY set correctly");
 
         // Remove the tab.
         BrowserApp.closeTab(tabScroll);
         yield promiseTabEvent(browser, "SSTabCloseProcessed");
       });
     }
 
-    yield createAndRemoveTab();
+    await createAndRemoveTab();
     let state = ss.getClosedTabs(chromeWin);
     let [{scrolldata}] = state;
     is(scrolldata.scroll, SCROLL_STR, "stored scroll position is correct");
     ok(fuzzyEquals(scrolldata.zoom.resolution, ZOOM), "stored zoom level is correct");
 
     // Pretend the zoom level was originally saved on a rotated device.
     let closedTabData = ss.getClosedTabs(chromeWin)[0];
     let displayWidth = scrolldata.zoom.displaySize.width;
     let displayHeight = scrolldata.zoom.displaySize.height;
     closedTabData.scrolldata.zoom.displaySize.width = displayHeight;
     closedTabData.scrolldata.zoom.displaySize.height = displayWidth;
 
     // Restore the closed tab.
     let browser = ss.undoCloseTab(chromeWin, closedTabData);
-    yield promiseBrowserEvent(browser, "pageshow");
+    await promiseBrowserEvent(browser, "pageshow");
 
     // Check the scroll position and zoom level.
     let ifreq = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
     let utils = ifreq.getInterface(Ci.nsIDOMWindowUtils);
     let scrollX = {}, scrollY = {}, zoom = {};
     utils.getResolution(zoom);
     utils.getScrollXY(false, scrollX, scrollY);
     ok(fuzzyEquals(zoom.value, ZOOM * displayWidth / displayHeight), "recalculated zoom restored correctly");
--- a/mobile/android/tests/browser/chrome/test_session_zombification.html
+++ b/mobile/android/tests/browser/chrome/test_session_zombification.html
@@ -40,136 +40,136 @@ https://bugzilla.mozilla.org/show_bug.cg
       BrowserApp.closeTab(tabTest);
       tabTest = null;
     }
   }
 
   const url1 = "data:text/html;charset=utf-8,It%20was%20a%20dark%20and%20stormy%20night.";
   const url2 = "data:text/html;charset=utf-8,Suddenly%2C%20a%20tab%20was%20zombified.";
 
-  add_task(function* test_sessionStoreZombify() {
+  add_task(async function test_sessionStoreZombify() {
     SimpleTest.registerCleanupFunction(function() {
       cleanupTabs();
     });
 
     // Add a new tab with some content
     tabTest = BrowserApp.addTab(url1, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
 
     // Add a new tab with a blank page
     tabBlank = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id });
     is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
 
     // Zombify the backgrounded test tab
     tabTest.zombify();
 
     // Check that the test tab is actually zombified
     ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
 
     // Switch back to the test tab and wait for it to reload
     BrowserApp.selectTab(tabTest);
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
 
     // Check that the test tab has loaded the correct url
     is(tabTest.browser.currentURI.spec, url1, "Test tab is showing the first URL.");
 
     // Navigate to some other content
     BrowserApp.loadURI(url2, tabTest.browser);
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
     is(tabTest.browser.currentURI.spec, url2, "Test tab is showing the second URL.");
 
     // Switch to the other tab
     BrowserApp.selectTab(tabBlank);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
 
     // Zombify the backgrounded test tab again
     tabTest.zombify();
 
     // Check that the test tab is actually zombified
     ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
 
     // Test that the tab's own function for unzombifying works as well
     tabTest.unzombify();
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
 
     // Check that the test tab has loaded the correct url
     is(tabTest.browser.currentURI.spec, url2, "Test tab is showing the second URL.");
 
     cleanupTabs();
   });
 
-  add_task(function* test_sessionStoreKeepAsZombie() {
+  add_task(async function test_sessionStoreKeepAsZombie() {
     let observerService = Services.obs;
 
     SimpleTest.registerCleanupFunction(function() {
       cleanupTabs();
     });
 
     // Add a new tab with some content
     tabTest = BrowserApp.addTab(url1, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
 
     // Add a new tab with a blank page
     tabBlank = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
 
     // Zombify the backgrounded test tab
     tabTest.zombify();
 
     // Check that the test tab is actually zombified
     ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
     is(tabTest.browser.currentURI.spec, "about:blank", "Test tab is zombified.");
 
     // Tell the session store that it shouldn't restore that tab on selecting
     EventDispatcher.instance.dispatch("Tab:KeepZombified", {nextSelectedTabId: tabTest.id});
 
     // Switch back to the test tab and check that it remains zombified
     BrowserApp.selectTab(tabTest);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabTest, "Test tab is selected.");
     ok(tabTest.browser.__SS_restore, "Test tab is still set for delay loading.");
 
     // Switch to the other tab and back again
     BrowserApp.selectTab(tabBlank);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
     BrowserApp.selectTab(tabTest);
 
     // "Tab:KeepZombified should be good for one TabSelect only
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
     is(BrowserApp.selectedTab, tabTest, "Test tab is selected.");
 
     // Check that the test tab is no longer a zombie and has loaded the correct url
     ok(!tabTest.browser.__SS_restore, "Test tab is no longer set for delay loading.");
     is(tabTest.browser.currentURI.spec, url1, "Test tab is showing the test URL.");
 
     // Zombify the test tab again
     BrowserApp.selectTab(tabBlank);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabBlank, "Test tab is in background.");
     tabTest.zombify();
     ok(tabTest.browser.__SS_restore, "Test tab is set for delay loading.");
     is(tabTest.browser.currentURI.spec, "about:blank", "Test tab is zombified.");
 
     // Tell the session store that it shouldn't restore that tab on selecting
     EventDispatcher.instance.dispatch("Tab:KeepZombified", {nextSelectedTabId: tabTest.id});
 
     // Switch back to the test tab and check that it remains zombified
     BrowserApp.selectTab(tabTest);
-    yield promiseTabEvent(BrowserApp.deck, "TabSelect");
+    await promiseTabEvent(BrowserApp.deck, "TabSelect");
     is(BrowserApp.selectedTab, tabTest, "Test tab is selected.");
     ok(tabTest.browser.__SS_restore, "Test tab is still set for delay loading.");
 
     // Fake an "application-foreground" notification
     observerService.notifyObservers(null, "application-foreground");
 
     // The test tab should now start reloading
-    yield promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
+    await promiseBrowserEvent(tabTest.browser, "DOMContentLoaded");
     ok(!tabTest.browser.__SS_restore, "Test tab is no longer set for delay loading.");
     is(tabTest.browser.currentURI.spec, url1, "Test tab is showing the test URL.");
 
     cleanupTabs();
   });
 
   </script>
 </head>
--- a/mobile/android/tests/browser/chrome/test_settings_fontinflation.html
+++ b/mobile/android/tests/browser/chrome/test_settings_fontinflation.html
@@ -68,108 +68,108 @@ https://bugzilla.mozilla.org/show_bug.cg
   }
 
   SimpleTest.registerCleanupFunction(function() {
     // If anything goes wrong, we want to be sure to leave everything as we came
     resetPrefs();
     cleanupTabs();
   });
 
-  add_task(function* test_sysFontScaleScalesMobilePages() {
+  add_task(async function test_sysFontScaleScalesMobilePages() {
     // Check that we're starting out with the default values
     is(sharedPrefs.getBoolPref(ANDROID_PREF), false, "System font size scaling is disabled");
     is(Services.prefs.getIntPref(GECKO_PREF_FONT_INFLATION), 0, "Gecko-side font inflation is disabled");
 
     // Check the system font scale factor and then enable it for testing
     is(getSystemFontScale(), 1.0, "system font scale is default");
     tab = BrowserApp.addTab(URL_mobile, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
     is(tab.browser.markupDocumentViewer.effectiveTextZoom, 1.0,
        "text zoom is default value");
 
     setSystemFontScale(2.0);
     tab.reloadWithMode(tab.desktopMode);
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
 
     is(getSystemFontScale(), 2.0, "system font scale is enabled");
     is(tab.browser.markupDocumentViewer.effectiveTextZoom, 2.0,
        "text zoom set through system font scale");
     let fontScaleOn = snapshotWindow(tab.browser.contentWindow);
 
     // Reset the system font scale again
     setSystemFontScale(1.0);
     is(getSystemFontScale(), 1.0, "system font scale is default");
 
     tab.reloadWithMode(tab.desktopMode);
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
 
     is(tab.browser.markupDocumentViewer.effectiveTextZoom,
        1.0, "text zoom is back to default value");
     let fontScaleOff = snapshotWindow(tab.browser.contentWindow);
     assertSnapshots(fontScaleOn, fontScaleOff, false, null, "fontScaleOn", "fontScaleOff");
 
     // Now compare with a document that's been zoomed through CSS
     tab.browser.loadURI(URL_mobile_2x);
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
 
     let cssZoom = snapshotWindow(tab.browser.contentWindow);
     assertSnapshots(fontScaleOn, cssZoom, true, null, "fontScaleOn", "cssZoom");
 
     // Load the original document and test normal text zooming
     tab.browser.loadURI(URL_mobile);
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
 
     tab.browser.textZoom = 2.0;
     is(tab.browser.markupDocumentViewer.effectiveTextZoom,
        2.0, "text zoom is enabled");
 
     let textZoom = snapshotWindow(tab.browser.contentWindow);
     assertSnapshots(fontScaleOn, textZoom, true, null, "fontScaleOn", "textZoom");
 
     cleanupTabs();
   });
 
-  add_task(function* test_fontInflationPrecedence() {
+  add_task(async function test_fontInflationPrecedence() {
     // Check that we're starting out with the default values
     is(sharedPrefs.getBoolPref(ANDROID_PREF), false, "System font size scaling is disabled");
     is(Services.prefs.getIntPref(GECKO_PREF_FONT_INFLATION), 0, "Gecko-side font inflation is disabled");
 
     // Check the system font scale factor and then take a screenshot of this base state
     is(getSystemFontScale(), 1.0, "system font scale is default");
     tab = BrowserApp.addTab(URL_desktop, { selected: true, parentId: BrowserApp.selectedTab.id });
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
     is(tab.browser.markupDocumentViewer.effectiveTextZoom,
        1.0, "text zoom is default value");
 
     let noZoom = snapshotWindow(tab.browser.contentWindow);
 
     // Enable font inflation and check that this has some effect
     Services.prefs.setIntPref(GECKO_PREF_FONT_INFLATION, FONT_INFLATION_DEFAULT_VALUE);
 
     tab.reloadWithMode(tab.desktopMode);
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
 
     let fontInflationOn = snapshotWindow(tab.browser.contentWindow);
     assertSnapshots(noZoom, fontInflationOn, false, null, "noZoom", "fontInflationOn");
 
     // Now enable the system font scale and make sure that this doesn't result in any visual change
     setSystemFontScale(2.0);
     tab.reloadWithMode(tab.desktopMode);
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
 
     is(getSystemFontScale(), 2.0, "system font scale is enabled");
     is(tab.browser.markupDocumentViewer.effectiveTextZoom,
        1.0, "text zoom remains at default value");
     let fontScaleWithFontInflation = snapshotWindow(tab.browser.contentWindow);
     assertSnapshots(fontInflationOn, fontScaleWithFontInflation, true, null, "fontInflationOn", "fontScaleWithFontInflation");
 
     // Disable font inflation and check that system font scale zooming becomes active
     Services.prefs.setIntPref(GECKO_PREF_FONT_INFLATION, 0);
     tab.reloadWithMode(tab.desktopMode);
-    yield promiseBrowserEvent(tab.browser, "load");
+    await promiseBrowserEvent(tab.browser, "load");
 
     is(tab.browser.markupDocumentViewer.effectiveTextZoom, 2.0,
        "text zoom set through system font scale zooming");
     let fontScaleNoFontInflation = snapshotWindow(tab.browser.contentWindow);
     assertSnapshots(noZoom, fontScaleNoFontInflation, false, null, "noZoom", "fontScaleNoFontInflation");
 
     // Reset system font scale back to default
     setSystemFontScale(1.0);
@@ -179,44 +179,44 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   // There is a slight delay between flipping the Android shared pref and the
   // Java side listener native call actually getting through to the font scale in
   // nsLayoutUtils, therefore this test MUST run last, otherwise the font scale
   // could unexpectedly be reset in the middle of a following test.
   // However as as long the test environment uses the default Android system font scale,
   // this won't impact other unrelated tests since we set "font.size.systemFontScale"
   // to 1.0 in that case, which already is the default value.
-  add_task(function* test_androidPrefControlsFontInflation() {
+  add_task(async function test_androidPrefControlsFontInflation() {
     // Check that we're starting out with the default values
     is(sharedPrefs.getBoolPref(ANDROID_PREF), false, "System font size scaling is disabled");
     is(Services.prefs.getIntPref(GECKO_PREF_FONT_INFLATION), 0, "Gecko-side font inflation is disabled");
     is(getSystemFontScale(), 1.0, "system font scale is default");
 
     // Flipping the Android pref "on" should enable font inflation
     let observer = makeObserver(_observerId++);
     Services.prefs.addObserver(GECKO_PREF_FONT_INFLATION, observer);
 
     try {
       sharedPrefs.setBoolPref(ANDROID_PREF, true);
-      let result = yield observer.promise;
+      let result = await observer.promise;
 
       is(observer.count, 1, "Gecko pref should have changed only once");
       is(result.data, GECKO_PREF_FONT_INFLATION, "the correct pref has changed");
       is(Services.prefs.getIntPref(GECKO_PREF_FONT_INFLATION), FONT_INFLATION_DEFAULT_VALUE, "Gecko-side font inflation is enabled");
     } finally {
       Services.prefs.removeObserver(GECKO_PREF_FONT_INFLATION, observer);
     }
 
     // ... and turning it back off should disable it again.
     observer = makeObserver(_observerId++);
     Services.prefs.addObserver(GECKO_PREF_FONT_INFLATION, observer);
 
     try {
       sharedPrefs.setBoolPref(ANDROID_PREF, false);
-      let result = yield observer.promise;
+      let result = await observer.promise;
 
       is(observer.count, 1, "Gecko pref should have changed only once");
       is(result.data, GECKO_PREF_FONT_INFLATION, "the correct pref has changed");
       is(Services.prefs.getIntPref(GECKO_PREF_FONT_INFLATION), 0, "Gecko-side font inflation is disabled");
     } finally {
       Services.prefs.removeObserver(GECKO_PREF_FONT_INFLATION, observer);
     }
   });
--- a/mobile/android/tests/browser/chrome/test_shared_preferences.html
+++ b/mobile/android/tests/browser/chrome/test_shared_preferences.html
@@ -15,17 +15,17 @@ Migrated from Robocop: https://bugzilla.
   <script type="application/javascript">
 
   ChromeUtils.import("resource://gre/modules/SharedPreferences.jsm");
   ChromeUtils.import("resource://gre/modules/Promise.jsm");
   ChromeUtils.import("resource://gre/modules/Task.jsm");
 
   let _observerId = 0;
 
-  add_task(function* test_get_set() {
+  add_task(async function test_get_set() {
     let branch = SharedPreferences.forAndroid("test");
 
     branch.setBoolPref("boolKey", true);
     branch.setCharPref("charKey", "string value");
     branch.setIntPref("intKey", 1000);
 
     is(branch.getBoolPref("boolKey"), true);
     is(branch.getCharPref("charKey"), "string value");
@@ -39,17 +39,17 @@ Migrated from Robocop: https://bugzilla.
     is(branch.getCharPref("charKey"), "different string value");
     is(branch.getIntPref("intKey"), -2000);
 
     is(typeof(branch.getBoolPref("boolKey")), "boolean");
     is(typeof(branch.getCharPref("charKey")), "string");
     is(typeof(branch.getIntPref("intKey")), "number");
   });
 
-  add_task(function* test_default() {
+  add_task(async function test_default() {
     let branch = SharedPreferences.forAndroid();
 
     branch.setBoolPref("boolKey", true);
     branch.setCharPref("charKey", "string value");
     branch.setIntPref("intKey", 1000);
 
     is(branch.getBoolPref("boolKey"), true);
     is(branch.getCharPref("charKey"), "string value");
@@ -63,47 +63,47 @@ Migrated from Robocop: https://bugzilla.
     is(branch.getCharPref("charKey"), "different string value");
     is(branch.getIntPref("intKey"), -2000);
 
     is(typeof(branch.getBoolPref("boolKey")), "boolean");
     is(typeof(branch.getCharPref("charKey")), "string");
     is(typeof(branch.getIntPref("intKey")), "number");
   });
 
-  add_task(function* test_multiple_branches() {
+  add_task(async function test_multiple_branches() {
     let branch1 = SharedPreferences.forAndroid("test1");
     let branch2 = SharedPreferences.forAndroid("test2");
 
     branch1.setBoolPref("boolKey", true);
     branch2.setBoolPref("boolKey", false);
 
     is(branch1.getBoolPref("boolKey"), true);
     is(branch2.getBoolPref("boolKey"), false);
 
     branch1.setCharPref("charKey", "a value");
     branch2.setCharPref("charKey", "a different value");
 
     is(branch1.getCharPref("charKey"), "a value");
     is(branch2.getCharPref("charKey"), "a different value");
   });
 
-  add_task(function* test_add_remove_observer() {
+  add_task(async function test_add_remove_observer() {
     let branch = SharedPreferences.forAndroid("test");
 
     branch.setBoolPref("boolKey", false);
     is(branch.getBoolPref("boolKey"), false);
 
     let obs1 = makeObserver(_observerId++);
     branch.addObserver("boolKey", obs1);
 
     try {
       branch.setBoolPref("boolKey", true);
       is(branch.getBoolPref("boolKey"), true);
 
-      let value1 = yield obs1.promise;
+      let value1 = await obs1.promise;
       is(obs1.count, 1);
 
       is(value1.subject, obs1);
       is(value1.topic, "boolKey");
       is(typeof(value1.data), "boolean");
       is(value1.data, true);
     } finally {
       branch.removeObserver("boolKey", obs1);
@@ -117,63 +117,63 @@ Migrated from Robocop: https://bugzilla.
 
     let obs2 = makeObserver(_observerId++);
     branch.addObserver("boolKey", obs2);
 
     try {
       branch.setBoolPref("boolKey", false);
       is(branch.getBoolPref("boolKey"), false);
 
-      let value2 = yield obs2.promise;
+      let value2 = await obs2.promise;
       is(obs2.count, 1);
 
       is(value2.subject, obs2);
       is(value2.topic, "boolKey");
       is(typeof(value2.data), "boolean");
       is(value2.data, false);
 
       // Original observer count is preserved.
       is(obs1.count, 1);
     } finally {
       branch.removeObserver("boolKey", obs2);
     }
   });
 
-  add_task(function* test_observer_ignores() {
+  add_task(async function test_observer_ignores() {
     let branch = SharedPreferences.forAndroid("test");
 
     branch.setCharPref("charKey", "first value");
     is(branch.getCharPref("charKey"), "first value");
 
     let obs = makeObserver(_observerId++);
     branch.addObserver("charKey", obs);
 
     try {
       // These should all be ignored.
       branch.setBoolPref("boolKey", true);
       branch.setBoolPref("boolKey", false);
       branch.setIntPref("intKey", -3000);
       branch.setIntPref("intKey", 4000);
 
       branch.setCharPref("charKey", "a value");
-      let value = yield obs.promise;
+      let value = await obs.promise;
 
       // Observer should have been notified exactly once.
       is(obs.count, 1);
 
       is(value.subject, obs);
       is(value.topic, "charKey");
       is(typeof(value.data), "string");
       is(value.data, "a value");
     } finally {
       branch.removeObserver("charKey", obs);
     }
   });
 
-  add_task(function* test_observer_ignores_branches() {
+  add_task(async function test_observer_ignores_branches() {
     let branch = SharedPreferences.forAndroid("test");
 
     branch.setCharPref("charKey", "first value");
     is(branch.getCharPref("charKey"), "first value");
 
     let obs = makeObserver(_observerId++);
     branch.addObserver("charKey", obs);
 
@@ -182,31 +182,31 @@ Migrated from Robocop: https://bugzilla.
       let branch2 = SharedPreferences.forAndroid("test2");
       branch2.setCharPref("charKey", "a wrong value");
       let branch3 = SharedPreferences.forAndroid("test.2");
       branch3.setCharPref("charKey", "a different wrong value");
 
       // This should not be ignored.
       branch.setCharPref("charKey", "a value");
 
-      let value = yield obs.promise;
+      let value = await obs.promise;
 
       // Observer should have been notified exactly once.
       is(obs.count, 1);
 
       is(value.subject, obs);
       is(value.topic, "charKey");
       is(typeof(value.data), "string");
       is(value.data, "a value");
     } finally {
       branch.removeObserver("charKey", obs);
     }
   });
 
-  add_task(function* test_scopes() {
+  add_task(async function test_scopes() {
     let forApp = SharedPreferences.forApp();
     let forProfile = SharedPreferences.forProfile();
     let forProfileName = SharedPreferences.forProfileName("testProfile");
     let forAndroidDefault = SharedPreferences.forAndroid();
     let forAndroidBranch = SharedPreferences.forAndroid("testBranch");
 
     forApp.setCharPref("charKey", "forApp");
     forProfile.setCharPref("charKey", "forProfile");
--- a/mobile/android/tests/browser/chrome/test_web_channel.html
+++ b/mobile/android/tests/browser/chrome/test_web_channel.html
@@ -91,20 +91,20 @@ Migrated from Robocop: https://bugzilla.
           });
 
           tab = BrowserApp.addTab(HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
         });
       }
     }
   ]; // gTests
 
-  add_task(function* run_all() {
+  add_task(async function run_all() {
     for (let test of gTests) {
       info("Running: " + test.desc);
-      yield test.run();
+      await test.run();
     }
   });
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1174458">Mozilla Bug 1174458</a>
 <br>
--- a/mobile/android/tests/browser/robocop/testAccessibleCarets.js
+++ b/mobile/android/tests/browser/robocop/testAccessibleCarets.js
@@ -147,30 +147,30 @@ function UIhasActionByID(expectedActionI
 function closeSelectionUI() {
   gChromeWin.WindowEventDispatcher.dispatch("TextSelection:End",
     {selectionID: gActionBarHandler._selectionID});
 }
 
 /**
  * Main test method.
  */
-add_task(function* testAccessibleCarets() {
+add_task(async function testAccessibleCarets() {
   // Wait to start loading our test page until after the initial browser tab is
   // completely loaded. This allows each tab to complete its layer initialization,
   // importantly, its viewport and zoomContraints info.
   let BrowserApp = gChromeWin.BrowserApp;
-  yield do_promiseTabChangeEvent(BrowserApp.selectedTab.id, TAB_STOP_EVENT);
+  await do_promiseTabChangeEvent(BrowserApp.selectedTab.id, TAB_STOP_EVENT);
 
   // Ensure Gecko Selection and Touch carets are enabled.
   Services.prefs.setBoolPref(ACCESSIBLECARET_PREF, true);
 
   // Load test page, wait for load completion, register cleanup.
   let browser = BrowserApp.addTab(BASE_TEST_URL).browser;
   let tab = BrowserApp.getTabForBrowser(browser);
-  yield do_promiseTabChangeEvent(tab.id, TAB_STOP_EVENT);
+  await do_promiseTabChangeEvent(tab.id, TAB_STOP_EVENT);
 
   do_register_cleanup(function cleanup() {
     BrowserApp.closeTab(tab);
     Services.prefs.clearUserPref(ACCESSIBLECARET_PREF);
   });
 
   // References to test document elements.
   let doc = browser.contentDocument;
@@ -273,27 +273,27 @@ add_task(function* testAccessibleCarets(
   // Close Selection UI (ActionBar or FloatingToolbar) and complete test.
   closeSelectionUI();
   ok(true, "Finished testAccessibleCarets tests.");
 });
 
 /**
  * DesignMode test method.
  */
-add_task(function* testAccessibleCarets_designMode() {
+add_task(async function testAccessibleCarets_designMode() {
   let BrowserApp = gChromeWin.BrowserApp;
 
   // Pre-populate the clipboard to ensure PASTE action available.
   Cc["@mozilla.org/widget/clipboardhelper;1"].
     getService(Ci.nsIClipboardHelper).copyString("somethingMagical");
 
   // Load test page, wait for load completion.
   let browser = BrowserApp.addTab(DESIGNMODE_TEST_URL).browser;
   let tab = BrowserApp.getTabForBrowser(browser, { selected: true });
-  yield do_promiseTabChangeEvent(tab.id, TAB_STOP_EVENT);
+  await do_promiseTabChangeEvent(tab.id, TAB_STOP_EVENT);
 
   // References to test document elements, ActionBarHandler.
   let doc = browser.contentDocument;
   let tc_LTR_elem = doc.getElementById("LTRtextContent");
   let tc_RTL_elem = doc.getElementById("RTLtextContent");
 
   // Locate longpress midpoints for test elements, ensure expactations.
   let tc_LTR_midPoint = getCharPressPoint(doc, tc_LTR_elem, 5, "x");
--- a/mobile/android/tests/browser/robocop/testFindInPage.js
+++ b/mobile/android/tests/browser/robocop/testFindInPage.js
@@ -58,32 +58,32 @@ function assertSelection(document, expec
     do_check_eq(sel.toString(), expectedSelection);
   }
   if (expectedAnchorText) {
     do_print("Assert anchor text to be " + expectedAnchorText);
     do_check_eq(sel.anchorNode.textContent, expectedAnchorText);
   }
 }
 
-add_task(function* testFindInPage() {
-  let browser = yield openTabWithUrl(TEST_URL);
+add_task(async function testFindInPage() {
+  let browser = await openTabWithUrl(TEST_URL);
   let document = browser.contentDocument;
 
-  yield findInPage(browser, "Robocoop", 1);
+  await findInPage(browser, "Robocoop", 1);
   assertSelection(document);
 
-  yield closeFindInPage(browser);
+  await closeFindInPage(browser);
   assertSelection(document);
 
-  yield findInPage(browser, "Robocop", 1);
+  await findInPage(browser, "Robocop", 1);
   assertSelection(document, "Robocop", " Robocop 1 ");
 
-  yield closeFindInPage(browser);
+  await closeFindInPage(browser);
   assertSelection(document);
 
-  yield findInPage(browser, "Robocop", 3);
+  await findInPage(browser, "Robocop", 3);
   assertSelection(document, "Robocop", " Robocop 3 ");
 
-  yield closeFindInPage(browser);
+  await closeFindInPage(browser);
   assertSelection(document);
 });
 
 run_next_test();
--- a/mobile/android/tests/browser/robocop/testHistoryService.js
+++ b/mobile/android/tests/browser/robocop/testHistoryService.js
@@ -78,46 +78,46 @@ add_test(function setup_browser() {
   // Load a blank page
   let url = "about:blank";
   gBrowser = BrowserApp.addTab(url, { selected: true, parentId: BrowserApp.selectedTab.id }).browser;
   gBrowser.addEventListener("load", function(event) {
     Services.tm.dispatchToMainThread(run_next_test);
   }, {capture: true, once: true});
 });
 
-add_task(function* () {
+add_task(async function() {
   // Wait for any initial page loads to be saved to history
-  yield sleep(PENDING_VISIT_WAIT);
+  await sleep(PENDING_VISIT_WAIT);
 
   // Load a simple HTML page with no redirects
   gVisitURLs = [];
-  yield promiseLoadEvent(gBrowser, "http://example.org/tests/robocop/robocop_blank_01.html");
-  yield sleep(PENDING_VISIT_WAIT_LONG);
+  await promiseLoadEvent(gBrowser, "http://example.org/tests/robocop/robocop_blank_01.html");
+  await sleep(PENDING_VISIT_WAIT_LONG);
 
   do_print("visit counts: " + gVisitURLs.length);
   ok(gVisitURLs.length == 1, "Simple visit makes 1 history item");
 
   do_print("visit URL: " + gVisitURLs[0]);
   ok(gVisitURLs[0] == "http://example.org/tests/robocop/robocop_blank_01.html", "Simple visit makes final history item");
 
   // Load a simple HTML page via a 301 temporary redirect
   gVisitURLs = [];
-  yield promiseLoadEvent(gBrowser, "http://example.org/tests/robocop/simple_redirect.sjs?http://example.org/tests/robocop/robocop_blank_02.html");
-  yield sleep(PENDING_VISIT_WAIT);
+  await promiseLoadEvent(gBrowser, "http://example.org/tests/robocop/simple_redirect.sjs?http://example.org/tests/robocop/robocop_blank_02.html");
+  await sleep(PENDING_VISIT_WAIT);
 
   do_print("visit counts: " + gVisitURLs.length);
   ok(gVisitURLs.length == 1, "Simple 301 redirect makes 1 history item");
 
   do_print("visit URL: " + gVisitURLs[0]);
   ok(gVisitURLs[0] == "http://example.org/tests/robocop/robocop_blank_02.html", "Simple 301 redirect makes final history item");
 
   // Load a simple HTML page via a JavaScript redirect
   gVisitURLs = [];
-  yield promiseLoadEvent(gBrowser, "http://example.org/tests/robocop/javascript_redirect.sjs?http://example.org/tests/robocop/robocop_blank_03.html");
-  yield sleep(PENDING_VISIT_WAIT);
+  await promiseLoadEvent(gBrowser, "http://example.org/tests/robocop/javascript_redirect.sjs?http://example.org/tests/robocop/robocop_blank_03.html");
+  await sleep(PENDING_VISIT_WAIT);
 
   do_print("visit counts: " + gVisitURLs.length);
   ok(gVisitURLs.length == 2, "JavaScript redirect makes 2 history items");
 
   do_print("visit URL 1: " + gVisitURLs[0]);
   ok(gVisitURLs[0] == "http://example.org/tests/robocop/javascript_redirect.sjs?http://example.org/tests/robocop/robocop_blank_03.html", "JavaScript redirect makes intermediate history item");
 
   do_print("visit URL 2: " + gVisitURLs[1]);
--- a/mobile/android/tests/browser/robocop/testReadingListCache.js
+++ b/mobile/android/tests/browser/robocop/testReadingListCache.js
@@ -33,84 +33,84 @@ var TEST_PAGES = [
     expected: {
       title: "Building XULRunner | MDN",
       byline: null,
       excerpt: "XULRunner is built using basically the same process as Firefox or other applications. Please read and follow the general Build Documentation for instructions on how to get sources and set up build prerequisites.",
     }
   },
 ];
 
-add_task(function* test_article_not_found() {
-  let article = yield ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
+add_task(async function test_article_not_found() {
+  let article = await ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
   do_check_eq(article, null);
 });
 
-add_task(function* test_store_article() {
+add_task(async function test_store_article() {
   // Create an article object to store in the cache.
-  yield ReaderMode.storeArticleInCache({
+  await ReaderMode.storeArticleInCache({
     url: TEST_PAGES[0].url,
     content: "Lorem ipsum",
     title: TEST_PAGES[0].expected.title,
     byline: TEST_PAGES[0].expected.byline,
     excerpt: TEST_PAGES[0].expected.excerpt,
   });
 
-  let article = yield ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
+  let article = await ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
   checkArticle(article, TEST_PAGES[0]);
 });
 
-add_task(function* test_remove_article() {
-  yield ReaderMode.removeArticleFromCache(TEST_PAGES[0].url);
-  let article = yield ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
+add_task(async function test_remove_article() {
+  await ReaderMode.removeArticleFromCache(TEST_PAGES[0].url);
+  let article = await ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
   do_check_eq(article, null);
 });
 
-add_task(function* test_parse_articles() {
+add_task(async function test_parse_articles() {
   for (let testcase of TEST_PAGES) {
-    let article = yield ReaderMode.downloadAndParseDocument(testcase.url);
+    let article = await ReaderMode.downloadAndParseDocument(testcase.url);
     checkArticle(article, testcase);
   }
 });
 
-add_task(function* test_migrate_cache() {
+add_task(async function test_migrate_cache() {
   // Store an article in the old indexedDB reader mode cache.
-  let cacheDB = yield new Promise((resolve, reject) => {
+  let cacheDB = await new Promise((resolve, reject) => {
     let win = Services.wm.getMostRecentWindow("navigator:browser");
     let request = win.indexedDB.open("about:reader", 1);
     request.onerror = event => reject(request.error);
 
     // This will always happen because there is no pre-existing data store.
     request.onupgradeneeded = event => {
       let cacheDB2 = event.target.result;
       cacheDB2.createObjectStore("articles", { keyPath: "url" });
     };
 
     request.onsuccess = event => resolve(event.target.result);
   });
 
-  yield new Promise((resolve, reject) => {
+  await new Promise((resolve, reject) => {
     let transaction = cacheDB.transaction(["articles"], "readwrite");
     let store = transaction.objectStore("articles");
 
     let request = store.add({
       url: TEST_PAGES[0].url,
       content: "Lorem ipsum",
       title: TEST_PAGES[0].expected.title,
       byline: TEST_PAGES[0].expected.byline,
       excerpt: TEST_PAGES[0].expected.excerpt,
     });
     request.onerror = event => reject(request.error);
     request.onsuccess = event => resolve();
   });
 
   // Migrate the cache.
-  yield Reader.migrateCache();
+  await Reader.migrateCache();
 
   // Check to make sure the article made it into the new cache.
-  let article = yield ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
+  let article = await ReaderMode.getArticleFromCache(TEST_PAGES[0].url);
   checkArticle(article, TEST_PAGES[0]);
 });
 
 function checkArticle(article, testcase) {
   if (testcase.expected == null) {
     do_check_eq(article, null);
     return;
   }
--- a/mobile/android/tests/browser/robocop/testRuntimePermissionsAPI.js
+++ b/mobile/android/tests/browser/robocop/testRuntimePermissionsAPI.js
@@ -4,17 +4,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* eslint-disable mozilla/use-chromeutils-import */
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "RuntimePermissions", "resource://gre/modules/RuntimePermissions.jsm");
 
-add_task(function* test_snackbar_api() {
+add_task(async function test_snackbar_api() {
   RuntimePermissions.waitForPermissions([
     RuntimePermissions.CAMERA,
     RuntimePermissions.RECORD_AUDIO,
     RuntimePermissions.WRITE_EXTERNAL_STORAGE
   ]);
 });
 
 run_next_test();
--- a/mobile/android/tests/browser/robocop/testSnackbarAPI.js
+++ b/mobile/android/tests/browser/robocop/testSnackbarAPI.js
@@ -5,22 +5,22 @@
 
 /* eslint-disable mozilla/use-chromeutils-import */
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "EventDispatcher", "resource://gre/modules/Messaging.jsm");
 
-add_task(function* test_snackbar_api() {
+add_task(async function test_snackbar_api() {
   Snackbars.show("This is a Snackbar", Snackbars.LENGTH_INDEFINITE, {
     action: {
       label: "Click me",
       callback: function() {}
     }
   });
 
-  yield EventDispatcher.instance.sendRequestForResult({
+  await EventDispatcher.instance.sendRequestForResult({
     type: "Robocop:WaitOnUI"
   });
 });
 
 run_next_test();
--- a/mobile/android/tests/browser/robocop/testTrackingProtection.js
+++ b/mobile/android/tests/browser/robocop/testTrackingProtection.js
@@ -82,89 +82,89 @@ function doUpdate() {
     dbService.finishUpdate();
   });
 }
 
 var BrowserApp = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
 
 // Tests the tracking protection UI in private browsing. By default, tracking protection is
 // enabled in private browsing ("privacy.trackingprotection.pbmode.enabled").
-add_task(function* test_tracking_pb() {
+add_task(async function test_tracking_pb() {
   // Load a blank page
   let browser = BrowserApp.addTab("about:blank", { selected: true, parentId: BrowserApp.selectedTab.id, isPrivate: true }).browser;
-  yield new Promise((resolve, reject) => {
+  await new Promise((resolve, reject) => {
     browser.addEventListener("load", function(event) {
       Services.tm.dispatchToMainThread(resolve);
     }, {capture: true, once: true});
   });
 
   // Populate and use 'test-track-simple' for tracking protection lookups
   Services.prefs.setCharPref(TABLE, "test-track-simple");
-  yield doUpdate();
+  await doUpdate();
 
   // Point tab to a test page NOT containing tracking elements
-  yield promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_good.html");
+  await promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_good.html");
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "unknown" });
 
   // Point tab to a test page containing tracking elements
-  yield promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
+  await promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "tracking_content_blocked" });
 
   // Simulate a click on the "Disable protection" button in the site identity popup.
   // We need to wait for a "load" event because "Session:Reload" will cause a full page reload.
-  yield promiseLoadEvent(browser, undefined, undefined, () => {
+  await promiseLoadEvent(browser, undefined, undefined, () => {
     EventDispatcher.instance.dispatch("Session:Reload", {
       allowContent: true,
       contentType: "tracking",
     });
   });
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "tracking_content_loaded" });
 
   // Simulate a click on the "Enable protection" button in the site identity popup.
-  yield promiseLoadEvent(browser, undefined, undefined, () => {
+  await promiseLoadEvent(browser, undefined, undefined, () => {
     EventDispatcher.instance.dispatch("Session:Reload", {
       allowContent: false,
       contentType: "tracking",
     });
   });
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "tracking_content_blocked" });
 
   // Disable tracking protection to make sure we don't show the UI when the pref is disabled.
   Services.prefs.setBoolPref("privacy.trackingprotection.pbmode.enabled", false);
 
   // Point tab to a test page containing tracking elements
-  yield promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
+  await promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "unknown" });
 
   // Point tab to a test page NOT containing tracking elements
-  yield promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_good.html");
+  await promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_good.html");
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "unknown" });
 
   // Reset the pref before the next testcase
   Services.prefs.clearUserPref("privacy.trackingprotection.pbmode.enabled");
 });
 
-add_task(function* test_tracking_not_pb() {
+add_task(async function test_tracking_not_pb() {
   // Load a blank page
   let browser = BrowserApp.addTab("about:blank", { selected: true }).browser;
-  yield new Promise((resolve, reject) => {
+  await new Promise((resolve, reject) => {
     browser.addEventListener("load", function(event) {
       Services.tm.dispatchToMainThread(resolve);
     }, {capture: true, once: true});
   });
 
   // Point tab to a test page NOT containing tracking elements
-  yield promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_good.html");
+  await promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_good.html");
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "unknown" });
 
   // Point tab to a test page containing tracking elements (tracking protection UI *should not* be shown)
-  yield promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
+  await promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "unknown" });
 
   // Enable tracking protection in normal tabs
   Services.prefs.setBoolPref("privacy.trackingprotection.enabled", true);
 
   // Point tab to a test page containing tracking elements (tracking protection UI *should* be shown)
-  yield promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
+  await promiseLoadEvent(browser, "http://tracking.example.org/tests/robocop/tracking_bad.html");
   EventDispatcher.instance.sendRequest({ type: "Test:Expected", expected: "tracking_content_blocked" });
 });
 
 run_next_test();
--- a/testing/mochitest/chrome/test_sanityAddTask.xul
+++ b/testing/mochitest/chrome/test_sanityAddTask.xul
@@ -10,28 +10,28 @@
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"/>
   <script type="application/javascript">
     <![CDATA[
 
       // Check that we can 'add_task' a few times and all tasks run asynchronously before test finishes.
 
-      add_task(function* () {
-        var x = yield Promise.resolve(1);
+      add_task(async function() {
+        var x = await Promise.resolve(1);
         is(x, 1, "task yields Promise value as expected");
       });
 
-      add_task(function* () {
-        var x = yield [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)];
+      add_task(async function() {
+        var x = await [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)];
         is(x.join(""), "123", "task yields Promise value as expected");
       });
 
-      add_task(function* () {
-        var x = yield (function* () {
+      add_task(async function() {
+        var x = await (function* () {
           return 3;
         }());
         is(x, 3, "task yields generator function return value as expected");
       });
 
     ]]>
   </script>
   <body xmlns="http://www.w3.org/1999/xhtml" >
--- a/testing/mochitest/tests/Harness_sanity/test_add_task.html
+++ b/testing/mochitest/tests/Harness_sanity/test_add_task.html
@@ -10,28 +10,28 @@
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug 1187701</a>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 // Check that we can 'add_task' a few times and all tasks run asynchronously before test finishes.
 
-add_task(function* () {
-  var x = yield Promise.resolve(1);
+add_task(async function() {
+  var x = await Promise.resolve(1);
   is(x, 1, "task yields Promise value as expected");
 });
 
-add_task(function* () {
-  var x = yield [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)];
+add_task(async function() {
+  var x = await [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)];
   is(x.join(""), "123", "task yields Promise value as expected");
 });
 
-add_task(function* () {
-  var x = yield (function* () {
+add_task(async function() {
+  var x = await (function* () {
     return 3;
   }());
   is(x, 3, "task yields generator function return value as expected");
 });
 </script>
 </pre>
 </body>
 </html>
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_redirect_data_uri.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_redirect_data_uri.html
@@ -18,17 +18,17 @@
  * Since there is no good way to communicate loaded data: URI scripts
  * we use updating a divContainer as a detour to verify the data: URI
  * script has loaded.
  */
 
 const WIN_URL =
   "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest/file_redirect_data_uri.html";
 
-add_task(function* test_webRequest_redirect_data_uri() {
+add_task(async function test_webRequest_redirect_data_uri() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: [
         "webRequest",
         "webRequestBlocking",
         "*://mochi.test/tests/*",
       ],
       content_scripts: [{
@@ -66,19 +66,19 @@ add_task(function* test_webRequest_redir
         scriptEl.onerror = function() {
           browser.test.fail("script load failure");
           browser.test.sendMessage("finished");
         };
       },
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
   let win = window.open(WIN_URL);
-  yield extension.awaitMessage("finished");
+  await extension.awaitMessage("finished");
   win.close();
-  yield extension.unload();
+  await extension.unload();
 });
 
 </script>
 
 </body>
 </html>
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upgrade.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upgrade.html
@@ -8,17 +8,17 @@
   <script type="text/javascript" src="head.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
-add_task(function* test_webRequest_upgrade() {
+add_task(async function test_webRequest_upgrade() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: [
         "webRequest",
         "webRequestBlocking",
         "*://mochi.test/tests/*",
       ],
     },
@@ -41,24 +41,24 @@ add_task(function* test_webRequest_upgra
         if (details.url.includes("file_mixed.html")) {
           let redirectUrl = new URL("file_sample.html", details.url).href;
           return {redirectUrl};
         }
       }, {urls: ["*://mochi.test/tests/*"]}, ["blocking"]);
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
   let win = window.open("http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest/file_mixed.html");
-  yield extension.awaitMessage("finished");
+  await extension.awaitMessage("finished");
   win.close();
-  yield extension.unload();
+  await extension.unload();
 });
 
-add_task(function* test_webRequest_redirect_wins() {
+add_task(async function test_webRequest_redirect_wins() {
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       permissions: [
         "webRequest",
         "webRequestBlocking",
         "*://mochi.test/tests/*",
       ],
     },
@@ -73,18 +73,18 @@ add_task(function* test_webRequest_redir
         if (details.url.includes("file_mixed.html")) {
           let redirectUrl = new URL("file_sample.html", details.url).href;
           return {upgradeToSecure: true, redirectUrl};
         }
       }, {urls: ["*://mochi.test/tests/*"]}, ["blocking"]);
     },
   });
 
-  yield extension.startup();
+  await extension.startup();
   let win = window.open("http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest/file_mixed.html");
-  yield extension.awaitMessage("finished");
+  await extension.awaitMessage("finished");
   win.close();
-  yield extension.unload();
+  await extension.unload();
 });
 </script>
 
 </body>
 </html>
--- a/toolkit/components/normandy/test/unit/test_SandboxManager.js
+++ b/toolkit/components/normandy/test/unit/test_SandboxManager.js
@@ -1,15 +1,15 @@
 "use strict";
 
 ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm");
 
 // wrapAsync should wrap privileged Promises with Promises that are usable by
 // the sandbox.
-add_task(function* () {
+add_task(async function() {
   const manager = new SandboxManager();
   manager.addHold("testing");
 
   manager.cloneIntoGlobal("driver", {
     async privileged() {
       return "privileged";
     },
     wrapped: manager.wrapAsync(async function() {
@@ -20,17 +20,17 @@ add_task(function* () {
       return this.aValue;
     }),
   }, {cloneFunctions: true});
 
   // Assertion helpers
   manager.addGlobal("ok", ok);
   manager.addGlobal("equal", equal);
 
-  const sandboxResult = yield new Promise(resolve => {
+  const sandboxResult = await new Promise(resolve => {
     manager.addGlobal("resolve", result => resolve(result));
     manager.evalInSandbox(`
       // Unwrapped privileged promises are not accessible in the sandbox
       try {
         const privilegedResult = driver.privileged().then(() => false);
         ok(false, "The sandbox could not use a privileged Promise");
       } catch (err) { }
 
@@ -40,31 +40,31 @@ add_task(function* () {
 
       // Resolve the Promise around the sandbox with the wrapped result to test
       // that the Promise in the sandbox works.
       wrappedResult.then(resolve);
     `);
   });
   equal(sandboxResult, "wrapped", "wrapAsync methods return Promises that work in the sandbox");
 
-  yield manager.evalInSandbox(`
+  await manager.evalInSandbox(`
     (async function sandboxTest() {
       equal(
         await driver.wrappedThis(),
         "aValue",
         "wrapAsync preserves the behavior of the this keyword",
       );
     })();
   `);
 
   manager.removeHold("testing");
 });
 
 // wrapAsync cloning options
-add_task(function* () {
+add_task(async function() {
   const manager = new SandboxManager();
   manager.addHold("testing");
 
   // clonedArgument stores the argument passed to cloned(), which we use to test
   // that arguments from within the sandbox are cloned outside.
   let clonedArgument = null;
   manager.cloneIntoGlobal("driver", {
     uncloned: manager.wrapAsync(async function() {
@@ -75,17 +75,17 @@ add_task(function* () {
       return {value: "cloned"};
     }, {cloneInto: true, cloneArguments: true}),
   }, {cloneFunctions: true});
 
   // Assertion helpers
   manager.addGlobal("ok", ok);
   manager.addGlobal("deepEqual", deepEqual);
 
-  yield new Promise(resolve => {
+  await new Promise(resolve => {
     manager.addGlobal("resolve", resolve);
     manager.evalInSandbox(`
       (async function() {
         // The uncloned return value should be privileged and inaccesible.
         const uncloned = await driver.uncloned();
         ok(!("value" in uncloned), "The sandbox could not use an uncloned return value");
 
         // The cloned return value should be usable.
--- a/toolkit/modules/tests/xpcshell/test_Log.js
+++ b/toolkit/modules/tests/xpcshell/test_Log.js
@@ -580,29 +580,29 @@ add_task(async function log_template_lit
     Assert.equal(msg.split("\t")[3], "Test foo 42");
   }
 });
 
 /*
  * Check that we format JS Errors reasonably.
  * This needs to stay a generator to exercise Task.jsm's stack rewriting.
  */
-add_task(function* format_errors() {
+add_task(async function format_errors() {
   let pFormat = new Log.ParameterFormatter();
 
   // Test that subclasses of Error are recognized as errors.
   let err = new ReferenceError("Ref Error", "ERROR_FILE", 28);
   let str = pFormat.format(err);
   Assert.ok(str.includes("ReferenceError"));
   Assert.ok(str.includes("ERROR_FILE:28"));
   Assert.ok(str.includes("Ref Error"));
 
   // Test that JS-generated Errors are recognized and formatted.
   try {
-    yield Promise.resolve(); // Scrambles the stack
+    await Promise.resolve(); // Scrambles the stack
     // eslint-disable-next-line no-eval
     eval("javascript syntax error");
   } catch (e) {
     str = pFormat.format(e);
     Assert.ok(str.includes("SyntaxError: unexpected token"));
     // Make sure we identified it as an Error and formatted the error location as
     // lineNumber:columnNumber.
     Assert.ok(str.includes(":1:11)"));
--- a/widget/headless/tests/test_headless.js
+++ b/widget/headless/tests/test_headless.js
@@ -92,20 +92,20 @@ add_task(async function test_snapshot() 
       break;
     }
   }
   ok(found, "Found blue text on page.");
 
   webNavigation.close();
 });
 
-add_task(function* test_snapshot_widget_layers() {
+add_task(async function test_snapshot_widget_layers() {
   let windowlessBrowser = Services.appShell.createWindowlessBrowser(false);
   let webNavigation = windowlessBrowser.QueryInterface(Ci.nsIWebNavigation);
-  let contentWindow = yield loadContentWindow(webNavigation, HEADLESS_URL);
+  let contentWindow = await loadContentWindow(webNavigation, HEADLESS_URL);
   const contentWidth = 1;
   const contentHeight = 2;
   // Verify dimensions.
   contentWindow.resizeTo(contentWidth, contentHeight);
   equal(contentWindow.innerWidth, contentWidth);
   equal(contentWindow.innerHeight, contentHeight);
 
   // Snapshot the test page.