Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop.
authorFlorian Quèze <florian@queze.net>
Thu, 22 Jun 2017 12:51:42 +0200
changeset 401262 b0dd91a6a1fd347587ecaef9f81c04de937d7f31
parent 401261 13e37d5702f816cd5af967005c1a9aebca00d835
child 401263 9c7644b6de3c0f21c83d0fabce9eb81dac9a7016
push idunknown
push userunknown
push dateunknown
reviewersMossop
bugs1374282
milestone56.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 1374282 - script generated patch to remove Task.jsm calls, r=Mossop.
addon-sdk/source/lib/sdk/system/child_process/subprocess.js
caps/tests/mochitest/browser_checkloaduri.js
docshell/test/browser/browser_bug1206879.js
docshell/test/browser/browser_bug1309900_crossProcessHistoryNavigation.js
docshell/test/browser/browser_bug349769.js
docshell/test/browser/browser_bug388121-1.js
docshell/test/browser/browser_bug422543.js
docshell/test/browser/browser_bug503832.js
docshell/test/browser/browser_bug554155.js
docshell/test/browser/browser_bug655273.js
docshell/test/browser/browser_bug670318.js
docshell/test/browser/browser_click_link_within_view_source.js
docshell/test/browser/browser_grouped_shistory_bfcache_cleaning.js
docshell/test/browser/browser_grouped_shistory_crossproc.js
docshell/test/browser/browser_grouped_shistory_dead_navigate.js
docshell/test/browser/browser_history_triggeringprincipal_viewsource.js
docshell/test/browser/browser_multiple_pushState.js
docshell/test/browser/browser_tab_touch_events.js
docshell/test/browser/browser_timelineMarkers-01.js
docshell/test/browser/browser_ua_emulation.js
docshell/test/browser/browser_uriFixupAlternateRedirects.js
docshell/test/browser/browser_uriFixupIntegration.js
docshell/test/browser/frame-head.js
docshell/test/browser/head.js
docshell/test/navigation/browser_bug343515.js
docshell/test/navigation/browser_test-content-chromeflags.js
docshell/test/unit/test_setUsePrivateBrowsing.js
dom/animation/test/chrome/test_restyles.html
dom/base/test/browser_bug1011748.js
dom/base/test/browser_bug1058164.js
dom/base/test/browser_bug1303838.js
dom/base/test/browser_bug593387.js
dom/base/test/browser_force_process_selector.js
dom/base/test/browser_inputStream_structuredClone.js
dom/base/test/browser_messagemanager_loadprocessscript.js
dom/base/test/browser_state_notifications.js
dom/base/test/browser_timeout_throttling_with_audio_playback.js
dom/base/test/browser_use_counters.js
dom/base/test/chrome/window_groupedSHistory.xul
dom/base/test/chrome/window_swapFrameLoaders.xul
dom/base/test/mozbrowser_api_utils.js
dom/base/test/test_blockParsing.html
dom/base/test/test_bug1281963.html
dom/base/test/test_explicit_user_agent.html
dom/base/test/test_mozbrowser_apis_allowed.html
dom/base/test/test_mozbrowser_apis_blocked.html
dom/base/test/test_postMessage_originAttributes.html
dom/broadcastchannel/tests/browser_private_browsing.js
dom/browser-element/BrowserElementChildPreload.js
dom/browser-element/mochitest/browserElement_getWebManifest.js
dom/events/test/test_DataTransferItemList.html
dom/file/ipc/tests/browser_ipcBlob.js
dom/html/test/browser_DOMDocElementInserted.js
dom/html/test/browser_content_contextmenu_userinput.js
dom/html/test/browser_fullscreen-api-keys.js
dom/html/test/browser_fullscreen-contextmenu-esc.js
dom/html/test/forms/test_autocompleteinfo.html
dom/html/test/test_anchor_ping.html
dom/html/test/test_bug1166138.html
dom/indexedDB/test/browser_permissionsPromptDeny.js
dom/indexedDB/test/head.js
dom/ipc/manifestMessages.js
dom/ipc/tests/browser_domainPolicy.js
dom/ipc/tests/browser_memory_distribution_telemetry.js
dom/ipc/tests/browser_remote_navigation_delay_telemetry.js
dom/manifest/ManifestFinder.jsm
dom/manifest/ManifestObtainer.jsm
dom/manifest/test/browser_ManifestFinder_browserHasManifestLink.js
dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js
dom/manifest/test/browser_ManifestObtainer_obtain.js
dom/manifest/test/browser_Manifest_install.js
dom/manifest/test/browser_fire_appinstalled_event.js
dom/network/tests/test_tcpsocket_client_and_server_basics.js
dom/notification/test/browser/browser_permission_dismiss.js
dom/payments/test/browser_multiple_construction.js
dom/payments/test/browser_payment_construction.js
dom/payments/test/browser_payment_in_different_tabs.js
dom/plugins/test/mochitest/browser_bug1163570.js
dom/plugins/test/mochitest/browser_bug1196539.js
dom/plugins/test/mochitest/browser_bug1335475.js
dom/plugins/test/mochitest/browser_pluginscroll.js
dom/plugins/test/mochitest/browser_tabswitchbetweenplugins.js
dom/plugins/test/mochitest/test_bug1028200-1.html
dom/plugins/test/mochitest/test_bug1028200-2.html
dom/plugins/test/mochitest/test_bug1028200-3.html
dom/plugins/test/mochitest/test_bug1028200-4.html
dom/plugins/test/mochitest/test_bug1028200-5.html
dom/plugins/test/mochitest/test_bug1028200-6.html
dom/plugins/test/mochitest/test_bug1028200-7.html
dom/plugins/test/mochitest/test_crash_submit.xul
dom/plugins/test/mochitest/test_hang_submit.xul
dom/plugins/test/unit/test_plugin_default_state_xpi.js
dom/promise/tests/unit/test_monitor_uncaught.js
dom/push/PushRecord.jsm
dom/push/test/test_data.html
dom/push/test/test_error_reporting.html
dom/push/test/test_permissions.html
dom/push/test/test_register.html
dom/push/test/test_register_key.html
dom/push/test/test_subscription_change.html
dom/push/test/test_unregister.html
dom/push/test/xpcshell/head.js
dom/push/test/xpcshell/test_clearAll_successful.js
dom/push/test/xpcshell/test_clear_forgetAboutSite.js
dom/push/test/xpcshell/test_clear_origin_data.js
dom/push/test/xpcshell/test_drop_expired.js
dom/push/test/xpcshell/test_notification_ack.js
dom/push/test/xpcshell/test_notification_data.js
dom/push/test/xpcshell/test_notification_duplicate.js
dom/push/test/xpcshell/test_notification_error.js
dom/push/test/xpcshell/test_notification_http2.js
dom/push/test/xpcshell/test_notification_incomplete.js
dom/push/test/xpcshell/test_notification_version_string.js
dom/push/test/xpcshell/test_observer_data.js
dom/push/test/xpcshell/test_observer_remoting.js
dom/push/test/xpcshell/test_permissions.js
dom/push/test/xpcshell/test_quota_exceeded.js
dom/push/test/xpcshell/test_quota_observer.js
dom/push/test/xpcshell/test_quota_with_notification.js
dom/push/test/xpcshell/test_reconnect_retry.js
dom/push/test/xpcshell/test_record.js
dom/push/test/xpcshell/test_register_5xxCode_http2.js
dom/push/test/xpcshell/test_register_case.js
dom/push/test/xpcshell/test_register_error_http2.js
dom/push/test/xpcshell/test_register_flush.js
dom/push/test/xpcshell/test_register_invalid_channel.js
dom/push/test/xpcshell/test_register_invalid_endpoint.js
dom/push/test/xpcshell/test_register_invalid_json.js
dom/push/test/xpcshell/test_register_no_id.js
dom/push/test/xpcshell/test_register_request_queue.js
dom/push/test/xpcshell/test_register_rollback.js
dom/push/test/xpcshell/test_register_success.js
dom/push/test/xpcshell/test_register_success_http2.js
dom/push/test/xpcshell/test_register_timeout.js
dom/push/test/xpcshell/test_register_wrong_id.js
dom/push/test/xpcshell/test_register_wrong_type.js
dom/push/test/xpcshell/test_registration_error.js
dom/push/test/xpcshell/test_registration_error_http2.js
dom/push/test/xpcshell/test_registration_missing_scope.js
dom/push/test/xpcshell/test_registration_none.js
dom/push/test/xpcshell/test_registration_success.js
dom/push/test/xpcshell/test_registration_success_http2.js
dom/push/test/xpcshell/test_resubscribe_4xxCode_http2.js
dom/push/test/xpcshell/test_resubscribe_5xxCode_http2.js
dom/push/test/xpcshell/test_resubscribe_listening_for_msg_error_http2.js
dom/push/test/xpcshell/test_retry_ws.js
dom/push/test/xpcshell/test_service_parent.js
dom/push/test/xpcshell/test_startup_error.js
dom/push/test/xpcshell/test_unregister_empty_scope.js
dom/push/test/xpcshell/test_unregister_error.js
dom/push/test/xpcshell/test_unregister_invalid_json.js
dom/push/test/xpcshell/test_unregister_not_found.js
dom/push/test/xpcshell/test_unregister_success.js
dom/push/test/xpcshell/test_unregister_success_http2.js
dom/push/test/xpcshell/test_updateRecordNoEncryptionKeys_http2.js
dom/push/test/xpcshell/test_updateRecordNoEncryptionKeys_ws.js
dom/quota/test/browser_permissionsPromptAllow.js
dom/quota/test/browser_permissionsPromptDeny.js
dom/quota/test/browser_permissionsPromptUnknown.js
dom/quota/test/head.js
dom/security/test/contentverifier/head.js
dom/security/test/csp/browser_manifest-src-override-default-src.js
dom/security/test/csp/browser_test_web_manifest.js
dom/security/test/csp/browser_test_web_manifest_mixed_content.js
dom/security/test/hsts/browser_hsts-priming_allow_active.js
dom/security/test/hsts/browser_hsts-priming_allow_display.js
dom/security/test/hsts/browser_hsts-priming_block_active.js
dom/security/test/hsts/browser_hsts-priming_block_active_css.js
dom/security/test/hsts/browser_hsts-priming_block_active_with_redir_same.js
dom/security/test/hsts/browser_hsts-priming_block_display.js
dom/security/test/hsts/browser_hsts-priming_cache-timeout.js
dom/security/test/hsts/browser_hsts-priming_hsts_after_mixed.js
dom/security/test/hsts/browser_hsts-priming_include-subdomains.js
dom/security/test/hsts/browser_hsts-priming_no-duplicates.js
dom/security/test/hsts/browser_hsts-priming_no-ip-address.js
dom/security/test/hsts/browser_hsts-priming_no-non-standard-ports.js
dom/security/test/hsts/browser_hsts-priming_timeout.js
dom/security/test/unit/test_isOriginPotentiallyTrustworthy.js
dom/tests/browser/browser_ConsoleAPITests.js
dom/tests/browser/browser_ConsoleStorageAPITests.js
dom/tests/browser/browser_allocateGigabyte.js
dom/tests/browser/browser_autofocus_background.js
dom/tests/browser/browser_autofocus_preference.js
dom/tests/browser/browser_beforeunload_between_chrome_content.js
dom/tests/browser/browser_bug1004814.js
dom/tests/browser/browser_bug1008941_dismissGeolocationHanger.js
dom/tests/browser/browser_bug1238427.js
dom/tests/browser/browser_bug1316330.js
dom/tests/browser/browser_bug396843.js
dom/tests/browser/browser_cancel_keydown_keypress_event.js
dom/tests/browser/browser_focus_steal_from_chrome.js
dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js
dom/tests/browser/browser_frame_elements.js
dom/tests/browser/browser_hasbeforeunload.js
dom/tests/browser/browser_largeAllocation_non_win32.js
dom/tests/browser/browser_largeAllocation_win32.js
dom/tests/browser/browser_localStorage_e10s.js
dom/tests/browser/browser_localStorage_privatestorageevent.js
dom/tests/browser/browser_prerendering.js
dom/tests/browser/browser_test_focus_after_modal_state.js
dom/tests/browser/browser_test_new_window_from_content.js
dom/tests/browser/browser_test_toolbars_visibility.js
dom/tests/browser/helper_largeAllocation.js
dom/tests/mochitest/bugs/test_bug1171215.html
dom/tests/mochitest/bugs/test_no_find_showDialog.html
dom/tests/mochitest/general/frameSelectEvents.html
dom/tests/mochitest/general/frameStorageAllowed.html
dom/tests/mochitest/general/frameStorageChrome.html
dom/tests/mochitest/general/frameStoragePrevented.html
dom/tests/mochitest/general/test_bug1208217.html
dom/tests/mochitest/general/test_selectevents.html
dom/tests/mochitest/general/test_spacetopagedown.html
dom/tests/mochitest/general/test_storagePermissionsAccept.html
dom/tests/mochitest/general/test_storagePermissionsLimitForeign.html
dom/tests/mochitest/general/test_storagePermissionsReject.html
dom/tests/mochitest/general/test_storagePermissionsRejectForeign.html
dom/tests/mochitest/localstorage/test_firstPartyOnlyPermission.html
dom/tests/mochitest/localstorage/test_localStorageSessionPrefOverride.html
dom/workers/test/browser_bug1047663.js
dom/workers/test/dom_worker_helper.js
dom/workers/test/serviceworkers/browser_multie10s_update.js
dom/workers/test/serviceworkers/chrome_helpers.js
dom/workers/test/serviceworkers/test_async_waituntil.html
dom/workers/test/serviceworkers/test_error_reporting.html
dom/workers/test/serviceworkers/test_fetch_integrity.html
dom/workers/test/serviceworkers/test_nofetch_handler.html
dom/workers/test/serviceworkers/test_serviceworkerinfo.xul
dom/workers/test/serviceworkers/test_serviceworkermanager.xul
dom/workers/test/serviceworkers/test_serviceworkerregistrationinfo.xul
dom/workers/test/serviceworkers/test_unresolved_fetch_interception.html
dom/workers/test/serviceworkers/test_worker_reference_gc_timeout.html
dom/workers/test/test_WorkerDebugger.initialize.xul
dom/workers/test/test_WorkerDebugger.postMessage.xul
dom/workers/test/test_WorkerDebugger.xul
dom/workers/test/test_WorkerDebuggerGlobalScope.createSandbox.xul
dom/workers/test/test_WorkerDebuggerGlobalScope.enterEventLoop.xul
dom/workers/test/test_WorkerDebuggerGlobalScope.reportError.xul
dom/workers/test/test_WorkerDebuggerGlobalScope.setImmediate.xul
dom/workers/test/test_WorkerDebuggerManager.xul
dom/workers/test/test_WorkerDebugger_console.xul
dom/workers/test/test_WorkerDebugger_frozen.xul
dom/workers/test/test_WorkerDebugger_promise.xul
dom/workers/test/test_WorkerDebugger_suspended.xul
dom/xhr/tests/browser_blobFromFile.js
dom/xhr/tests/browser_xhr_onchange_leak.js
editor/composer/test/test_bug1266815.html
editor/libeditor/tests/browser_bug527935.js
editor/libeditor/tests/browser_bug629172.js
editor/libeditor/tests/test_pasteImgTextarea.html
editor/libeditor/tests/test_pasteImgTextarea.xul
editor/libeditor/tests/test_selection_move_commands.html
extensions/cookie/test/browser_permmgr_sync.js
extensions/cookie/test/unit/test_permmanager_defaults.js
extensions/cookie/test/unit/test_permmanager_migrate_4-7.js
extensions/cookie/test/unit/test_permmanager_migrate_5-7a.js
extensions/cookie/test/unit/test_permmanager_migrate_6-7a.js
extensions/cookie/test/unit/test_permmanager_migrate_7-8.js
extensions/spellcheck/tests/mochitest/test_bug1272623.html
gfx/tests/browser/browser_windowless_troubleshoot_crash.js
gfx/tests/mochitest/test_font_whitelist.html
image/test/browser/browser_docshell_type_editor.js
js/xpconnect/tests/browser/browser_dead_object.js
js/xpconnect/tests/mochitest/test_nukeContentWindow.html
js/xpconnect/tests/unit/test_compileScript.js
js/xpconnect/tests/unit/test_file2.js
js/xpconnect/tests/unit/test_messageChannel.js
js/xpconnect/tests/unit/test_nuke_sandbox_event_listeners.js
js/xpconnect/tests/unit/test_nuke_webextension_wrappers.js
js/xpconnect/tests/unit/test_subScriptLoader.js
js/xpconnect/tests/unit/test_xray_named_element_access.js
layout/base/tests/browser_bug617076.js
layout/base/tests/browser_disableDialogs_onbeforeunload.js
layout/base/tests/browser_onbeforeunload_only_after_interaction.js
layout/base/tests/browser_onbeforeunload_only_after_interaction_in_frame.js
layout/mathml/tests/test_disabled_chrome.html
layout/style/test/browser_bug453896.js
layout/style/test/chrome/bug418986-2.js
layout/style/test/chrome/test_display_mode.html
layout/style/test/chrome/test_display_mode_reflow.html
layout/style/test/file_animations_effect_timing_duration.html
layout/style/test/file_animations_effect_timing_enddelay.html
layout/style/test/file_animations_effect_timing_iterations.html
layout/style/test/file_animations_iterationstart.html
layout/style/test/file_animations_pausing.html
layout/style/test/file_animations_playbackrate.html
layout/style/test/file_animations_reverse.html
layout/style/test/test_animations_omta.html
layout/style/test/test_bug418986-2.html
layout/style/test/test_restyles_in_smil_animation.html
layout/style/test/test_transitions_per_property.html
layout/svg/tests/test_disabled_chrome.html
layout/xul/test/browser_bug685470.js
layout/xul/test/browser_bug703210.js
layout/xul/test/browser_bug706743.js
modules/libjar/test/mochitest/test_bug1173171.html
modules/libpref/test/unit/test_warnings.js
netwerk/cookie/test/browser/browser_originattributes.js
netwerk/cookie/test/unit/test_eviction.js
netwerk/test/browser/browser_about_cache.js
netwerk/test/browser/browser_child_resource.js
netwerk/test/browser/browser_nsIFormPOSTActionChannel.js
netwerk/test/browser/browser_post_file.js
netwerk/test/unit/test_NetUtil.js
netwerk/test/unit/test_backgroundfilesaver.js
netwerk/test/unit/test_be_conservative.js
netwerk/test/unit/test_signature_extraction.js
netwerk/test/unit/test_tls_server.js
netwerk/test/unit/test_tls_server_multiple_clients.js
parser/htmlparser/tests/mochitest/browser_viewsource.js
security/manager/ssl/tests/mochitest/browser/browser_certViewer.js
security/manager/ssl/tests/mochitest/browser/browser_clientAuth_connection.js
security/manager/ssl/tests/mochitest/browser/browser_clientAuth_ui.js
security/manager/ssl/tests/mochitest/browser/browser_deleteCert_ui.js
security/manager/ssl/tests/mochitest/browser/browser_downloadCert_ui.js
security/manager/ssl/tests/mochitest/browser/browser_editCACertTrust.js
security/manager/ssl/tests/mochitest/browser/browser_exportP12_passwordUI.js
security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html
security/manager/ssl/tests/unit/test_cert_keyUsage.js
security/manager/ssl/tests/unit/test_ev_certs.js
security/manager/ssl/tests/unit/test_forget_about_site_security_headers.js
security/manager/ssl/tests/unit/test_intermediate_basic_usage_constraints.js
security/manager/ssl/tests/unit/test_local_cert.js
security/manager/ssl/tests/unit/test_nss_shutdown.js
security/manager/ssl/tests/unit/test_signed_dir.js
security/sandbox/test/browser_content_sandbox_fs.js
security/sandbox/test/browser_content_sandbox_syscalls.js
services/common/kinto-storage-adapter.js
services/common/tests/unit/test_blocklist_certificates.js
services/common/tests/unit/test_blocklist_clients.js
services/common/tests/unit/test_blocklist_pinning.js
services/common/tests/unit/test_blocklist_signatures.js
services/common/tests/unit/test_blocklist_updater.js
services/common/tests/unit/test_hawkclient.js
services/common/tests/unit/test_kinto.js
services/common/tests/unit/test_logmanager.js
services/common/tests/unit/test_storage_adapter.js
services/common/tests/unit/test_uptake_telemetry.js
services/crypto/tests/unit/test_crypto_crypt.js
services/fxaccounts/tests/xpcshell/test_accounts.js
services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js
services/fxaccounts/tests/xpcshell/test_client.js
services/fxaccounts/tests/xpcshell/test_credentials.js
services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js
services/fxaccounts/tests/xpcshell/test_oauth_grant_client_server.js
services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js
services/fxaccounts/tests/xpcshell/test_oauth_tokens.js
services/fxaccounts/tests/xpcshell/test_profile.js
services/fxaccounts/tests/xpcshell/test_push_service.js
services/fxaccounts/tests/xpcshell/test_storage_manager.js
services/fxaccounts/tests/xpcshell/test_web_channel.js
services/sync/tests/unit/test_extension_storage_engine.js
services/sync/tests/unit/test_extension_storage_tracker.js
storage/test/unit/test_connection_asyncClose.js
storage/test/unit/test_connection_executeAsync.js
storage/test/unit/test_connection_executeSimpleSQLAsync.js
storage/test/unit/test_storage_connection.js
storage/test/unit/test_storage_value_array.js
storage/test/unit/test_unicode.js
testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
testing/mochitest/jetpack-addon-harness.js
testing/mochitest/jetpack-package-harness.js
testing/mochitest/tests/browser/browser_BrowserTestUtils.js
testing/mochitest/tests/browser/browser_add_task.js
testing/mochitest/tests/browser/browser_browserLoaded_content_loaded.js
testing/mochitest/tests/browser/browser_fail_add_task.js
testing/mochitest/tests/browser/browser_waitForFocus.js
testing/modules/tests/xpcshell/test_assert.js
testing/talos/talos/pageloader/chrome/pageloader.js
uriloader/exthandler/nsHandlerService-json.js
uriloader/exthandler/tests/mochitest/browser_auto_close_window.js
uriloader/exthandler/tests/mochitest/browser_download_always_ask_preferred_app.js
uriloader/exthandler/tests/mochitest/browser_remember_download_option.js
uriloader/exthandler/tests/mochitest/browser_web_protocol_handlers.js
uriloader/exthandler/tests/mochitest/head.js
uriloader/exthandler/tests/mochitest/test_unsafeBidiChars.xhtml
uriloader/exthandler/tests/unit/common_test_handlerService.js
uriloader/exthandler/tests/unit/head.js
uriloader/exthandler/tests/unit/test_handlerService_json.js
widget/headless/tests/test_headless.js
widget/headless/tests/test_headless_clipboard.js
--- a/addon-sdk/source/lib/sdk/system/child_process/subprocess.js
+++ b/addon-sdk/source/lib/sdk/system/child_process/subprocess.js
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 'use strict';
 
 const { Ci, Cu } = require("chrome");
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Subprocess.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
 
 const Runtime = require("sdk/system/runtime");
 const Environment = require("sdk/system/environment").env;
 const DEFAULT_ENVIRONMENT = [];
 if (Runtime.OS == "Linux" && "DISPLAY" in Environment) {
   DEFAULT_ENVIRONMENT.push("DISPLAY=" + Environment.DISPLAY);
 }
 
@@ -30,44 +29,44 @@ function awaitPromise(promise) {
 
   Services.tm.spinEventLoopUntil(() => resolved !== null);
 
   if (resolved === true)
     return value;
   throw value;
 }
 
-let readAllData = Task.async(function* (pipe, read, callback) {
+let readAllData = async function(pipe, read, callback) {
   let string;
-  while (string = yield read(pipe))
+  while (string = await read(pipe))
     callback(string);
-});
+};
 
 let write = (pipe, data) => {
   let buffer = new Uint8Array(Array.from(data, c => c.charCodeAt(0)));
   return pipe.write(data);
 };
 
 var subprocess = {
   call: function(options) {
     var result;
 
-    let procPromise = Task.spawn(function*() {
+    let procPromise = (async function() {
       let opts = {};
 
       if (options.mergeStderr) {
         opts.stderr = "stdout"
       } else if (options.stderr) {
         opts.stderr = "pipe";
       }
 
       if (options.command instanceof Ci.nsIFile) {
         opts.command = options.command.path;
       } else {
-        opts.command = yield Subprocess.pathSearch(options.command);
+        opts.command = await Subprocess.pathSearch(options.command);
       }
 
       if (options.workdir) {
         opts.workdir = options.workdir;
       }
 
       opts.arguments = options.arguments || [];
 
@@ -82,17 +81,17 @@ var subprocess = {
           if (idx >= 0)
             environment[val.slice(0, idx)] = val.slice(idx + 1);
         }
 
         opts.environment = environment;
       }
 
 
-      let proc = yield Subprocess.call(opts);
+      let proc = await Subprocess.call(opts);
 
       Object.defineProperty(result, "pid", {
         value: proc.pid,
         enumerable: true,
         configurable: true,
       });
 
 
@@ -126,17 +125,17 @@ var subprocess = {
       // Handle process completion
 
       if (options.done)
         Promise.all(promises)
           .then(() => proc.wait())
           .then(options.done);
 
       return proc;
-    });
+    })();
 
     procPromise.catch(e => {
       if (options.done)
         options.done({exitCode: -1}, e);
       else
         Cu.reportError(e instanceof Error ? e : e.message || e);
     });
 
--- a/caps/tests/mochitest/browser_checkloaduri.js
+++ b/caps/tests/mochitest/browser_checkloaduri.js
@@ -233,39 +233,39 @@ function testURL(source, target, canLoad
   let inheritDisallowed = flags & ssm.DISALLOW_INHERIT_PRINCIPAL;
   let shouldThrow = inheritDisallowed ? !canLoadWithoutInherit : !canLoad;
   ok(threw == shouldThrow,
      "Should " + (shouldThrow ? "" : "not ") + "throw an error when loading " +
      target + " from " + getPrincipalDesc(source) +
      (inheritDisallowed ? " without" : " with") + " principal inheritance.");
 }
 
-add_task(function* () {
-  yield kAboutPagesRegistered;
+add_task(async function() {
+  await kAboutPagesRegistered;
   let baseFlags = ssm.STANDARD | ssm.DONT_REPORT_ERRORS;
   for (let [sourceString, targetsAndExpectations] of URLs) {
     let source;
     if (sourceString.startsWith("about:test-chrome-privs")) {
       source = ssm.getSystemPrincipal();
     } else {
       source = ssm.createCodebasePrincipal(makeURI(sourceString), {});
     }
     for (let [target, canLoad, canLoadWithoutInherit, canCreate] of targetsAndExpectations) {
       testURL(source, target, canLoad, canLoadWithoutInherit, canCreate, baseFlags);
       testURL(source, target, canLoad, canLoadWithoutInherit, canCreate,
               baseFlags | ssm.DISALLOW_INHERIT_PRINCIPAL);
     }
   }
 
   // Now test blob URIs, which we need to do in-content.
-  yield BrowserTestUtils.withNewTab("http://www.example.com/", function* (browser) {
-    yield ContentTask.spawn(
+  await BrowserTestUtils.withNewTab("http://www.example.com/", async function(browser) {
+    await ContentTask.spawn(
       browser,
       testURL.toString(),
-      function* (testURLFn) {
+      async function(testURLFn) {
         // eslint-disable-next-line no-shadow , no-eval
         let testURL = eval("(" + testURLFn + ")");
         // eslint-disable-next-line no-shadow
         let ssm = Services.scriptSecurityManager;
         // eslint-disable-next-line no-shadow
         let baseFlags = ssm.STANDARD | ssm.DONT_REPORT_ERRORS;
         // eslint-disable-next-line no-unused-vars
         let makeURI = Cu.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
--- a/docshell/test/browser/browser_bug1206879.js
+++ b/docshell/test/browser/browser_bug1206879.js
@@ -1,11 +1,11 @@
-add_task(function*() {
+add_task(async function() {
   let url = getRootDirectory(gTestPath) + "file_bug1206879.html";
-  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url, true);
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url, true);
 
   let numLocationChanges = 0;
 
   let listener = {
     onLocationChange: function(browser, wp, request, uri, flags) {
       if (browser != tab.linkedBrowser) {
         return;
       }
@@ -13,19 +13,19 @@ add_task(function*() {
       numLocationChanges++;
       this.resolve();
     }
   };
   let locationPromise = new Promise((resolve, reject) => {
     listener.resolve = resolve;
     gBrowser.addTabsProgressListener(listener);
   });
-  yield ContentTask.spawn(tab.linkedBrowser, {}, function() {
+  await ContentTask.spawn(tab.linkedBrowser, {}, function() {
     content.frames[0].history.pushState(null, null, "foo");
   });
 
-  yield locationPromise;
+  await locationPromise;
 
   gBrowser.removeTab(tab);
   gBrowser.removeTabsProgressListener(listener);
   is(numLocationChanges, 1,
      "pushState with a different URI should cause a LocationChange event.");
 });
--- a/docshell/test/browser/browser_bug1309900_crossProcessHistoryNavigation.js
+++ b/docshell/test/browser/browser_bug1309900_crossProcessHistoryNavigation.js
@@ -1,35 +1,35 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-add_task(function* runTests() {
-  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:about");
+add_task(async function runTests() {
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:about");
 
-  registerCleanupFunction(function* () {
+  registerCleanupFunction(function() {
     gBrowser.removeTab(tab);
   });
 
   let browser = tab.linkedBrowser;
 
   browser.loadURI("about:accounts");
-  let href = yield BrowserTestUtils.browserLoaded(browser);
+  let href = await BrowserTestUtils.browserLoaded(browser);
   is(href, "about:accounts", "Check about:accounts loaded");
 
   // Using a dummy onunload listener to disable the bfcache as that can prevent
   // the test browser load detection mechanism from working.
   browser.loadURI("data:text/html,<body%20onunload=''><iframe></iframe></body>");
-  href = yield BrowserTestUtils.browserLoaded(browser);
+  href = await BrowserTestUtils.browserLoaded(browser);
   is(href, "data:text/html,<body%20onunload=''><iframe></iframe></body>",
     "Check data URL loaded");
 
   browser.goBack();
-  href = yield BrowserTestUtils.browserLoaded(browser);
+  href = await BrowserTestUtils.browserLoaded(browser);
   is(href, "about:accounts", "Check we've gone back to about:accounts");
 
   browser.goForward();
-  href = yield BrowserTestUtils.browserLoaded(browser);
+  href = await BrowserTestUtils.browserLoaded(browser);
   is(href, "data:text/html,<body%20onunload=''><iframe></iframe></body>",
      "Check we've gone forward to data URL");
 });
--- a/docshell/test/browser/browser_bug349769.js
+++ b/docshell/test/browser/browser_bug349769.js
@@ -1,47 +1,47 @@
-add_task(function* test() {
+add_task(async function test() {
   const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
   const uris = [undefined, "about:blank"];
 
   function checkContentProcess(newBrowser, uri) {
-    return ContentTask.spawn(newBrowser, uri, function* (uri) {
+    return ContentTask.spawn(newBrowser, uri, async function(uri) {
       var prin = content.document.nodePrincipal;
       Assert.notEqual(prin, null, "Loaded principal must not be null when adding " + uri);
       Assert.notEqual(prin, undefined, "Loaded principal must not be undefined when loading " + uri);
 
       const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
                        .getService(Ci.nsIScriptSecurityManager);
       Assert.equal(secMan.isSystemPrincipal(prin), false,
          "Loaded principal must not be system when loading " + uri);
     });
   }
 
   for (var uri of uris) {
-    yield BrowserTestUtils.withNewTab({ gBrowser }, function* (newBrowser) {
-      yield BrowserTestUtils.loadURI(newBrowser, uri);
+    await BrowserTestUtils.withNewTab({ gBrowser }, async function(newBrowser) {
+      await BrowserTestUtils.loadURI(newBrowser, uri);
 
       var prin = newBrowser.contentPrincipal;
       isnot(prin, null, "Forced principal must not be null when loading " + uri);
       isnot(prin, undefined,
             "Forced principal must not be undefined when loading " + uri);
       is(secMan.isSystemPrincipal(prin), false,
          "Forced principal must not be system when loading " + uri);
 
       // Belt-and-suspenders e10s check: make sure that the same checks hold
       // true in the content process.
-      yield checkContentProcess(newBrowser, uri);
+      await checkContentProcess(newBrowser, uri);
 
-      yield BrowserTestUtils.browserLoaded(newBrowser);
+      await BrowserTestUtils.browserLoaded(newBrowser);
 
       prin = newBrowser.contentPrincipal;
       isnot(prin, null, "Loaded principal must not be null when adding " + uri);
       isnot(prin, undefined, "Loaded principal must not be undefined when loading " + uri);
       is(secMan.isSystemPrincipal(prin), false,
          "Loaded principal must not be system when loading " + uri);
 
       // Belt-and-suspenders e10s check: make sure that the same checks hold
       // true in the content process.
-      yield checkContentProcess(newBrowser, uri);
+      await checkContentProcess(newBrowser, uri);
     });
   }
 });
 
--- a/docshell/test/browser/browser_bug388121-1.js
+++ b/docshell/test/browser/browser_bug388121-1.js
@@ -1,11 +1,11 @@
-add_task(function* test() {
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (newBrowser) {
-    yield ContentTask.spawn(newBrowser, null, function* () {
+add_task(async function test() {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, async function(newBrowser) {
+    await ContentTask.spawn(newBrowser, null, async function() {
       var prin = content.document.nodePrincipal;
       Assert.notEqual(prin, null, "Loaded principal must not be null");
       Assert.notEqual(prin, undefined, "Loaded principal must not be undefined");
 
       const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
                        .getService(Ci.nsIScriptSecurityManager);
       Assert.equal(secMan.isSystemPrincipal(prin), false,
         "Loaded principal must not be system");
--- a/docshell/test/browser/browser_bug422543.js
+++ b/docshell/test/browser/browser_bug422543.js
@@ -1,61 +1,61 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-add_task(function* runTests() {
-  yield setup();
+add_task(async function runTests() {
+  await setup();
   let browser = gBrowser.selectedBrowser;
   // Now that we're set up, initialize our frame script.
-  yield checkListeners("initial", "listeners initialized");
+  await checkListeners("initial", "listeners initialized");
 
   // Check if all history listeners are always notified.
   info("# part 1");
-  yield whenPageShown(browser, () => browser.loadURI("http://www.example.com/"));
-  yield checkListeners("newentry", "shistory has a new entry");
+  await whenPageShown(browser, () => browser.loadURI("http://www.example.com/"));
+  await checkListeners("newentry", "shistory has a new entry");
   ok(browser.canGoBack, "we can go back");
 
-  yield whenPageShown(browser, () => browser.goBack());
-  yield checkListeners("goback", "back to the first shentry");
+  await whenPageShown(browser, () => browser.goBack());
+  await checkListeners("goback", "back to the first shentry");
   ok(browser.canGoForward, "we can go forward");
 
-  yield whenPageShown(browser, () => browser.goForward());
-  yield checkListeners("goforward", "forward to the second shentry");
+  await whenPageShown(browser, () => browser.goForward());
+  await checkListeners("goforward", "forward to the second shentry");
 
-  yield whenPageShown(browser, () => browser.reload());
-  yield checkListeners("reload", "current shentry reloaded");
+  await whenPageShown(browser, () => browser.reload());
+  await checkListeners("reload", "current shentry reloaded");
 
-  yield whenPageShown(browser, () => browser.gotoIndex(0));
-  yield checkListeners("gotoindex", "back to the first index");
+  await whenPageShown(browser, () => browser.gotoIndex(0));
+  await checkListeners("gotoindex", "back to the first index");
 
   // Check nsISHistoryInternal.notifyOnHistoryReload
   info("# part 2");
-  ok((yield notifyReload()), "reloading has not been canceled");
-  yield checkListeners("reload", "saw the reload notification");
+  ok((await notifyReload()), "reloading has not been canceled");
+  await checkListeners("reload", "saw the reload notification");
 
   // Let the first listener cancel the reload action.
   info("# part 3");
-  yield resetListeners();
-  yield setListenerRetval(0, false);
-  ok(!(yield notifyReload()), "reloading has been canceled");
-  yield checkListeners("reload", "saw the reload notification");
+  await resetListeners();
+  await setListenerRetval(0, false);
+  ok(!(await notifyReload()), "reloading has been canceled");
+  await checkListeners("reload", "saw the reload notification");
 
   // Let both listeners cancel the reload action.
   info("# part 4");
-  yield resetListeners();
-  yield setListenerRetval(1, false);
-  ok(!(yield notifyReload()), "reloading has been canceled");
-  yield checkListeners("reload", "saw the reload notification");
+  await resetListeners();
+  await setListenerRetval(1, false);
+  ok(!(await notifyReload()), "reloading has been canceled");
+  await checkListeners("reload", "saw the reload notification");
 
   // Let the second listener cancel the reload action.
   info("# part 5");
-  yield resetListeners();
-  yield setListenerRetval(0, true);
-  ok(!(yield notifyReload()), "reloading has been canceled");
-  yield checkListeners("reload", "saw the reload notification");
+  await resetListeners();
+  await setListenerRetval(0, true);
+  ok(!(await notifyReload()), "reloading has been canceled");
+  await checkListeners("reload", "saw the reload notification");
 });
 
 function listenOnce(message, arg = {}) {
   return new Promise(resolve => {
     let mm = gBrowser.selectedBrowser.messageManager;
     mm.addMessageListener(message + ":return", function listener(msg) {
       mm.removeMessageListener(message + ":return", listener);
       resolve(msg.data);
@@ -86,18 +86,18 @@ function setListenerRetval(num, val) {
   return listenOnce("bug422543:setRetval", { num, val });
 }
 
 function setup() {
   return BrowserTestUtils.openNewForegroundTab(gBrowser,
                                                "http://mochi.test:8888")
                          .then(function (tab) {
     let browser = tab.linkedBrowser;
-    registerCleanupFunction(function* () {
-      yield listenOnce("bug422543:cleanup");
+    registerCleanupFunction(async function() {
+      await listenOnce("bug422543:cleanup");
       gBrowser.removeTab(tab);
     });
 
     browser.messageManager
            .loadFrameScript(getRootDirectory(gTestPath) + "file_bug422543_script.js", false);
   });
 }
 
--- a/docshell/test/browser/browser_bug503832.js
+++ b/docshell/test/browser/browser_bug503832.js
@@ -1,13 +1,13 @@
 /* Test for Bug 503832
  * https://bugzilla.mozilla.org/show_bug.cgi?id=503832
  */
 
-add_task(function* () {
+add_task(async function() {
     var pagetitle = "Page Title for Bug 503832";
     var pageurl = "http://mochi.test:8888/browser/docshell/test/browser/file_bug503832.html";
     var fragmenturl = "http://mochi.test:8888/browser/docshell/test/browser/file_bug503832.html#firefox";
 
     var historyService = Cc["@mozilla.org/browser/nav-history-service;1"]
                          .getService(Ci.nsINavHistoryService);
 
     let fragmentPromise = new Promise(resolve => {
@@ -71,17 +71,17 @@ add_task(function* () {
 
     // Make sure neither of the test pages haven't been loaded before.
     var info = getNavHistoryEntry(makeURI(pageurl));
     ok(!info, "The test page must not have been visited already.");
     info = getNavHistoryEntry(makeURI(fragmenturl));
     ok(!info, "The fragment test page must not have been visited already.");
 
     // Now open the test page in a new tab
-    yield BrowserTestUtils.openNewForegroundTab(gBrowser, pageurl);
+    await BrowserTestUtils.openNewForegroundTab(gBrowser, pageurl);
 
     // Now that the page is loaded, click on fragment link
-    yield BrowserTestUtils.synthesizeMouseAtCenter("#firefox-link", {},
+    await BrowserTestUtils.synthesizeMouseAtCenter("#firefox-link", {},
                                                    gBrowser.selectedBrowser);
-    yield fragmentPromise;
+    await fragmentPromise;
 
     gBrowser.removeCurrentTab();
 });
--- a/docshell/test/browser/browser_bug554155.js
+++ b/docshell/test/browser/browser_bug554155.js
@@ -1,26 +1,26 @@
-add_task(function* test() {
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "http://example.com" }, function* (browser) {
+add_task(async function test() {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "http://example.com" }, async function(browser) {
     let numLocationChanges = 0;
 
     let listener = {
       onLocationChange: function(browser, webProgress, request, uri, flags) {
         info("location change: " + (uri && uri.spec));
         numLocationChanges++;
       }
     };
 
     gBrowser.addTabsProgressListener(listener);
 
-    yield ContentTask.spawn(browser, null, function() {
+    await ContentTask.spawn(browser, null, function() {
       // pushState to a new URL (http://example.com/foo").  This should trigger
       // exactly one LocationChange event.
       content.history.pushState(null, null, "foo");
     });
 
-    yield Promise.resolve();
+    await Promise.resolve();
 
     gBrowser.removeTabsProgressListener(listener);
     is(numLocationChanges, 1,
        "pushState should cause exactly one LocationChange event.");
   });
 });
--- a/docshell/test/browser/browser_bug655273.js
+++ b/docshell/test/browser/browser_bug655273.js
@@ -3,22 +3,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Test for Bug 655273.  Make sure that after changing the URI via
  * history.pushState, the resulting SHEntry has the same title as our old
  * SHEntry.
  **/
 
-add_task(function* test() {
+add_task(async function test() {
   waitForExplicitFinish();
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "http://example.com" },
-    function* (browser) {
-      yield ContentTask.spawn(browser, null, function* () {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "http://example.com" },
+    async function(browser) {
+      await ContentTask.spawn(browser, null, async function() {
         let cw = content;
         let oldTitle = cw.document.title;
         ok(oldTitle, 'Content window should initially have a title.');
         cw.history.pushState('', '', 'new_page');
 
         let shistory = cw.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIWebNavigation)
                          .sessionHistory;
--- a/docshell/test/browser/browser_bug670318.js
+++ b/docshell/test/browser/browser_bug670318.js
@@ -5,20 +5,20 @@
  * Test for Bug 670318
  *
  * When LoadEntry() is called on a browser that has multiple duplicate history
  * entries, history.index can end up out of range (>= history.count).
  */
 
 const URL = "http://mochi.test:8888/browser/docshell/test/browser/file_bug670318.html";
 
-add_task(function* test() {
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" },
-                                    function* (browser) {
-    yield ContentTask.spawn(browser, URL, function* (URL) {
+add_task(async function test() {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" },
+                                    async function(browser) {
+    await ContentTask.spawn(browser, URL, async function(URL) {
       let history = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory;
       let count = 0;
 
       let testDone = {};
       testDone.promise = new Promise(resolve => { testDone.resolve = resolve; });
 
       let listener = {
         OnHistoryNewEntry: function (aNewURI) {
@@ -59,12 +59,12 @@ add_task(function* test() {
       // Since listener implements nsISupportsWeakReference, we are
       // responsible for keeping it alive so that the GC doesn't clear
       // it before the test completes. We do this by anchoring the listener
       // to the content global window, and clearing it just before the test
       // completes.
       content._testListener = listener;
       content.location = URL;
 
-      yield testDone.promise;
+      await testDone.promise;
     });
   });
 });
--- a/docshell/test/browser/browser_click_link_within_view_source.js
+++ b/docshell/test/browser/browser_click_link_within_view_source.js
@@ -2,59 +2,59 @@
 
 /**
  * Test for Bug 1359204
  *
  * Loading a local file, then view-source on that file. Make sure that
  * clicking a link within that view-source page is not blocked by security checks.
  */
 
-add_task(function* test_click_link_within_view_source() {
+add_task(async function test_click_link_within_view_source() {
   let TEST_FILE = "file_click_link_within_view_source.html";
   let TEST_FILE_URI = getChromeDir(getResolvedURI(gTestPath));
   TEST_FILE_URI.append(TEST_FILE);
   TEST_FILE_URI = Services.io.newFileURI(TEST_FILE_URI).spec;
 
   let DUMMY_FILE = "dummy_page.html";
   let DUMMY_FILE_URI = getChromeDir(getResolvedURI(gTestPath));
   DUMMY_FILE_URI.append(DUMMY_FILE);
   DUMMY_FILE_URI = Services.io.newFileURI(DUMMY_FILE_URI).spec;
 
-  yield BrowserTestUtils.withNewTab(TEST_FILE_URI, function*(aBrowser) {
+  await BrowserTestUtils.withNewTab(TEST_FILE_URI, async function(aBrowser) {
     let tabSpec = gBrowser.selectedBrowser.currentURI.spec;
     info("loading: " + tabSpec);
     ok(tabSpec.startsWith("file://") && tabSpec.endsWith(TEST_FILE),
        "sanity check to make sure html loaded");
 
     info("click view-source of html");
     let tabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
     document.getElementById("View:PageSource").doCommand();
 
-    let tab = yield tabPromise;
+    let tab = await tabPromise;
     tabSpec = gBrowser.selectedBrowser.currentURI.spec;
     info("loading: " + tabSpec);
     ok(tabSpec.startsWith("view-source:file://") && tabSpec.endsWith(TEST_FILE),
        "loading view-source of html succeeded");
 
     info("click testlink within view-source page");
     let loadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url => url.endsWith("dummy_page.html"));
-    yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function*() {
+    await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
       if (content.document.readyState != "complete") {
-        yield ContentTaskUtils.waitForEvent(content.document, "readystatechange", false, () =>
+        await ContentTaskUtils.waitForEvent(content.document, "readystatechange", false, () =>
           content.document.readyState == "complete");
       }
       // document.getElementById() does not work on a view-source page, hence we use document.links
       let linksOnPage = content.document.links;
       is (linksOnPage.length, 1, "sanity check: make sure only one link is present on page");
       let myLink = content.document.links[0];
       myLink.click();
     });
 
-    yield loadPromise;
+    await loadPromise;
 
     tabSpec = gBrowser.selectedBrowser.currentURI.spec;
     info("loading: " + tabSpec);
     ok(tabSpec.startsWith("view-source:file://") && tabSpec.endsWith(DUMMY_FILE),
        "loading view-source of html succeeded");
 
-    yield BrowserTestUtils.removeTab(tab);
+    await BrowserTestUtils.removeTab(tab);
   });
 });
--- a/docshell/test/browser/browser_grouped_shistory_bfcache_cleaning.js
+++ b/docshell/test/browser/browser_grouped_shistory_bfcache_cleaning.js
@@ -1,10 +1,10 @@
-add_task(function* () {
-  yield SpecialPowers.pushPrefEnv({
+add_task(async function() {
+  await SpecialPowers.pushPrefEnv({
     set: [["browser.groupedhistory.enabled", true]]
   });
 
   // Wait for a process change and then fulfil the promise.
   function awaitProcessChange(browser) {
     return new Promise(resolve => {
       browser.addEventListener("BrowserChangedProcess", function(e) {
         ok(true, "The browser changed process!");
@@ -14,44 +14,44 @@ add_task(function* () {
   }
 
   function isAlive(tab) {
     return tab.linkedBrowser &&
       tab.linkedBrowser.frameLoader &&
       !tab.linkedBrowser.frameLoader.isDead;
   }
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
     // Set up the grouped SHEntry setup
     let tab2 = gBrowser.loadOneTab("data:text/html,b", {
       referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
       allowThirdPartyFixup: true,
       relatedToCurrent: true,
       isPrerendered: true,
       triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
     });
-    yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
+    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
     browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    yield awaitProcessChange(browser1);
+    await awaitProcessChange(browser1);
     ok(isAlive(tab2));
 
     // Load some URIs and make sure that we lose the old process once we are 3 history entries away.
     browser1.loadURI("data:text/html,c", null, null);
-    yield BrowserTestUtils.browserLoaded(browser1);
+    await BrowserTestUtils.browserLoaded(browser1);
     ok(isAlive(tab2), "frameloader should still be alive");
     browser1.loadURI("data:text/html,d", null, null);
-    yield BrowserTestUtils.browserLoaded(browser1);
+    await BrowserTestUtils.browserLoaded(browser1);
     ok(isAlive(tab2), "frameloader should still be alive");
     browser1.loadURI("data:text/html,e", null, null);
-    yield BrowserTestUtils.browserLoaded(browser1);
+    await BrowserTestUtils.browserLoaded(browser1);
     ok(isAlive(tab2), "frameloader should still be alive");
 
     // The 4th navigation should kill the frameloader
     browser1.loadURI("data:text/html,f", null, null);
-    yield new Promise(resolve => {
+    await new Promise(resolve => {
       tab2.addEventListener("TabClose", function() {
         ok(true, "The tab is being closed!\n");
         resolve();
       }, {once: true});
     });
     // We don't check for !isAlive() as TabClose is called during
     // _beginRemoveTab, which means that the frameloader may not be dead yet. We
     // avoid races by not checking.
--- a/docshell/test/browser/browser_grouped_shistory_crossproc.js
+++ b/docshell/test/browser/browser_grouped_shistory_crossproc.js
@@ -1,10 +1,10 @@
-add_task(function* () {
-  yield SpecialPowers.pushPrefEnv({
+add_task(async function() {
+  await SpecialPowers.pushPrefEnv({
     set: [["browser.groupedhistory.enabled", true]]
   });
 
   // Wait for a process change and then fulfil the promise.
   function awaitProcessChange(browser) {
     return new Promise(resolve => {
       browser.addEventListener("BrowserChangedProcess", function(e) {
         ok(true, "The browser changed process!");
@@ -18,35 +18,35 @@ add_task(function* () {
     return new Promise(resolve => {
       tab.addEventListener("TabClose", function() {
         ok(true, "The tab is being closed!\n");
         resolve();
       }, {once: true});
     });
   }
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
     // Set up the grouped SHEntry setup
     let tab2 = gBrowser.loadOneTab("data:text/html,b", {
       referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
       allowThirdPartyFixup: true,
       relatedToCurrent: true,
       isPrerendered: true,
       triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
     });
-    yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
+    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
     browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    yield awaitProcessChange(browser1);
+    await awaitProcessChange(browser1);
 
     // Load a URI which will involve loading in the parent process
     let tabClose = awaitTabClose(tab2);
     browser1.loadURI("about:config", Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
-    yield BrowserTestUtils.browserLoaded(browser1);
+    await BrowserTestUtils.browserLoaded(browser1);
     let docshell = browser1.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
     ok(docshell, "The browser should be loaded in the chrome process");
     is(docshell.canGoForward, false, "canGoForward is correct");
     is(docshell.canGoBack, true, "canGoBack is correct");
     is(docshell.sessionHistory.count, 3, "Count is correct");
     is(browser1.frameLoader.groupedSHistory, null,
        "browser1's session history is now complete");
-    yield tabClose;
+    await tabClose;
   });
 });
--- a/docshell/test/browser/browser_grouped_shistory_dead_navigate.js
+++ b/docshell/test/browser/browser_grouped_shistory_dead_navigate.js
@@ -1,43 +1,43 @@
-add_task(function* () {
-  yield SpecialPowers.pushPrefEnv({
+add_task(async function() {
+  await SpecialPowers.pushPrefEnv({
     set: [["browser.groupedhistory.enabled", true],
           ["dom.ipc.processCount", 1]]
   });
 
   // Wait for a process change and then fulfil the promise.
   function awaitProcessChange(browser) {
     return new Promise(resolve => {
       browser.addEventListener("BrowserChangedProcess", function(e) {
         ok(true, "The browser changed process!");
         resolve();
       }, {once: true});
     });
   }
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, function* (browser1) {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html,a" }, async function(browser1) {
     // Set up the grouped SHEntry setup
     let tab2 = gBrowser.loadOneTab("data:text/html,b", {
       referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
       allowThirdPartyFixup: true,
       relatedToCurrent: true,
       isPrerendered: true,
       triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
     });
-    yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
+    await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
     browser1.frameLoader.appendPartialSHistoryAndSwap(tab2.linkedBrowser.frameLoader);
-    yield awaitProcessChange(browser1);
+    await awaitProcessChange(browser1);
 
     // Close tab2 such that the back frameloader is dead
-    yield BrowserTestUtils.removeTab(tab2);
-    yield BrowserTestUtils.waitForCondition(() => browser1.canGoBack);
+    await BrowserTestUtils.removeTab(tab2);
+    await BrowserTestUtils.waitForCondition(() => browser1.canGoBack);
     browser1.goBack();
-    yield BrowserTestUtils.browserLoaded(browser1);
-    yield ContentTask.spawn(browser1, null, function() {
+    await BrowserTestUtils.browserLoaded(browser1);
+    await ContentTask.spawn(browser1, null, function() {
       is(content.window.location + "", "data:text/html,a");
       let webNav = content.window.QueryInterface(Ci.nsIInterfaceRequestor)
             .getInterface(Ci.nsIWebNavigation);
       is(webNav.canGoForward, true, "canGoForward is correct");
       is(webNav.canGoBack, false, "canGoBack is correct");
     });
     is(browser1.frameLoader.groupedSHistory, null,
        "browser1's session history is now complete");
--- a/docshell/test/browser/browser_history_triggeringprincipal_viewsource.js
+++ b/docshell/test/browser/browser_history_triggeringprincipal_viewsource.js
@@ -1,50 +1,50 @@
 "use strict";
 
 const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "http://example.com");
 const HTML_URI = TEST_PATH + "dummy_page.html";
 const VIEW_SRC_URI = "view-source:" + HTML_URI;
 
-add_task(function*() {
+add_task(async function() {
   info("load baseline html in new tab");
-  yield BrowserTestUtils.withNewTab(HTML_URI, function*(aBrowser) {
+  await BrowserTestUtils.withNewTab(HTML_URI, async function(aBrowser) {
     is(gBrowser.selectedBrowser.currentURI.spec, HTML_URI,
        "sanity check to make sure html loaded");
 
     info("right-click -> view-source of html");
     let vSrcCtxtMenu = document.getElementById("contentAreaContextMenu");
     let popupPromise = BrowserTestUtils.waitForEvent(vSrcCtxtMenu, "popupshown");
     BrowserTestUtils.synthesizeMouseAtCenter("body", { type: "contextmenu", button: 2 }, aBrowser);
-    yield popupPromise;
+    await popupPromise;
     let tabPromise = BrowserTestUtils.waitForNewTab(gBrowser, VIEW_SRC_URI);
     let vSrcItem = vSrcCtxtMenu.getElementsByAttribute("id", "context-viewsource")[0];
     vSrcItem.click();
     vSrcCtxtMenu.hidePopup();
-    let tab = yield tabPromise;
+    let tab = await tabPromise;
     is(gBrowser.selectedBrowser.currentURI.spec, VIEW_SRC_URI,
        "loading view-source of html succeeded");
 
     info ("load html file again before going .back()");
     let loadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, HTML_URI);
-    yield ContentTask.spawn(tab.linkedBrowser, HTML_URI, HTML_URI => {
+    await ContentTask.spawn(tab.linkedBrowser, HTML_URI, HTML_URI => {
       content.document.location = HTML_URI;
     });
-    yield loadPromise;
+    await loadPromise;
     is(gBrowser.selectedBrowser.currentURI.spec, HTML_URI,
       "loading html another time succeeded");
 
     info("click .back() to view-source of html again and make sure the history entry has a triggeringPrincipal");
     let backCtxtMenu = document.getElementById("contentAreaContextMenu");
     popupPromise = BrowserTestUtils.waitForEvent(backCtxtMenu, "popupshown");
     BrowserTestUtils.synthesizeMouseAtCenter("body", { type: "contextmenu", button: 2 }, aBrowser);
-    yield popupPromise;
+    await popupPromise;
     loadPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, VIEW_SRC_URI);
     let backItem = backCtxtMenu.getElementsByAttribute("id", "context-back")[0];
     backItem.click();
     backCtxtMenu.hidePopup();
-    yield loadPromise;
+    await loadPromise;
     is(gBrowser.selectedBrowser.currentURI.spec, VIEW_SRC_URI,
       "clicking .back() to view-source of html succeeded");
 
-    yield BrowserTestUtils.removeTab(tab);
+    await BrowserTestUtils.removeTab(tab);
   });
 });
--- a/docshell/test/browser/browser_multiple_pushState.js
+++ b/docshell/test/browser/browser_multiple_pushState.js
@@ -1,15 +1,15 @@
-add_task(function* test_multiple_pushState() {
-  yield BrowserTestUtils.withNewTab({
+add_task(async function test_multiple_pushState() {
+  await BrowserTestUtils.withNewTab({
     gBrowser,
     url: "http://example.org/browser/docshell/test/browser/file_multiple_pushState.html",
-  }, function* (browser) {
+  }, async function(browser) {
     const kExpected = "http://example.org/bar/ABC/DEF?key=baz";
 
-    let contentLocation = yield ContentTask.spawn(browser, null, function* () {
+    let contentLocation = await ContentTask.spawn(browser, null, async function() {
       return content.document.location.href;
     });
 
     is(contentLocation, kExpected);
     is(browser.documentURI.spec, kExpected);
   });
 });
--- a/docshell/test/browser/browser_tab_touch_events.js
+++ b/docshell/test/browser/browser_tab_touch_events.js
@@ -1,22 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-add_task(function*() {
+add_task(async function() {
   const URI = "data:text/html;charset=utf-8,<iframe id='test-iframe'></iframe>";
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: URI }, function* (browser) {
-    yield ContentTask.spawn(browser, null, test_body);
+  await BrowserTestUtils.withNewTab({ gBrowser, url: URI }, async function(browser) {
+    await ContentTask.spawn(browser, null, test_body);
   });
 });
 
-function* test_body() {
+async function test_body() {
   let docshell = docShell;
 
   is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_NONE,
     "touchEventsOverride flag should be initially set to NONE");
 
   docshell.touchEventsOverride = Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED;
   is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
     "touchEventsOverride flag should be changed to DISABLED");
@@ -34,16 +34,16 @@ function* test_body() {
   let newFrameWin = newFrame.contentWindow;
   docshell = newFrameWin.QueryInterface(Ci.nsIInterfaceRequestor)
                         .getInterface(Ci.nsIWebNavigation)
                         .QueryInterface(Ci.nsIDocShell);
   is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
     "Newly created frames should use the new touchEventsOverride flag");
 
   newFrameWin.location.reload();
-  yield ContentTaskUtils.waitForEvent(newFrameWin, "load");
+  await ContentTaskUtils.waitForEvent(newFrameWin, "load");
 
   docshell = newFrameWin.QueryInterface(Ci.nsIInterfaceRequestor)
                         .getInterface(Ci.nsIWebNavigation)
                         .QueryInterface(Ci.nsIDocShell);
   is(docshell.touchEventsOverride, Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_DISABLED,
     "New touchEventsOverride flag should persist across reloads");
 }
--- a/docshell/test/browser/browser_timelineMarkers-01.js
+++ b/docshell/test/browser/browser_timelineMarkers-01.js
@@ -2,20 +2,20 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test that the docShell has the right profile timeline API
 
 const URL = "data:text/html;charset=utf-8,Test page";
 
-add_task(function* () {
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: URL },
-    function* (browser) {
-      yield ContentTask.spawn(browser, null, function() {
+add_task(async function() {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: URL },
+    async function(browser) {
+      await ContentTask.spawn(browser, null, function() {
         ok("recordProfileTimelineMarkers" in docShell,
            "The recordProfileTimelineMarkers attribute exists");
         ok("popProfileTimelineMarkers" in docShell,
            "The popProfileTimelineMarkers function exists");
         ok(docShell.recordProfileTimelineMarkers === false,
            "recordProfileTimelineMarkers is false by default");
         ok(docShell.popProfileTimelineMarkers().length === 0,
            "There are no markers by default");
--- a/docshell/test/browser/browser_ua_emulation.js
+++ b/docshell/test/browser/browser_ua_emulation.js
@@ -1,36 +1,36 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const URL = "data:text/html;charset=utf-8,<iframe id='test-iframe'></iframe>";
 
 // Test that the docShell UA emulation works
-function* contentTask() {
+async function contentTask() {
   let docshell = docShell;
   is(docshell.customUserAgent, "", "There should initially be no customUserAgent");
 
   docshell.customUserAgent = "foo";
   is(content.navigator.userAgent, "foo", "The user agent should be changed to foo");
 
   let frameWin = content.document.querySelector("#test-iframe").contentWindow;
   is(frameWin.navigator.userAgent, "foo", "The UA should be passed on to frames.");
 
   let newFrame = content.document.createElement("iframe");
   content.document.body.appendChild(newFrame);
 
   let newFrameWin = newFrame.contentWindow;
   is(newFrameWin.navigator.userAgent, "foo", "Newly created frames should use the new UA");
 
   newFrameWin.location.reload();
-  yield ContentTaskUtils.waitForEvent(newFrameWin, "load");
+  await ContentTaskUtils.waitForEvent(newFrameWin, "load");
 
   is(newFrameWin.navigator.userAgent, "foo", "New UA should persist across reloads");
 }
 
-add_task(function* () {
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: URL },
-    function* (browser) {
-      yield ContentTask.spawn(browser, null, contentTask);
+add_task(async function() {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: URL },
+    async function(browser) {
+      await ContentTask.spawn(browser, null, contentTask);
     });
 });
--- a/docshell/test/browser/browser_uriFixupAlternateRedirects.js
+++ b/docshell/test/browser/browser_uriFixupAlternateRedirects.js
@@ -1,24 +1,24 @@
 "use strict";
 
 const REDIRECTURL = "http://www.example.com/browser/docshell/test/browser/redirect_to_example.sjs"
 
-add_task(function* () {
-  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
+add_task(async function() {
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
   gURLBar.value = REDIRECTURL;
   gURLBar.select();
   let errorPageLoaded = BrowserTestUtils.waitForErrorPage(tab.linkedBrowser);
   EventUtils.sendKey("return");
-  yield errorPageLoaded;
-  let [contentURL, originalURL] = yield ContentTask.spawn(tab.linkedBrowser, null, () => {
+  await errorPageLoaded;
+  let [contentURL, originalURL] = await ContentTask.spawn(tab.linkedBrowser, null, () => {
     return [
       content.document.documentURI,
       content.document.mozDocumentURIIfNotForErrorPages.spec,
     ];
   });
   info("Page that loaded: " + contentURL);
   ok(contentURL.startsWith("about:neterror?"), "Should be on an error page");
   originalURL = new URL(originalURL);
   is(originalURL.host, "example", "Should be an error for http://example, not http://www.example.com/");
 
-  yield BrowserTestUtils.removeTab(tab);
+  await BrowserTestUtils.removeTab(tab);
 });
--- a/docshell/test/browser/browser_uriFixupIntegration.js
+++ b/docshell/test/browser/browser_uriFixupIntegration.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const kSearchEngineID = "browser_urifixup_search_engine";
 const kSearchEngineURL = "http://example.com/?search={searchTerms}";
 
-add_task(function* setup() {
+add_task(async function setup() {
   // Add a new fake search engine.
   Services.search.addEngineWithDetails(kSearchEngineID, "", "", "", "get",
                                        kSearchEngineURL);
 
   let oldDefaultEngine = Services.search.defaultEngine;
   Services.search.defaultEngine = Services.search.getEngineByName(kSearchEngineID);
 
   // Remove the fake engine when done.
@@ -22,27 +22,27 @@ add_task(function* setup() {
 
     let engine = Services.search.getEngineByName(kSearchEngineID);
     if (engine) {
       Services.search.removeEngine(engine);
     }
   });
 });
 
-add_task(function* test() {
+add_task(async function test() {
   for (let searchParams of ["foo bar", "brokenprotocol:somethingelse"]) {
     // Add a new blank tab.
     gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
-    yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
     // Enter search terms and start a search.
     gURLBar.value = searchParams;
     gURLBar.focus();
     EventUtils.synthesizeKey("VK_RETURN", {});
-    yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
     // Check that we arrived at the correct URL.
     let escapedParams = encodeURIComponent(searchParams).replace("%20", "+");
     let expectedURL = kSearchEngineURL.replace("{searchTerms}", escapedParams);
     is(gBrowser.selectedBrowser.currentURI.spec, expectedURL,
        "New tab should have loaded with expected url.");
 
     // Cleanup.
--- a/docshell/test/browser/frame-head.js
+++ b/docshell/test/browser/frame-head.js
@@ -1,16 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Functions that are automatically loaded as frame scripts for
 // timeline tests.
 
 var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
 var { Promise } = Cu.import('resource://gre/modules/Promise.jsm', {});
 
 Cu.import("resource://gre/modules/Timer.jsm");
 
 // Functions that look like mochitest functions but forward to the
 // browser process.
 
 this.ok = function(value, message) {
@@ -45,17 +44,17 @@ this.finish = function() {
  *             passed to it, and marker reading stops when it returns
  *             true.
  *        setup is a function that takes the docshell as an argument.
  *             It should start the test.
  *        check is a function that takes an array of markers
  *             as an argument and checks the results of the test.
  */
 this.timelineContentTest = function(tests) {
-  Task.spawn(function*() {
+  (async function() {
     let docShell = content.QueryInterface(Ci.nsIInterfaceRequestor)
                           .getInterface(Ci.nsIWebNavigation)
                           .QueryInterface(Ci.nsIDocShell);
 
     info("Start recording");
     docShell.recordProfileTimelineMarkers = true;
 
     for (let {desc, searchFor, setup, check} of tests) {
@@ -64,30 +63,30 @@ this.timelineContentTest = function(test
 
       info("Flushing the previous markers if any");
       docShell.popProfileTimelineMarkers();
 
       info("Running the test setup function");
       let onMarkers = timelineWaitForMarkers(docShell, searchFor);
       setup(docShell);
       info("Waiting for new markers on the docShell");
-      let markers = yield onMarkers;
+      let markers = await onMarkers;
 
       // Cycle collection markers are non-deterministic, and none of these tests
       // expect them to show up.
       markers = markers.filter(m => m.name.indexOf("nsCycleCollector") === -1);
 
       info("Running the test check function");
       check(markers);
     }
 
     info("Stop recording");
     docShell.recordProfileTimelineMarkers = false;
     finish();
-  });
+  })();
 }
 
 function timelineWaitForMarkers(docshell, searchFor) {
   if (typeof(searchFor) == "string") {
     let searchForString = searchFor;
     let f = function (markers) {
       return markers.some(m => m.name == searchForString);
     };
--- a/docshell/test/browser/head.js
+++ b/docshell/test/browser/head.js
@@ -5,21 +5,21 @@
  * suitable for use as a particular timeline test.
  * @param string frameScriptName
  *        Base name of the frame script file.
  * @param string url
  *        URL to load.
  */
 function makeTimelineTest(frameScriptName, url) {
   info("in timelineTest");
-  return Task.async(function*() {
+  return async function() {
     info("in in timelineTest");
     waitForExplicitFinish();
 
-    yield timelineTestOpenUrl(url);
+    await timelineTestOpenUrl(url);
 
     const here = "chrome://mochitests/content/browser/docshell/test/browser/";
 
     let mm = gBrowser.selectedBrowser.messageManager;
     mm.loadFrameScript(here + "frame-head.js", false);
     mm.loadFrameScript(here + frameScriptName, false);
 
     // Set up some listeners so that timeline tests running in the
@@ -29,17 +29,17 @@ function makeTimelineTest(frameScriptNam
     });
     mm.addMessageListener("browser:test:info", function(message) {
       info(message.data.message);
     });
     mm.addMessageListener("browser:test:finish", function(ignore) {
       gBrowser.removeCurrentTab();
       finish();
     });
-  });
+  };
 }
 
 /* Open a URL for a timeline test.  */
 function timelineTestOpenUrl(url) {
   window.focus();
 
   let tabSwitchPromise = new Promise((resolve, reject) => {
     window.gBrowser.addEventListener("TabSwitchDone", function() {
--- a/docshell/test/navigation/browser_bug343515.js
+++ b/docshell/test/navigation/browser_bug343515.js
@@ -22,18 +22,18 @@ function nShotsListener(aElem, aType, aC
   }, true);
 }
 
 function oneShotListener(aElem, aType, aCallback) {
   nShotsListener(aElem, aType, aCallback, 1);
 }
 
 function waitForPageshow(aBrowser, callback) {
-  return ContentTask.spawn(aBrowser, null, function* () {
-    yield ContentTaskUtils.waitForEvent(this, "pageshow");
+  return ContentTask.spawn(aBrowser, null, async function() {
+    await ContentTaskUtils.waitForEvent(this, "pageshow");
   }).then(callback);
 }
 
 // Entry point from Mochikit
 function test() {
 
   // Lots of callbacks going on here
   waitForExplicitFinish();
@@ -86,17 +86,17 @@ function step3() {
      "Got expected tab 2 url in step 3");
 
   // Tab 0 should be inactive, Tab 1 should be active
   ok(!ctx.tab0Browser.docShellIsActive, "Tab 0 should be inactive");
   ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active");
 
   // Tab 2's window _and_ its iframes should be inactive
   ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive");
-  ContentTask.spawn(ctx.tab2Browser, null, function* () {
+  ContentTask.spawn(ctx.tab2Browser, null, async function() {
     Assert.equal(content.frames.length, 2, "Tab 2 should have 2 iframes");
     for (var i = 0; i < content.frames.length; i++) {
       info("step 3, frame " + i + " info: " + content.frames[i].location);
       let docshell = content.frames[i].QueryInterface(Ci.nsIInterfaceRequestor)
                                       .getInterface(Ci.nsIWebNavigation)
                                       .QueryInterface(Ci.nsIDocShell);
 
       Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`);
@@ -108,17 +108,17 @@ function step3() {
     // bug343515_pg3.html consists of a page with two iframes, one of which
     // contains another iframe, so there'll be a total of 4 load events
     nShotsListener(ctx.tab2Browser, "load", step4, 4);
   });
 }
 
 function step4() {
   function checkTab2Active(expected) {
-    return ContentTask.spawn(ctx.tab2Browser, expected, function* (expected) {
+    return ContentTask.spawn(ctx.tab2Browser, expected, async function(expected) {
       function isActive(aWindow) {
         var docshell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                               .getInterface(Ci.nsIWebNavigation)
                               .QueryInterface(Ci.nsIDocShell);
         return docshell.isActive;
       }
 
       let active = expected ? "active" : "inactive";
@@ -158,17 +158,17 @@ function step4() {
   });
 }
 
 function step5() {
   // Check everything
   ok(!ctx.tab0Browser.docShellIsActive, "Tab 0 should be inactive");
   ok(!ctx.tab1Browser.docShellIsActive, "Tab 1 should be inactive");
   ok(ctx.tab2Browser.docShellIsActive, "Tab 2 should be active");
-  ContentTask.spawn(ctx.tab2Browser, null, function* () {
+  ContentTask.spawn(ctx.tab2Browser, null, async function() {
     for (var i = 0; i < content.frames.length; i++) {
       let docshell = content.frames[i].QueryInterface(Ci.nsIInterfaceRequestor)
                                       .getInterface(Ci.nsIWebNavigation)
                                       .QueryInterface(Ci.nsIDocShell);
 
       Assert.ok(docShell.isActive, `Tab2 iframe ${i} should be active`);
     }
   }).then(() => {
@@ -184,30 +184,30 @@ function step5() {
   });
 }
 
 function step6() {
 
   // Check everything
   ok(!ctx.tab0Browser.docShellIsActive, "Tab 0 should be inactive");
   ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active");
-  ContentTask.spawn(ctx.tab1Browser, null, function* () {
+  ContentTask.spawn(ctx.tab1Browser, null, async function() {
     function isActive(aWindow) {
       var docshell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                             .getInterface(Ci.nsIWebNavigation)
                             .QueryInterface(Ci.nsIDocShell);
       return docshell.isActive;
     }
 
     Assert.ok(isActive(content.frames[0]), "Tab1 iframe 0 should be active");
     Assert.ok(isActive(content.frames[0].frames[0]), "Tab1 iframe 0 subiframe 0 should be active");
     Assert.ok(isActive(content.frames[1]), "Tab1 iframe 1 should be active");
   }).then(() => {
     ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive");
-    return ContentTask.spawn(ctx.tab2Browser, null, function* () {
+    return ContentTask.spawn(ctx.tab2Browser, null, async function() {
       for (var i = 0; i < content.frames.length; i++) {
         let docshell = content.frames[i].QueryInterface(Ci.nsIInterfaceRequestor)
                                         .getInterface(Ci.nsIWebNavigation)
                                         .QueryInterface(Ci.nsIDocShell);
 
         Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`);
       }
     });
@@ -216,17 +216,17 @@ function step6() {
     waitForPageshow(ctx.tab2Browser, step7);
     ctx.tab2Browser.goForward();
   });
 }
 
 function step7() {
   function checkBrowser(browser, tabNum, active) {
     return ContentTask.spawn(browser, { tabNum, active },
-                             function* ({ tabNum, active }) {
+                             async function({ tabNum, active }) {
              function isActive(aWindow) {
                var docshell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                                      .getInterface(Ci.nsIWebNavigation)
                                      .QueryInterface(Ci.nsIDocShell);
                return docshell.isActive;
              }
 
              let activestr = active ? "active" : "inactive";
--- a/docshell/test/navigation/browser_test-content-chromeflags.js
+++ b/docshell/test/navigation/browser_test-content-chromeflags.js
@@ -1,34 +1,34 @@
 const TEST_PAGE = `data:text/html,<html><body><a href="about:blank" target="_blank">Test</a></body></html>`;
 const CHROME_ALL = Ci.nsIWebBrowserChrome.CHROME_ALL;
 const CHROME_REMOTE_WINDOW = Ci.nsIWebBrowserChrome.CHROME_REMOTE_WINDOW;
 
 /**
  * Tests that when we open new browser windows from content they
  * get the full browser chrome.
  */
-add_task(function* () {
+add_task(async function() {
   // Make sure that the window.open call will open a new
   // window instead of a new tab.
-  yield new Promise(resolve => {
+  await new Promise(resolve => {
     SpecialPowers.pushPrefEnv({
       "set": [
         ["browser.link.open_newwindow", 2],
       ]
     }, resolve);
   });
 
-  yield BrowserTestUtils.withNewTab({
+  await BrowserTestUtils.withNewTab({
     gBrowser,
     url: TEST_PAGE
-  }, function*(browser) {
+  }, async function(browser) {
     let openedPromise = BrowserTestUtils.waitForNewWindow();
     BrowserTestUtils.synthesizeMouse("a", 0, 0, {}, browser);
-    let win = yield openedPromise;
+    let win = await openedPromise;
 
     let chromeFlags = win.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIWebNavigation)
                          .QueryInterface(Ci.nsIDocShellTreeItem)
                          .treeOwner
                          .QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIXULWindow)
                          .chromeFlags;
--- a/docshell/test/unit/test_setUsePrivateBrowsing.js
+++ b/docshell/test/unit/test_setUsePrivateBrowsing.js
@@ -1,16 +1,16 @@
 "use strict";
 
 const {utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
-add_task(function*() {
+add_task(async function() {
   let webNav = Services.appShell.createWindowlessBrowser(false);
 
   let loadContext = webNav.QueryInterface(Ci.nsIInterfaceRequestor)
                           .getInterface(Ci.nsILoadContext);
 
   let docShell = webNav.getInterface(Ci.nsIDocShell);
 
   equal(loadContext.usePrivateBrowsing, false, "Should start out in non-private mode");
@@ -35,17 +35,17 @@ add_task(function*() {
   docShell.setOriginAttributes(oa);
 
   equal(loadContext.usePrivateBrowsing, false,
         "Should be able to change origin attributes prior to a document load");
 
   webNav.loadURI("data:text/html,", webNav.LOAD_FLAGS_NONE, null, null, null);
 
   // Return to the event loop so the load can begin.
-  yield new Promise(do_execute_soon);
+  await new Promise(do_execute_soon);
 
   // This causes a failed assertion rather than an exception on debug
   // builds.
   if (!AppConstants.DEBUG) {
     Assert.throws(() => { loadContext.usePrivateBrowsing = true; },
                   /NS_ERROR_FAILURE/,
                   "Should not be able to change private browsing state after initial load has started");
 
--- a/dom/animation/test/chrome/test_restyles.html
+++ b/dom/animation/test/chrome/test_restyles.html
@@ -75,180 +75,180 @@ function add_task_if_omta_enabled(test) 
     return;
   }
   add_task(test);
 }
 
 // We need to wait for all paints before running tests to avoid contaminations
 // from styling of this document itself.
 waitForAllPaints(function() {
-  add_task(function* restyling_for_main_thread_animations() {
+  add_task(async function restyling_for_main_thread_animations() {
     var div = addDiv(null, { style: 'animation: background-color 100s' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(!animation.isRunningOnCompositor);
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 5,
        'CSS animations running on the main-thread should update style ' +
        'on the main thread');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_for_compositor_animations() {
+  add_task_if_omta_enabled(async function no_restyling_for_compositor_animations() {
     var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(animation.isRunningOnCompositor);
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'CSS animations running on the compositor should not update style ' +
        'on the main thread');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_for_compositor_transitions() {
+  add_task_if_omta_enabled(async function no_restyling_for_compositor_transitions() {
     var div = addDiv(null, { style: 'transition: opacity 100s; opacity: 0' });
     getComputedStyle(div).opacity;
     div.style.opacity = 1;
 
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(animation.isRunningOnCompositor);
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'CSS transitions running on the compositor should not update style ' +
        'on the main thread');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_when_animation_duration_is_changed() {
+  add_task_if_omta_enabled(async function no_restyling_when_animation_duration_is_changed() {
     var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(animation.isRunningOnCompositor);
 
     div.animationDuration = '200s';
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'Animations running on the compositor should not update style ' +
        'on the main thread');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* only_one_restyling_after_finish_is_called() {
+  add_task_if_omta_enabled(async function only_one_restyling_after_finish_is_called() {
     var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(animation.isRunningOnCompositor);
 
     animation.finish();
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 1,
        'Animations running on the compositor should only update style ' +
        'once after finish() is called');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* no_restyling_mouse_movement_on_finished_transition() {
+  add_task(async function no_restyling_mouse_movement_on_finished_transition() {
     var div = addDiv(null, { style: 'transition: opacity 1ms; opacity: 0' });
     getComputedStyle(div).opacity;
     div.style.opacity = 1;
 
     var animation = div.getAnimations()[0];
     var initialRect = div.getBoundingClientRect();
 
-    yield animation.finished;
+    await animation.finished;
 
     var mouseX = initialRect.left + initialRect.width / 2;
     var mouseY = initialRect.top + initialRect.height / 2;
-    var markers = yield observeStyling(5, function() {
+    var markers = await observeStyling(5, function() {
       // We can't use synthesizeMouse here since synthesizeMouse causes
       // layout flush.
       synthesizeMouseAtPoint(mouseX++, mouseY++,
                              { type: 'mousemove' }, window);
     });
 
     is(markers.length, 0,
        'Bug 1219236: Finished transitions should never cause restyles ' +
        'when mouse is moved on the animations');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* no_restyling_mouse_movement_on_finished_animation() {
+  add_task(async function no_restyling_mouse_movement_on_finished_animation() {
     var div = addDiv(null, { style: 'animation: opacity 1ms' });
     var animation = div.getAnimations()[0];
 
     var initialRect = div.getBoundingClientRect();
 
-    yield animation.finished;
+    await animation.finished;
 
     var mouseX = initialRect.left + initialRect.width / 2;
     var mouseY = initialRect.top + initialRect.height / 2;
-    var markers = yield observeStyling(5, function() {
+    var markers = await observeStyling(5, function() {
       // We can't use synthesizeMouse here since synthesizeMouse causes
       // layout flush.
       synthesizeMouseAtPoint(mouseX++, mouseY++,
                              { type: 'mousemove' }, window);
     });
 
     is(markers.length, 0,
        'Bug 1219236: Finished animations should never cause restyles ' +
        'when mouse is moved on the animations');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_compositor_animations_out_of_view_element() {
+  add_task_if_omta_enabled(async function no_restyling_compositor_animations_out_of_view_element() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     var div = addDiv(null,
       { style: 'animation: opacity 100s; transform: translateY(-400px);' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(!animation.isRunningOnCompositor);
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Animations running on the compositor in an out-of-view element ' +
        'should never cause restyles');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* no_restyling_main_thread_animations_out_of_view_element() {
+  add_task(async function no_restyling_main_thread_animations_out_of_view_element() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     var div = addDiv(null,
       { style: 'animation: background-color 100s; transform: translateY(-400px);' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
-    var markers = yield observeStyling(5);
+    await animation.ready;
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Animations running on the main-thread in an out-of-view element ' +
        'should never cause restyles');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_compositor_animations_in_scrolled_out_element() {
+  add_task_if_omta_enabled(async function no_restyling_compositor_animations_in_scrolled_out_element() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     /*
      On Android the opacity animation runs on the compositor even if it is
      scrolled out of view.  We will fix this in bug 1247800.
      */
@@ -257,28 +257,28 @@ waitForAllPaints(function() {
     }
     var parentElement = addDiv(null,
       { style: 'overflow-y: scroll; height: 20px;' });
     var div = addDiv(null,
       { style: 'animation: opacity 100s; position: relative; top: 100px;' });
     parentElement.appendChild(div);
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Animations running on the compositor for elements ' +
        'which are scrolled out should never cause restyles');
 
-    yield ensureElementRemoval(parentElement);
+    await ensureElementRemoval(parentElement);
   });
 
-  add_task(function* no_restyling_main_thread_animations_in_scrolled_out_element() {
+  add_task(async function no_restyling_main_thread_animations_in_scrolled_out_element() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
@@ -288,27 +288,27 @@ waitForAllPaints(function() {
 
     var parentElement = addDiv(null,
       { style: 'overflow-y: scroll; height: 20px;' });
     var div = addDiv(null,
       { style: 'animation: background-color 100s; position: relative; top: 100px;' });
     parentElement.appendChild(div);
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
-    var markers = yield observeStyling(5);
+    await animation.ready;
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Animations running on the main-thread for elements ' +
        'which are scrolled out should never cause restyles');
 
-    yield ensureElementRemoval(parentElement);
+    await ensureElementRemoval(parentElement);
   });
 
-  add_task(function* no_restyling_main_thread_animations_in_nested_scrolled_out_element() {
+  add_task(async function no_restyling_main_thread_animations_in_nested_scrolled_out_element() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
@@ -321,43 +321,43 @@ waitForAllPaints(function() {
     var parentElement = addDiv(null,
       { style: 'overflow-y: scroll; height: 100px;' });
     var div = addDiv(null,
       { style: 'animation: background-color 100s; position: relative; top: 100px;' });
     grandParent.appendChild(parentElement);
     parentElement.appendChild(div);
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
-    var markers = yield observeStyling(5);
+    await animation.ready;
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Animations running on the main-thread which are in nested elements ' +
        'which are scrolled out should never cause restyles');
 
-    yield ensureElementRemoval(grandParent);
+    await ensureElementRemoval(grandParent);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_compositor_animations_in_visiblily_hidden_element() {
+  add_task_if_omta_enabled(async function no_restyling_compositor_animations_in_visiblily_hidden_element() {
     var div = addDiv(null,
      { style: 'animation: opacity 100s; visibility: hidden' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(!animation.isRunningOnCompositor);
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
 
     todo_is(markers.length, 0,
             'Bug 1237454: Animations running on the compositor in ' +
             'visibility hidden element should never cause restyles');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* restyling_main_thread_animations_moved_in_view_by_scrolling() {
+  add_task(async function restyling_main_thread_animations_moved_in_view_by_scrolling() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
@@ -371,35 +371,35 @@ waitForAllPaints(function() {
       { style: 'animation: background-color 100s; position: relative; top: 100px;' });
     parentElement.appendChild(div);
     var animation = div.getAnimations()[0];
 
     var parentRect = parentElement.getBoundingClientRect();
     var centerX = parentRect.left + parentRect.width / 2;
     var centerY = parentRect.top + parentRect.height / 2;
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(1, function() {
+    var markers = await observeStyling(1, function() {
       // We can't use synthesizeWheel here since synthesizeWheel causes
       // layout flush.
       synthesizeWheelAtPoint(centerX, centerY,
                              { deltaMode: WheelEvent.DOM_DELTA_PIXEL,
                                deltaY: 100 });
     });
 
     is(markers.length, 1,
        'Animations running on the main-thread which were in scrolled out ' +
        'elements should update restyling soon after the element moved in ' +
        'view by scrolling');
 
-    yield ensureElementRemoval(parentElement);
+    await ensureElementRemoval(parentElement);
   });
 
-  add_task(function* restyling_main_thread_animations_moved_in_view_by_scrolling() {
+  add_task(async function restyling_main_thread_animations_moved_in_view_by_scrolling() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     var grandParent = addDiv(null,
       { style: 'overflow-y: scroll; height: 20px;' });
     var parentElement = addDiv(null,
       { style: 'overflow-y: scroll; height: 200px;' });
@@ -408,36 +408,36 @@ waitForAllPaints(function() {
     grandParent.appendChild(parentElement);
     parentElement.appendChild(div);
     var animation = div.getAnimations()[0];
 
     var parentRect = grandParent.getBoundingClientRect();
     var centerX = parentRect.left + parentRect.width / 2;
     var centerY = parentRect.top + parentRect.height / 2;
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(1, function() {
+    var markers = await observeStyling(1, function() {
       // We can't use synthesizeWheel here since synthesizeWheel causes
       // layout flush.
       synthesizeWheelAtPoint(centerX, centerY,
                              { deltaMode: WheelEvent.DOM_DELTA_PIXEL,
                                deltaY: 100 });
     });
 
     // FIXME: We should reduce a redundant restyle here.
     ok(markers.length >= 1,
        'Animations running on the main-thread which were in nested scrolled ' +
        'out elements should update restyle soon after the element moved ' +
        'in view by scrolling');
 
-    yield ensureElementRemoval(grandParent);
+    await ensureElementRemoval(grandParent);
   });
 
-  add_task(function* restyling_main_thread_animations_move_out_of_view_by_scrolling() {
+  add_task(async function restyling_main_thread_animations_move_out_of_view_by_scrolling() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
@@ -454,426 +454,426 @@ waitForAllPaints(function() {
     parentElement.appendChild(div);
     parentElement.appendChild(pad);
     var animation = div.getAnimations()[0];
 
     var parentRect = parentElement.getBoundingClientRect();
     var centerX = parentRect.left + parentRect.width / 2;
     var centerY = parentRect.top + parentRect.height / 2;
 
-    yield animation.ready;
+    await animation.ready;
 
     // We can't use synthesizeWheel here since synthesizeWheel causes
     // layout flush.
     synthesizeWheelAtPoint(centerX, centerY,
                            { deltaMode: WheelEvent.DOM_DELTA_PIXEL,
                              deltaY: 200 });
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
 
     // FIXME: We should reduce a redundant restyle here.
     ok(markers.length >= 0,
        'Animations running on the main-thread which are in scrolled out ' +
        'elements should throttle restyling');
 
-    yield ensureElementRemoval(parentElement);
+    await ensureElementRemoval(parentElement);
   });
 
-  add_task(function* restyling_main_thread_animations_moved_in_view_by_resizing() {
+  add_task(async function restyling_main_thread_animations_moved_in_view_by_resizing() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     var parentElement = addDiv(null,
       { style: 'overflow-y: scroll; height: 20px;' });
     var div = addDiv(null,
       { style: 'animation: background-color 100s; position: relative; top: 100px;' });
     parentElement.appendChild(div);
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(1, function() {
+    var markers = await observeStyling(1, function() {
       parentElement.style.height = '100px';
     });
 
     is(markers.length, 1,
        'Animations running on the main-thread which was in scrolled out ' +
        'elements should update restyling soon after the element moved in ' +
        'view by resizing');
 
-    yield ensureElementRemoval(parentElement);
+    await ensureElementRemoval(parentElement);
   });
 
-  add_task(function* no_restyling_main_thread_animations_in_visiblily_hidden_element() {
+  add_task(async function no_restyling_main_thread_animations_in_visiblily_hidden_element() {
     var div = addDiv(null,
      { style: 'animation: background-color 100s; visibility: hidden' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
-    var markers = yield observeStyling(5);
+    await animation.ready;
+    var markers = await observeStyling(5);
 
     todo_is(markers.length, 0,
             'Bug 1237454: Animations running on the main-thread in ' +
             'visibility hidden element should never cause restyles');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_compositor_animations_after_pause_is_called() {
+  add_task_if_omta_enabled(async function no_restyling_compositor_animations_after_pause_is_called() {
     var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
     ok(animation.isRunningOnCompositor);
 
     animation.pause();
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'Bug 1232563: Paused animations running on the compositor should ' +
        'never cause restyles once after pause() is called');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* no_restyling_main_thread_animations_after_pause_is_called() {
+  add_task(async function no_restyling_main_thread_animations_after_pause_is_called() {
     var div = addDiv(null, { style: 'animation: background-color 100s' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
 
     animation.pause();
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'Bug 1232563: Paused animations running on the main-thread should ' +
        'never cause restyles after pause() is called');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* only_one_restyling_when_current_time_is_set_to_middle_of_duration() {
+  add_task_if_omta_enabled(async function only_one_restyling_when_current_time_is_set_to_middle_of_duration() {
     var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
 
-    yield animation.ready;
+    await animation.ready;
 
     animation.currentTime = 50 * MS_PER_SEC;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 1,
        'Bug 1235478: Animations running on the compositor should only once ' +
        'update style when currentTime is set to middle of duration time');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* change_duration_and_currenttime() {
+  add_task_if_omta_enabled(async function change_duration_and_currenttime() {
     var div = addDiv(null);
     var animation = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
 
-    yield animation.ready;
+    await animation.ready;
     ok(animation.isRunningOnCompositor);
 
     // Set currentTime to a time longer than duration.
     animation.currentTime = 500 * MS_PER_SEC;
 
     // Now the animation immediately get back from compositor.
     ok(!animation.isRunningOnCompositor);
 
     // Extend the duration.
     animation.effect.timing.duration = 800 * MS_PER_SEC;
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 1,
        'Animations running on the compositor should update style ' +
        'when timing.duration is made longer than the current time');
 
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* script_animation_on_display_none_element() {
+  add_task(async function script_animation_on_display_none_element() {
     var div = addDiv(null);
     var animation = div.animate({ backgroundColor: [ 'red', 'blue' ] },
                                 100 * MS_PER_SEC);
 
-    yield animation.ready;
+    await animation.ready;
 
     div.style.display = 'none';
 
     // We need to wait a frame to apply display:none style.
-    yield waitForFrame();
+    await waitForFrame();
 
     is(animation.playState, 'running',
        'Script animations keep running even when the target element has ' +
        '"display: none" style');
 
     ok(!animation.isRunningOnCompositor,
        'Script animations on "display:none" element should not run on the ' +
        'compositor');
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'Script animations on "display: none" element should not update styles');
 
     div.style.display = '';
 
     // We need to wait a frame to unapply display:none style.
-    yield waitForFrame();
+    await waitForFrame();
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 5,
        'Script animations restored from "display: none" state should update ' +
        'styles');
 
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* compositable_script_animation_on_display_none_element() {
+  add_task_if_omta_enabled(async function compositable_script_animation_on_display_none_element() {
     var div = addDiv(null);
     var animation = div.animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
 
-    yield animation.ready;
+    await animation.ready;
 
     div.style.display = 'none';
 
     // We need to wait a frame to apply display:none style.
-    yield waitForFrame();
+    await waitForFrame();
 
     is(animation.playState, 'running',
        'Opacity script animations keep running even when the target element ' +
        'has "display: none" style');
 
     ok(!animation.isRunningOnCompositor,
        'Opacity script animations on "display:none" element should not ' +
        'run on the compositor');
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'Opacity script animations on "display: none" element should not ' +
        'update styles');
 
     div.style.display = '';
 
     // We need to wait a frame to unapply display:none style.
-    yield waitForFrame();
+    await waitForFrame();
 
     ok(animation.isRunningOnCompositor,
        'Opacity script animations restored from "display: none" should be ' +
        'run on the compositor');
 
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* restyling_for_empty_keyframes() {
+  add_task(async function restyling_for_empty_keyframes() {
     var div = addDiv(null);
     var animation = div.animate({ }, 100 * MS_PER_SEC);
 
-    yield animation.ready;
-    var markers = yield observeStyling(5);
+    await animation.ready;
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Animations with no keyframes should not cause restyles');
 
     animation.effect.setKeyframes({ backgroundColor: ['red', 'blue'] });
-    markers = yield observeStyling(5);
+    markers = await observeStyling(5);
 
     is(markers.length, 5,
        'Setting valid keyframes should cause regular animation restyles to ' +
        'occur');
 
     animation.effect.setKeyframes({ });
-    markers = yield observeStyling(5);
+    markers = await observeStyling(5);
 
     is(markers.length, 1,
        'Setting an empty set of keyframes should trigger a single restyle ' +
        'to remove the previous animated style');
 
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task_if_omta_enabled(function* no_restyling_when_animation_style_when_re_setting_same_animation_property() {
+  add_task_if_omta_enabled(async function no_restyling_when_animation_style_when_re_setting_same_animation_property() {
     var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
-    yield animation.ready;
+    await animation.ready;
     ok(animation.isRunningOnCompositor);
     // Apply the same animation style
     div.style.animation = 'opacity 100s';
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'Applying same animation style '  +
        'should never cause restyles');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* necessary_update_should_be_invoked() {
+  add_task(async function necessary_update_should_be_invoked() {
     var div = addDiv(null, { style: 'animation: background-color 100s' });
     var animation = div.getAnimations()[0];
-    yield animation.ready;
-    yield waitForAnimationFrames(5);
+    await animation.ready;
+    await waitForAnimationFrames(5);
     // Apply another animation style
     div.style.animation = 'background-color 110s';
     var animation = div.getAnimations()[0];
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 5,
        'Applying animation style with different duration '  +
        'should cause restyles on every frame.');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
   add_task_if_omta_enabled(
-    function* changing_cascading_result_for_main_thread_animation() {
+    async function changing_cascading_result_for_main_thread_animation() {
       var div = addDiv(null, { style: 'background-color: blue' });
       var animation = div.animate({ opacity: [0, 1],
                                     backgroundColor: ['green', 'red'] },
                                   100 * MS_PER_SEC);
-      yield animation.ready;
+      await animation.ready;
       ok(animation.isRunningOnCompositor,
          'The opacity animation is running on the compositor');
       // Make the background-color style as !important to cause an update
       // to the cascade.
       // Bug 1300982: The background-color animation should be no longer
       // running on the main thread.
       div.style.setProperty('background-color', '1', 'important');
-      var markers = yield observeStyling(5);
+      var markers = await observeStyling(5);
       todo_is(markers.length, 0,
          'Changing cascading result for the property running on the main ' +
          'thread does not cause synchronization layer of opacity animation ' +
          'running on the compositor');
-      yield ensureElementRemoval(div);
+      await ensureElementRemoval(div);
     }
   );
 
-  add_task(function* restyling_for_animation_on_orphaned_element() {
+  add_task(async function restyling_for_animation_on_orphaned_element() {
     var div = addDiv(null);
     var animation = div.animate({ marginLeft: [ '0px', '100px' ] },
                                 100 * MS_PER_SEC);
 
-    yield animation.ready;
+    await animation.ready;
 
     div.remove();
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'Animation on orphaned element should not cause restyles');
 
     document.body.appendChild(div);
 
-    markers = yield observeStyling(1);
+    markers = await observeStyling(1);
     // We are observing restyles in rAF callback which is processed before
     // restyling process in each frame, so in the first frame there should be
     // no observed restyle since we don't process restyle while the element
     // is not attached to the document.
     is(markers.length, 0,
        'We observe no restyle in the first frame right after re-atatching ' +
        'to the document');
-    markers = yield observeStyling(5);
+    markers = await observeStyling(5);
     is(markers.length, 5,
        'Animation on re-attached to the document begins to update style');
 
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
   add_task_if_omta_enabled(
     // Tests that if we remove an element from the document whose animation
     // cascade needs recalculating, that it is correctly updated when it is
     // re-attached to the document.
-    function* restyling_for_opacity_animation_on_re_attached_element() {
+    async function restyling_for_opacity_animation_on_re_attached_element() {
       var div = addDiv(null, { style: 'opacity: 1 ! important' });
       var animation = div.animate({ opacity: [0, 1] }, 100 * MS_PER_SEC);
 
-      yield animation.ready;
+      await animation.ready;
       ok(!animation.isRunningOnCompositor,
          'The opacity animation overridden by an !important rule is NOT ' +
          'running on the compositor');
 
       // Drop the !important rule to update the cascade.
       div.style.setProperty('opacity', '1', '');
 
       div.remove();
 
-      var markers = yield observeStyling(5);
+      var markers = await observeStyling(5);
       is(markers.length, 0,
          'Opacity animation on orphaned element should not cause restyles');
 
       document.body.appendChild(div);
 
       // Need a frame to give the animation a chance to be sent to the
       // compositor.
-      yield waitForFrame();
+      await waitForFrame();
 
       ok(animation.isRunningOnCompositor,
          'The opacity animation which is no longer overridden by the ' +
          '!important rule begins running on the compositor even if the ' +
          '!important rule had been dropped before the target element was ' +
          'removed');
 
-      yield ensureElementRemoval(div);
+      await ensureElementRemoval(div);
     }
   );
 
   // Tests that additive animations don't throttle at all.
-  add_task(function* no_throttling_animations_out_of_view_element() {
+  add_task(async function no_throttling_animations_out_of_view_element() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling') ||
         !SpecialPowers.getBoolPref('dom.animations-api.core.enabled')) {
       return;
     }
 
     var div = addDiv(null, { style: 'transform: translateY(-400px);' });
     var animation =
       div.animate([{ visibility: 'visible' }], 100 * MS_PER_SEC);
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
 
     is(markers.length, 5,
        'Discrete animation has has no keyframe whose offset is 0 or 1 in an ' +
        'out-of-view element should not be throttled');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
   // Counter part of the above test.
-  add_task(function* no_restyling_discrete_animations_out_of_view_element() {
+  add_task(async function no_restyling_discrete_animations_out_of_view_element() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling') ||
         !SpecialPowers.getBoolPref('dom.animations-api.core.enabled')) {
       return;
     }
 
     var div = addDiv(null, { style: 'transform: translateY(-400px);' });
     var animation =
       div.animate({ visibility: ['visible', 'hidden'] }, 100 * MS_PER_SEC);
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Discrete animation running on the main-thread in an out-of-view ' +
        'element should never cause restyles');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function* no_restyling_while_computed_timing_is_not_changed() {
+  add_task(async function no_restyling_while_computed_timing_is_not_changed() {
     var div = addDiv(null);
     var animation = div.animate({ backgroundColor: [ 'red', 'blue' ] },
                                 { duration: 100 * MS_PER_SEC,
                                   easing: 'step-end' });
 
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Animation running on the main-thread while computed timing is not ' +
        'changed should never cause restyles');
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function *no_throttling_animations_in_view_svg() {
+  add_task(async function no_throttling_animations_in_view_svg() {
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
     if (isAndroid) {
       return;
     }
 
@@ -883,27 +883,27 @@ waitForAllPaints(function() {
                                           width:   '50px',
                                           height:  '50px' });
     var rect = addSVGElement(svg, 'rect', { x:      '-10',
                                             y:      '-10',
                                             width:  '10',
                                             height: '10',
                                             fill:   'red' });
     var animation = rect.animate({ fill: ['blue', 'lime'] }, 100 * MS_PER_SEC);
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 5,
        'CSS animations on an in-view svg element with post-transform should ' +
        'not be throttled.');
 
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function *throttling_animations_out_of_view_svg() {
+  add_task(async function throttling_animations_out_of_view_svg() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
@@ -916,54 +916,54 @@ waitForAllPaints(function() {
     var svg = addSVGElement(div, 'svg', { viewBox: '-10 -10 0.1 0.1',
                                           width: '50px',
                                           height: '50px' });
     var rect = addSVGElement(svg, 'rect', { width: '10',
                                             height: '10',
                                             fill: 'red' });
 
     var animation = rect.animate({ fill: ['blue', 'lime'] }, 100 * MS_PER_SEC);
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'CSS animations on an out-of-view svg element with post-transform ' +
        'should be throttled.');
 
-    yield ensureElementRemoval(div);
+    await ensureElementRemoval(div);
   });
 
-  add_task(function *no_throttling_animations_in_view_css_transform() {
+  add_task(async function no_throttling_animations_in_view_css_transform() {
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
     if (isAndroid) {
       return;
     }
 
     var scrollDiv = addDiv(null, { style: 'overflow: scroll; ' +
                                           'height: 100px; width: 100px;' });
     var targetDiv = addDiv(null,
                            { style: 'animation: background-color 100s;' +
                                     'transform: translate(-50px, -50px);' });
     scrollDiv.appendChild(targetDiv);
 
     var animation = targetDiv.getAnimations()[0];
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 5,
        'CSS animation on an in-view element with pre-transform should not ' +
        'be throttled.');
 
-    yield ensureElementRemoval(scrollDiv);
+    await ensureElementRemoval(scrollDiv);
   });
 
-  add_task(function *throttling_animations_out_of_view_css_transform() {
+  add_task(async function throttling_animations_out_of_view_css_transform() {
     if (!SpecialPowers.getBoolPref('dom.animations.offscreen-throttling')) {
       return;
     }
 
     /*
      On Android throttled animations are left behind on the main thread in some
      frames, We will fix this in bug 1247800.
      */
@@ -974,22 +974,22 @@ waitForAllPaints(function() {
     var scrollDiv = addDiv(null, { style: 'overflow: scroll;' +
                                           'height: 100px; width: 100px;' });
     var targetDiv = addDiv(null,
                            { style: 'animation: background-color 100s;' +
                                     'transform: translate(100px, 100px);' });
     scrollDiv.appendChild(targetDiv);
 
     var animation = targetDiv.getAnimations()[0];
-    yield animation.ready;
+    await animation.ready;
 
-    var markers = yield observeStyling(5);
+    var markers = await observeStyling(5);
     is(markers.length, 0,
        'CSS animation on an out-of-view element with pre-transform should be ' +
        'throttled.');
 
-    yield ensureElementRemoval(scrollDiv);
+    await ensureElementRemoval(scrollDiv);
   });
 
 });
 
 </script>
 </body>
--- a/dom/base/test/browser_bug1011748.js
+++ b/dom/base/test/browser_bug1011748.js
@@ -1,27 +1,27 @@
 const gHttpTestRoot = "http://example.com/browser/dom/base/test/";
 
-add_task(function* () {
+add_task(async function() {
   var statusTexts = [];
   var xhr = new XMLHttpRequest();
   var observer = {
     observe: function (aSubject, aTopic, aData) {
       try {
         var channel = aSubject.QueryInterface(Ci.nsIHttpChannel);
         channel.getResponseHeader("Location");
       } catch (e) {
         return;
       }
       statusTexts.push(xhr.statusText);
     }
   };
   
   Services.obs.addObserver(observer, "http-on-examine-response");
-  yield new Promise((resolve) => {
+  await new Promise((resolve) => {
     xhr.addEventListener("load", function() {
       statusTexts.push(this.statusText);
       is(statusTexts[0], "", "Empty statusText value for HTTP 302");
       is(statusTexts[1], "OK", "OK statusText value for the redirect.");
       resolve();
     });
     xhr.open("GET", gHttpTestRoot+ "file_bug1011748_redirect.sjs", true);
     xhr.send();
--- a/dom/base/test/browser_bug1058164.js
+++ b/dom/base/test/browser_bug1058164.js
@@ -52,57 +52,57 @@ function prepareForVisibilityEvents(brow
   });
 }
 
 /**
  * Tests that frame scripts get pageshow / pagehide events when
  * swapping browser frameloaders (which occurs when moving a tab
  * into a different window).
  */
-add_task(function* test_swap_frameloader_pagevisibility_events() {
+add_task(async function test_swap_frameloader_pagevisibility_events() {
   // Load a new tab that we'll tear out...
   let tab = BrowserTestUtils.addTab(gBrowser, PAGE);
   gBrowser.selectedTab = tab;
   let firstBrowser = tab.linkedBrowser;
-  yield BrowserTestUtils.browserLoaded(firstBrowser);
+  await BrowserTestUtils.browserLoaded(firstBrowser);
 
   // Swap the browser out to a new window
   let newWindow = gBrowser.replaceTabWithWindow(tab);
 
   // We have to wait for the window to load so we can get the selected browser
   // to listen to.
-  yield BrowserTestUtils.waitForEvent(newWindow, "load");
+  await BrowserTestUtils.waitForEvent(newWindow, "load");
   let newWindowBrowser = newWindow.gBrowser.selectedBrowser;
 
   // Wait for the expected pagehide and pageshow events on the initial browser
-  yield prepareForVisibilityEvents(newWindowBrowser, ["pagehide", "pageshow"]);
+  await prepareForVisibilityEvents(newWindowBrowser, ["pagehide", "pageshow"]);
 
   // Now let's send the browser back to the original window
 
   // First, create a new, empty browser tab to replace the window with
   let newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   let emptyBrowser = newTab.linkedBrowser;
 
   // Wait for that initial browser to show its pageshow event so that we
   // don't confuse it with the other expected events. Note that we can't
   // use BrowserTestUtils.waitForEvent here because we're using the
   // e10s add-on shims in the e10s-case. I'm doing this because I couldn't
   // find a way of sending down a frame script to the newly opened windows
   // and tabs fast enough to attach the event handlers before they were
   // fired.
-  yield new Promise((resolve) => {
+  await new Promise((resolve) => {
     emptyBrowser.addEventListener("pageshow", function() {
       resolve();
     }, {once: true});
   });
 
   // The empty tab we just added show now fire a pagehide as its replaced,
   // and a pageshow once the swap is finished.
   let emptyBrowserPromise =
     prepareForVisibilityEvents(emptyBrowser, ["pagehide", "pageshow"]);
 
   gBrowser.swapBrowsersAndCloseOther(newTab, newWindow.gBrowser.selectedTab);
 
-  yield emptyBrowserPromise;
+  await emptyBrowserPromise;
 
   gBrowser.removeTab(gBrowser.selectedTab);
 });
--- a/dom/base/test/browser_bug1303838.js
+++ b/dom/base/test/browser_bug1303838.js
@@ -10,106 +10,106 @@
  * browser would switch to the existing target tab opened by previous
  * link click if loadDivertedInBackground is set to true.
  */
 
 "use strict";
 
 const BASE_URL = "http://mochi.test:8888/browser/dom/base/test/";
 
-add_task(function*() {
-  yield* testLinkClick(false, false);
-  yield* testLinkClick(false, true);
-  yield* testLinkClick(true, false);
-  yield* testLinkClick(true, true);
+add_task(async function() {
+  await testLinkClick(false, false);
+  await testLinkClick(false, true);
+  await testLinkClick(true, false);
+  await testLinkClick(true, true);
 });
 
-function* testLinkClick(withFrame, loadDivertedInBackground) {
-  yield SpecialPowers.pushPrefEnv({"set": [["browser.tabs.loadDivertedInBackground", loadDivertedInBackground]]});
+async function testLinkClick(withFrame, loadDivertedInBackground) {
+  await SpecialPowers.pushPrefEnv({"set": [["browser.tabs.loadDivertedInBackground", loadDivertedInBackground]]});
 
-  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser,
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
     BASE_URL + (withFrame ? "file_bug1303838_with_iframe.html" : "file_bug1303838.html"));
   is(gBrowser.tabs.length, 2, "check tabs.length");
   is(gBrowser.selectedTab, tab, "check selectedTab");
 
   info("Test normal links with loadDivertedInBackground=" + loadDivertedInBackground + ", withFrame=" + withFrame);
 
-  let [testTab] = yield clickLink(withFrame, "#link-1", tab.linkedBrowser);
+  let [testTab] = await clickLink(withFrame, "#link-1", tab.linkedBrowser);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#link-2", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#link-2", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#link-3", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#link-3", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#link-4", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground, 2);
+  await clickLink(withFrame, "#link-4", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground, 2);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   info("Test anchor links with loadDivertedInBackground=" + loadDivertedInBackground + ", withFrame=" + withFrame);
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#anchor-link-1", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#anchor-link-1", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#anchor-link-2", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#anchor-link-2", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#anchor-link-3", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#anchor-link-3", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   info("Test iframe links with loadDivertedInBackground=" + loadDivertedInBackground + ", withFrame=" + withFrame);
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#frame-link-1", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#frame-link-1", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#frame-link-2", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#frame-link-2", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
   if (!loadDivertedInBackground) {
-    yield BrowserTestUtils.switchTab(gBrowser, tab);
+    await BrowserTestUtils.switchTab(gBrowser, tab);
   }
-  yield clickLink(withFrame, "#frame-link-3", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
+  await clickLink(withFrame, "#frame-link-3", tab.linkedBrowser, testTab.linkedBrowser, !loadDivertedInBackground);
   is(gBrowser.tabs.length, 3, "check tabs.length");
   is(gBrowser.selectedTab, loadDivertedInBackground ? tab : testTab, "check selectedTab");
 
-  yield BrowserTestUtils.removeTab(testTab);
-  yield BrowserTestUtils.removeTab(tab);
+  await BrowserTestUtils.removeTab(testTab);
+  await BrowserTestUtils.removeTab(tab);
 }
 
 function clickLink(isFrame, linkId, browser, testBrowser, awaitTabSwitch = false, locationChangeNum = 1) {
   let promises = [];
   if (awaitTabSwitch) {
     promises.push(waitForTabSwitch(gBrowser));
   }
   promises.push(testBrowser ?
--- a/dom/base/test/browser_bug593387.js
+++ b/dom/base/test/browser_bug593387.js
@@ -1,28 +1,28 @@
 /*
  * Test for bug 593387
  * Loads a chrome document in a content docshell and then inserts a
  * X-Frame-Options: DENY iframe into the document and verifies that the document
  * loads. The policy we are enforcing is outlined here:
  * https://bugzilla.mozilla.org/show_bug.cgi?id=593387#c17
 */
 
-add_task(function* test() {
-  yield BrowserTestUtils.withNewTab({ gBrowser,
+add_task(async function test() {
+  await BrowserTestUtils.withNewTab({ gBrowser,
                                       url: "chrome://global/content/mozilla.xhtml" },
-                                     function* (newBrowser) {
+                                     async function(newBrowser) {
     // NB: We load the chrome:// page in the parent process.
-    yield testXFOFrameInChrome(newBrowser);
+    await testXFOFrameInChrome(newBrowser);
 
     // Run next test (try the same with a content top-level context)
-    yield BrowserTestUtils.loadURI(newBrowser, "http://example.com/");
-    yield BrowserTestUtils.browserLoaded(newBrowser);
+    await BrowserTestUtils.loadURI(newBrowser, "http://example.com/");
+    await BrowserTestUtils.browserLoaded(newBrowser);
 
-    yield ContentTask.spawn(newBrowser, null, testXFOFrameInContent);
+    await ContentTask.spawn(newBrowser, null, testXFOFrameInContent);
   });
 });
 
 function testXFOFrameInChrome(newBrowser) {
   // Insert an iframe that specifies "X-Frame-Options: DENY" and verify
   // that it loads, since the top context is chrome
   var deferred = {};
   deferred.promise = new Promise((resolve) => {
--- a/dom/base/test/browser_force_process_selector.js
+++ b/dom/base/test/browser_force_process_selector.js
@@ -2,33 +2,33 @@
 
 const CONTENT_CREATED = "ipc:content-created";
 
 // Make sure that BTU.withNewTab({ ..., forceNewProcess: true }) loads
 // new tabs in their own process.
 async function spawnNewAndTest(recur, pids) {
   let processCreated = TestUtils.topicObserved(CONTENT_CREATED);
   await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank", forceNewProcess: true },
-                                    function* (browser) {
+                                    async function(browser) {
       // Make sure our new browser is in its own process. The processCreated
       // promise should have already resolved by this point.
-      yield processCreated;
+      await processCreated;
       let newPid = browser.frameLoader.tabParent.osPid;
       ok(!pids.has(newPid), "new tab is in its own process");
       pids.add(newPid);
 
       if (recur) {
-        yield spawnNewAndTest(recur - 1, pids);
+        await spawnNewAndTest(recur - 1, pids);
       } else {
         let observer = () => {
           ok(false, "shouldn't have created a new process");
         };
         Services.obs.addObserver(observer, CONTENT_CREATED);
 
-        yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (browser) {
+        await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function(browser) {
           // If this new tab caused us to create a new process, the ok(false)
           // should have already happened. Therefore, if we get here, we've
           // passed. Simply remove the observer.
           Services.obs.removeObserver(observer, CONTENT_CREATED);
         });
       }
   });
 }
--- a/dom/base/test/browser_inputStream_structuredClone.js
+++ b/dom/base/test/browser_inputStream_structuredClone.js
@@ -2,55 +2,55 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const { classes: Cc, interfaces: Ci } = Components;
 const URIs = [
   "about:about",
   "http://example.com/browser/dom/base/test/empty.html"
 ];
 
-function* runTest(input, url) {
+async function runTest(input, url) {
   let tab = BrowserTestUtils.addTab(gBrowser, url);
   let browser = gBrowser.getBrowserForTab(tab);
 
-  yield BrowserTestUtils.browserLoaded(browser);
+  await BrowserTestUtils.browserLoaded(browser);
 
   let stream = Cc['@mozilla.org/io/string-input-stream;1']
                .createInstance(Ci.nsIStringInputStream);
   stream.setData(input, input.length);
 
   let data = {
     inputStream: stream
   };
 
   is(data.inputStream.available(), input.length, "The length of the inputStream matches: " + input.length);
 
-  let dataBack = yield ContentTask.spawn(browser, data, function(data) {
+  let dataBack = await ContentTask.spawn(browser, data, function(data) {
     let dataBack = {
       inputStream: data.inputStream,
       check: true,
     };
 
     if (content.location.href.startsWith('about:')) {
       dataBack.check = data.inputStream instanceof content.Components.interfaces.nsIInputStream;
     }
 
     return dataBack;
   });
 
   ok(dataBack.check, "The inputStream is a nsIInputStream also on content.");
   ok(data.inputStream instanceof Ci.nsIInputStream, "The original object was an inputStream");
   ok(dataBack.inputStream instanceof Ci.nsIInputStream, "We have an inputStream back from the content.");
 
-  yield BrowserTestUtils.removeTab(tab);
+  await BrowserTestUtils.removeTab(tab);
 }
 
-add_task(function* test() {
+add_task(async function test() {
   let a = "a";
   for (let i = 0; i < 25; ++i) {
     a+=a;
   }
 
   for (let i = 0; i < URIs.length; ++i) {
-    yield runTest("Hello world", URIs[i]);
-    yield runTest(a, URIs[i]);
+    await runTest("Hello world", URIs[i]);
+    await runTest(a, URIs[i]);
   }
 });
--- a/dom/base/test/browser_messagemanager_loadprocessscript.js
+++ b/dom/base/test/browser_messagemanager_loadprocessscript.js
@@ -26,85 +26,85 @@ function initTestScript() {
     dump("Initial data incorrect\n");
     return;
   }
 
   sendAsyncMessage("ProcessTest:InitGood", init.test456.get("hi"));
 }
 var initTestScriptURL = "data:,(" + initTestScript.toString() + ")()";
 
-var checkProcess = Task.async(function*(mm) {
-  let { target } = yield promiseMessage(mm, "ProcessTest:Loaded");
+var checkProcess = async function(mm) {
+  let { target } = await promiseMessage(mm, "ProcessTest:Loaded");
   target.sendAsyncMessage("ProcessTest:Reply");
-  yield promiseMessage(target, "ProcessTest:Finished");
+  await promiseMessage(target, "ProcessTest:Finished");
   ok(true, "Saw process finished");
-});
+};
 
 function promiseMessage(messageManager, message) {
   return new Promise(resolve => {
     let listener = (msg) => {
       messageManager.removeMessageListener(message, listener);
       resolve(msg);
     };
 
     messageManager.addMessageListener(message, listener);
   })
 }
 
-add_task(function*(){
+add_task(async function(){
   // We want to count processes in this test, so let's disable the pre-allocated process manager.
-  yield SpecialPowers.pushPrefEnv({"set": [
+  await SpecialPowers.pushPrefEnv({"set": [
     ["dom.ipc.processPrelaunch.enabled", false],
   ]});
 })
 
-add_task(function*(){
+add_task(async function(){
   // This test is only relevant in e10s.
   if (!gMultiProcessBrowser)
     return;
 
   ppmm.releaseCachedProcesses();
 
-  yield SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", 5]]})
-  yield SpecialPowers.pushPrefEnv({"set": [["dom.ipc.keepProcessesAlive.web", 5]]})
+  await SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", 5]]})
+  await SpecialPowers.pushPrefEnv({"set": [["dom.ipc.keepProcessesAlive.web", 5]]})
 
   let tabs = [];
   for (let i = 0; i < 3; i++) {
-    tabs[i] = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
+    tabs[i] = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
   }
 
   for (let i = 0; i < 3; i++) {
-    yield BrowserTestUtils.removeTab(tabs[i]);
+    await BrowserTestUtils.removeTab(tabs[i]);
   }
 
   ppmm.releaseCachedProcesses();
   is(ppmm.childCount, 3, "Should get back to 3 processes at this point.");
 })
 
 // Test that loading a process script loads in all existing processes
-add_task(function*() {
+add_task(async function() {
   let checks = [];
   for (let i = 0; i < ppmm.childCount; i++)
     checks.push(checkProcess(ppmm.getChildAt(i)));
 
   ppmm.loadProcessScript(processScriptURL, false);
-  yield Promise.all(checks);
+  await Promise.all(checks);
 });
 
 // Test that loading a process script loads in new processes
-add_task(function*() {
+add_task(async function() {
   // This test is only relevant in e10s
   if (!gMultiProcessBrowser)
     return;
 
   is(ppmm.childCount, 3, "Should be three processes at this point");
 
   // Load something in the main process
   gBrowser.selectedBrowser.loadURI("about:robots");
-  yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
   let init = ppmm.initialProcessData;
   init.test123 = "hello";
   init.test456 = new Map();
   init.test456.set("hi", "bye");
 
   // With no remote frames left we should be down to one process.
   // However, stuff like remote thumbnails can cause a content
@@ -112,33 +112,33 @@ add_task(function*() {
   // so the test is useful most of the time.
   if (ppmm.childCount == 2) {
     let mainMM = ppmm.getChildAt(0);
 
     let check = checkProcess(ppmm);
     ppmm.loadProcessScript(processScriptURL, true);
 
     // The main process should respond
-    yield check;
+    await check;
 
     check = checkProcess(ppmm);
     // Reset the default browser to start a new child process
     gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true);
     gBrowser.selectedBrowser.loadURI("about:blank");
-    yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
     is(ppmm.childCount, 3, "Should be back to three processes at this point");
 
     // The new process should have responded
-    yield check;
+    await check;
 
     ppmm.removeDelayedProcessScript(processScriptURL);
 
     let childMM;
     childMM = ppmm.getChildAt(2);
 
     childMM.loadProcessScript(initTestScriptURL, false);
-    let msg = yield promiseMessage(childMM, "ProcessTest:InitGood");
+    let msg = await promiseMessage(childMM, "ProcessTest:InitGood");
     is(msg.data, "bye", "initial process data was correct");
   } else {
     info("Unable to finish test entirely");
   }
 });
--- a/dom/base/test/browser_state_notifications.js
+++ b/dom/base/test/browser_state_notifications.js
@@ -7,17 +7,17 @@
 var { interfaces: Ci, classes: Cc, utils: Cu } = Components;
 const { addObserver, removeObserver } = Cc["@mozilla.org/observer-service;1"].
                                           getService(Ci.nsIObserverService);
 const { openWindow } = Cc["@mozilla.org/embedcomp/window-watcher;1"].
                          getService(Ci.nsIWindowWatcher);
 
 const Test = routine => () => {
   waitForExplicitFinish();
-  Task.spawn(routine)
+  (routine)()
       .then(finish, error => {
         ok(false, error);
         finish();
       });
 };
 
 // Returns promise for the observer notification subject for
 // the given topic. If `receive("foo")` is called `n` times
@@ -71,119 +71,119 @@ const isData = document => document.URL.
 
 const uri1 = "data:text/html;charset=utf-8,<h1>1</h1>";
 // For whatever reason going back on load event doesn't work so timeout it is :(
 const uri2 = "data:text/html;charset=utf-8,<h1>2</h1><script>setTimeout(SpecialPowers.wrap(window).back,100)</script>";
 const uri3 = "data:text/html;charset=utf-8,<h1>3</h1>";
 
 const uri4 = "chrome://browser/content/license.html";
 
-const test = Test(function*() {
+const test = Test(async function() {
   let documentInteractive = receive("content-document-interactive", isData, d => {
     // This test is executed synchronously when the event is received.
     is(d.readyState, "interactive", "document is interactive");
     is(d.URL, uri1, "document.URL matches tab url");
   });
   let documentLoaded = receive("content-document-loaded", isData);
   let pageShown = receive("content-page-shown", isData);
 
   info("open: uri#1");
   const tab1 = openTab(uri1);
   const browser1 = gBrowser.getBrowserForTab(tab1);
 
-  let interactiveDocument1 = yield documentInteractive;
+  let interactiveDocument1 = await documentInteractive;
 
-  let loadedDocument1 = yield documentLoaded;
+  let loadedDocument1 = await documentLoaded;
   is(loadedDocument1.readyState, "complete", "document is loaded");
   is(interactiveDocument1, loadedDocument1, "interactive document is loaded");
 
-  let shownPage = yield pageShown;
+  let shownPage = await pageShown;
   is(interactiveDocument1, shownPage, "loaded document is shown");
 
   // Wait until history entry is created before loading new uri.
-  yield receive("sessionstore-state-write-complete");
+  await receive("sessionstore-state-write-complete");
 
   info("load uri#2");
 
   documentInteractive = receive("content-document-interactive", isData, d => {
     // This test is executed synchronously when the event is received.
     is(d.readyState, "interactive", "document is interactive");
     is(d.URL, uri2, "document.URL matches URL loaded");
   });
   documentLoaded = receive("content-document-loaded", isData);
   pageShown = receive("content-page-shown", isData);
   let pageHidden = receive("content-page-hidden", isData);
 
   browser1.loadURI(uri2);
 
-  let hiddenPage = yield pageHidden;
+  let hiddenPage = await pageHidden;
   is(interactiveDocument1, hiddenPage, "loaded document is hidden");
 
-  let interactiveDocument2 = yield documentInteractive;
+  let interactiveDocument2 = await documentInteractive;
 
-  let loadedDocument2 = yield documentLoaded;
+  let loadedDocument2 = await documentLoaded;
   is(loadedDocument2.readyState, "complete", "document is loaded");
   is(interactiveDocument2, loadedDocument2, "interactive document is loaded");
 
-  shownPage = yield pageShown;
+  shownPage = await pageShown;
   is(interactiveDocument2, shownPage, "loaded document is shown");
 
   info("go back to uri#1");
 
 
   documentInteractive = receive("content-document-interactive", isData, d => {
     // This test is executed synchronously when the event is received.
     is(d.readyState, "interactive", "document is interactive");
     is(d.URL, uri3, "document.URL matches URL loaded");
   });
   documentLoaded = receive("content-document-loaded", isData);
   pageShown = receive("content-page-shown", isData);
   pageHidden = receive("content-page-hidden", isData);
 
-  hiddenPage = yield pageHidden;
+  hiddenPage = await pageHidden;
   is(interactiveDocument2, hiddenPage, "new document is hidden");
 
-  shownPage = yield pageShown;
+  shownPage = await pageShown;
   is(interactiveDocument1, shownPage, "previous document is shown");
 
   info("load uri#3");
 
   browser1.loadURI(uri3);
 
   pageShown = receive("content-page-shown", isData);
 
-  let interactiveDocument3 = yield documentInteractive;
+  let interactiveDocument3 = await documentInteractive;
 
-  let loadedDocument3 = yield documentLoaded;
+  let loadedDocument3 = await documentLoaded;
   is(loadedDocument3.readyState, "complete", "document is loaded");
   is(interactiveDocument3, loadedDocument3, "interactive document is loaded");
 
-  shownPage = yield pageShown;
+  shownPage = await pageShown;
   is(interactiveDocument3, shownPage, "previous document is shown");
 
   gBrowser.removeTab(tab1);
 
   info("load chrome uri");
 
   const tab2 = openTab(uri4);
   documentInteractive = receive("chrome-document-interactive", null, d => {
     // This test is executed synchronously when the event is received.
     is(d.readyState, "interactive", "document is interactive");
     is(d.URL, uri4, "document.URL matches URL loaded");
   });
   documentLoaded = receive("chrome-document-loaded");
   pageShown = receive("chrome-page-shown");
 
-  const interactiveDocument4 = yield documentInteractive;
+  const interactiveDocument4 = await documentInteractive;
 
-  let loadedDocument4 = yield documentLoaded;
+  let loadedDocument4 = await documentLoaded;
   is(loadedDocument4.readyState, "complete", "document is loaded");
   is(interactiveDocument4, loadedDocument4, "interactive document is loaded");
 
-  shownPage = yield pageShown;
+  shownPage = await pageShown;
   is(interactiveDocument4, shownPage, "loaded chrome document is shown");
 
   pageHidden = receive("chrome-page-hidden");
   gBrowser.removeTab(tab2);
 
-  hiddenPage = yield pageHidden;
+  hiddenPage = await pageHidden;
   is(interactiveDocument4, hiddenPage, "chrome document hidden");
 });
--- a/dom/base/test/browser_timeout_throttling_with_audio_playback.js
+++ b/dom/base/test/browser_timeout_throttling_with_audio_playback.js
@@ -21,47 +21,47 @@ var testURLs = [
 // sanity the test condition ensures that the observed timeout delay falls in
 // this range.
 const kMinTimeoutBackground = 100 * 1000 * 1000;
 
 const kDelay = 10;
 
 Services.scriptloader.loadSubScript(kPluginJS, this);
 
-function* runTest(url) {
+async function runTest(url) {
   let currentTab = gBrowser.selectedTab;
-  let newTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, kBaseURI);
+  let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, kBaseURI);
   let newBrowser = gBrowser.getBrowserForTab(newTab);
 
   // Wait for the UI to indicate that audio is being played back.
   let promise = BrowserTestUtils.waitForAttribute("soundplaying", newTab, "true");
   newBrowser.loadURI(url);
-  yield promise;
+  await promise;
 
   // Put the tab in the background.
-  yield BrowserTestUtils.switchTab(gBrowser, currentTab);
+  await BrowserTestUtils.switchTab(gBrowser, currentTab);
 
-  let timeout = yield ContentTask.spawn(newBrowser, kDelay, function(delay) {
+  let timeout = await ContentTask.spawn(newBrowser, kDelay, function(delay) {
     return new Promise(resolve => {
       let before = new Date();
       content.window.setTimeout(function() {
         let after = new Date();
         resolve(after - before);
       }, delay);
     });
   });
   ok(timeout <= kMinTimeoutBackground, `Got the correct timeout (${timeout})`);
 
   // All done.
-  yield BrowserTestUtils.removeTab(newTab);
+  await BrowserTestUtils.removeTab(newTab);
 }
 
-add_task(function* setup() {
-  yield SpecialPowers.pushPrefEnv({"set": [
+add_task(async function setup() {
+  await SpecialPowers.pushPrefEnv({"set": [
     ["dom.min_background_timeout_value", kMinTimeoutBackground],
   ]});
 });
 
-add_task(function* test() {
+add_task(async function test() {
   for (var url of testURLs) {
-    yield runTest(url);
+    await runTest(url);
   }
 });
--- a/dom/base/test/browser_use_counters.js
+++ b/dom/base/test/browser_use_counters.js
@@ -7,102 +7,102 @@ Cu.import("resource://gre/modules/Servic
 
 const gHttpTestRoot = "http://example.com/browser/dom/base/test/";
 
 /**
  * Enable local telemetry recording for the duration of the tests.
  */
 var gOldContentCanRecord = false;
 var gOldParentCanRecord = false;
-add_task(function* test_initialize() {
+add_task(async function test_initialize() {
   let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
   gOldParentCanRecord = Telemetry.canRecordExtended
   Telemetry.canRecordExtended = true;
 
   // Because canRecordExtended is a per-process variable, we need to make sure
   // that all of the pages load in the same content process. Limit the number
   // of content processes to at most 1 (or 0 if e10s is off entirely).
-  yield SpecialPowers.pushPrefEnv({ set: [[ "dom.ipc.processCount", 1 ]] });
+  await SpecialPowers.pushPrefEnv({ set: [[ "dom.ipc.processCount", 1 ]] });
 
-  gOldContentCanRecord = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
+  gOldContentCanRecord = await ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
     let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
     let old = telemetry.canRecordExtended;
     telemetry.canRecordExtended = true;
     return old;
   });
   info("canRecord for content: " + gOldContentCanRecord);
 });
 
-add_task(function* () {
+add_task(async function() {
   // Check that use counters are incremented by SVGs loaded directly in iframes.
-  yield check_use_counter_iframe("file_use_counter_svg_getElementById.svg",
+  await check_use_counter_iframe("file_use_counter_svg_getElementById.svg",
                                  "SVGSVGELEMENT_GETELEMENTBYID");
-  yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
+  await check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
                                  "SVGSVGELEMENT_CURRENTSCALE_getter");
-  yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
+  await check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
                                  "SVGSVGELEMENT_CURRENTSCALE_setter");
 
   // Check that even loads from the imglib cache update use counters.  The
   // images should still be there, because we just loaded them in the last
   // set of tests.  But we won't get updated counts for the document
   // counters, because we won't be re-parsing the SVG documents.
-  yield check_use_counter_iframe("file_use_counter_svg_getElementById.svg",
+  await check_use_counter_iframe("file_use_counter_svg_getElementById.svg",
                                  "SVGSVGELEMENT_GETELEMENTBYID", false);
-  yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
+  await check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
                                  "SVGSVGELEMENT_CURRENTSCALE_getter", false);
-  yield check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
+  await check_use_counter_iframe("file_use_counter_svg_currentScale.svg",
                                  "SVGSVGELEMENT_CURRENTSCALE_setter", false);
 
   // Check that use counters are incremented by SVGs loaded as images.
   // Note that SVG images are not permitted to execute script, so we can only
   // check for properties here.
-  yield check_use_counter_img("file_use_counter_svg_getElementById.svg",
+  await check_use_counter_img("file_use_counter_svg_getElementById.svg",
                               "PROPERTY_FILL");
-  yield check_use_counter_img("file_use_counter_svg_currentScale.svg",
+  await check_use_counter_img("file_use_counter_svg_currentScale.svg",
                               "PROPERTY_FILL");
 
   // Check that use counters are incremented by directly loading SVGs
   // that reference patterns defined in another SVG file.
-  yield check_use_counter_direct("file_use_counter_svg_fill_pattern.svg",
+  await check_use_counter_direct("file_use_counter_svg_fill_pattern.svg",
                                  "PROPERTY_FILLOPACITY", /*xfail=*/true);
 
   // Check that use counters are incremented by directly loading SVGs
   // that reference patterns defined in the same file or in data: URLs.
-  yield check_use_counter_direct("file_use_counter_svg_fill_pattern_internal.svg",
+  await check_use_counter_direct("file_use_counter_svg_fill_pattern_internal.svg",
                                  "PROPERTY_FILLOPACITY");
   // data: URLs don't correctly propagate to their referring document yet.
   //yield check_use_counter_direct("file_use_counter_svg_fill_pattern_data.svg",
   //                               "PROPERTY_FILL_OPACITY");
 });
 
-add_task(function* () {
+add_task(async function() {
   let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
   Telemetry.canRecordExtended = gOldParentCanRecord;
 
-  yield ContentTask.spawn(gBrowser.selectedBrowser, { oldCanRecord: gOldContentCanRecord }, function* (arg) {
+  await ContentTask.spawn(gBrowser.selectedBrowser, { oldCanRecord: gOldContentCanRecord }, async function(arg) {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
-    yield new Promise(resolve => {
+    await new Promise(resolve => {
       let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
       telemetry.canRecordExtended = arg.oldCanRecord;
       resolve();
     });
   });
 });
 
 
 function waitForDestroyedDocuments() {
   let deferred = promise.defer();
   SpecialPowers.exactGC(deferred.resolve);
   return deferred.promise;
 }
 
 function waitForPageLoad(browser) {
-  return ContentTask.spawn(browser, null, function*() {
+  return ContentTask.spawn(browser, null, async function() {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
-    yield new Promise(resolve => {
+    await new Promise(resolve => {
       let listener = () => {
         removeEventListener("load", listener, true);
         resolve();
       }
       addEventListener("load", listener, true);
     });
   });
 }
@@ -197,17 +197,17 @@ var check_use_counter_img = async functi
   let [histogram_page_before, histogram_document_before,
        histogram_docs_before, histogram_toplevel_docs_before] =
       await grabHistogramsFromContent(use_counter_middlefix);
 
   gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
   await waitForPageLoad(gBrowser.selectedBrowser);
 
   // Inject our desired file into the img of the newly-loaded page.
-  await ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, function*(opts) {
+  await ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, async function(opts) {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
     let deferred = PromiseUtils.defer();
 
     let img = content.document.getElementById('display');
     img.src = opts.file;
     let listener = (event) => {
       img.removeEventListener("load", listener, true);
 
@@ -260,19 +260,19 @@ var check_use_counter_direct = async fun
 
   // Hold on to the current values of the telemetry histograms we're
   // interested in.
   let [histogram_page_before, histogram_document_before,
        histogram_docs_before, histogram_toplevel_docs_before] =
       await grabHistogramsFromContent(use_counter_middlefix);
 
   gBrowser.selectedBrowser.loadURI(gHttpTestRoot + file);
-  await ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
+  await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
-    yield new Promise(resolve => {
+    await new Promise(resolve => {
       let listener = () => {
         removeEventListener("load", listener, true);
 
         let wu = content.window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
         wu.forceUseCounterFlush(content.document);
 
         setTimeout(resolve, 0);
       }
--- a/dom/base/test/chrome/window_groupedSHistory.xul
+++ b/dom/base/test/chrome/window_groupedSHistory.xul
@@ -17,17 +17,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   <!-- test code goes here -->
   <script type="application/javascript">
   <![CDATA[
 
   const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
   Cu.import("resource://testing-common/TestUtils.jsm");
   Cu.import("resource://testing-common/ContentTask.jsm");
   Cu.import("resource://testing-common/BrowserTestUtils.jsm");
-  Cu.import("resource://gre/modules/Task.jsm");
   ContentTask.setTestScope(window.opener.wrappedJSObject);
 
   let imports = ['SimpleTest', 'SpecialPowers', 'ok', 'is', 'info'];
   for (let name of imports) {
     window[name] = window.opener.wrappedJSObject[name];
   }
 
   function run() {
@@ -576,17 +575,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     // should be handled after swapping cause frameloader is synchronously
     // swapping on main thread after calling PartialSHistory::OnActive().
     //
     // Therefore both messages should be delivered to browser.messageManager.
     promises.push(BrowserTestUtils.waitForMessage(browser.messageManager,
       'test:content-pagehide', msg => msg.data && (msg.data.title == prevTitle)));
     promises.push(BrowserTestUtils.waitForMessage(browser.messageManager,
       'test:content-pageshow', msg => msg.data && (msg.data.title == nextTitle)));
-    promises.push(Task.spawn(navFn));
+    promises.push((navFn)());
 
     // For swapping remote browsers, we'll also receive Content:LocationChange
     if (browserToSwap && browser.isRemoteBrowser) {
       promises.push(BrowserTestUtils.waitForMessage(browser.messageManager,
         'Content:LocationChange'));
     }
 
     return Promise.all(promises);
--- a/dom/base/test/chrome/window_swapFrameLoaders.xul
+++ b/dom/base/test/chrome/window_swapFrameLoaders.xul
@@ -65,17 +65,17 @@ Test swapFrameLoaders with different fra
             resolve(aArgs);
           }, useCapture);
           break;
         }
       }
     });
   }
 
-  function* addFrame(type, remote, height) {
+  async function addFrame(type, remote, height) {
     let frame = document.createElementNS(NS[type], TAG[type]);
     frame.setAttribute("remote", remote);
     if (remote && type == "xul") {
       frame.setAttribute("style", "-moz-binding: none;");
     }
     if (type == "html") {
       frame.setAttribute("mozbrowser", "true");
       frame.setAttribute("noisolation", "true");
@@ -83,37 +83,37 @@ Test swapFrameLoaders with different fra
     } else if (type == "xul") {
       frame.setAttribute("type", "content");
     }
     let src = `data:text/html,<!doctype html>` +
               `<body style="height:${height}px"/>`;
     frame.setAttribute("src", src);
     document.documentElement.appendChild(frame);
     let mm = frame.frameLoader.messageManager;
-    yield once(mm, "test:load");
+    await once(mm, "test:load");
     return frame;
   }
 
-  add_task(function*() {
-    yield SpecialPowers.pushPrefEnv(
+  add_task(async function() {
+    await SpecialPowers.pushPrefEnv(
       { "set": [["dom.mozBrowserFramesEnabled", true],
                 ["network.disable.ipc.security", true]] });
   });
 
-  add_task(function*() {
+  add_task(async function() {
     for (let scenario of SCENARIOS) {
       let [ typeA, typeB, remote ] = scenario;
       remote = !!remote;
       let heightA = HEIGHTS[0];
       info(`Adding frame A, type ${typeA}, remote ${remote}, height ${heightA}`);
-      let frameA = yield addFrame(typeA, remote, heightA);
+      let frameA = await addFrame(typeA, remote, heightA);
 
       let heightB = HEIGHTS[1];
       info(`Adding frame B, type ${typeB}, remote ${remote}, height ${heightB}`);
-      let frameB = yield addFrame(typeB, remote, heightB);
+      let frameB = await addFrame(typeB, remote, heightB);
 
       let frameScriptFactory = function(name) {
         return `function() {
           addMessageListener("ping", function() {
             sendAsyncMessage("pong", "${name}");
           });
           addMessageListener("check-browser-api", function() {
             let exists = "api" in this;
@@ -139,33 +139,33 @@ Test swapFrameLoaders with different fra
         let mmA = frameA.frameLoader.messageManager;
         let mmB = frameB.frameLoader.messageManager;
 
         let inflightA = once(mmA, "pong");
         let inflightB = once(mmB, "pong");
 
         info("Ping message manager for frame A");
         mmA.sendAsyncMessage("ping");
-        let [ { data: pongA } ] = yield inflightA;
+        let [ { data: pongA } ] = await inflightA;
         is(pongA, "A", "Frame A message manager gets reply A before swap");
 
         info("Ping message manager for frame B");
         mmB.sendAsyncMessage("ping");
-        let [ { data: pongB } ] = yield inflightB;
+        let [ { data: pongB } ] = await inflightB;
         is(pongB, "B", "Frame B message manager gets reply B before swap");
       }
 
       // Check height before swap
       {
         if (frameA.getContentDimensions) {
-          let { height } = yield frameA.getContentDimensions();
+          let { height } = await frameA.getContentDimensions();
           is(height, heightA, "Frame A's content height is 200px before swap");
         }
         if (frameB.getContentDimensions) {
-          let { height } = yield frameB.getContentDimensions();
+          let { height } = await frameB.getContentDimensions();
           is(height, heightB, "Frame B's content height is 400px before swap");
         }
       }
 
       // Ping after swap using message managers acquired before
       {
         let mmA = frameA.frameLoader.messageManager;
         let mmB = frameB.frameLoader.messageManager;
@@ -173,76 +173,76 @@ Test swapFrameLoaders with different fra
         info("swapFrameLoaders");
         frameA.swapFrameLoaders(frameB);
 
         let inflightA = once(mmA, "pong");
         let inflightB = once(mmB, "pong");
 
         info("Ping message manager for frame A");
         mmA.sendAsyncMessage("ping");
-        let [ { data: pongA } ] = yield inflightA;
+        let [ { data: pongA } ] = await inflightA;
         is(pongA, "B", "Frame A message manager acquired before swap gets reply B after swap");
 
         info("Ping message manager for frame B");
         mmB.sendAsyncMessage("ping");
-        let [ { data: pongB } ] = yield inflightB;
+        let [ { data: pongB } ] = await inflightB;
         is(pongB, "A", "Frame B message manager acquired before swap gets reply A after swap");
       }
 
       // Check height after swap
       {
         if (frameA.getContentDimensions) {
-          let { height } = yield frameA.getContentDimensions();
+          let { height } = await frameA.getContentDimensions();
           is(height, heightB, "Frame A's content height is 400px after swap");
         }
         if (frameB.getContentDimensions) {
-          let { height } = yield frameB.getContentDimensions();
+          let { height } = await frameB.getContentDimensions();
           is(height, heightA, "Frame B's content height is 200px after swap");
         }
       }
 
       // Ping after swap using message managers acquired after
       {
         let mmA = frameA.frameLoader.messageManager;
         let mmB = frameB.frameLoader.messageManager;
 
         let inflightA = once(mmA, "pong");
         let inflightB = once(mmB, "pong");
 
         info("Ping message manager for frame A");
         mmA.sendAsyncMessage("ping");
-        let [ { data: pongA } ] = yield inflightA;
+        let [ { data: pongA } ] = await inflightA;
         is(pongA, "B", "Frame A message manager acquired after swap gets reply B after swap");
 
         info("Ping message manager for frame B");
         mmB.sendAsyncMessage("ping");
-        let [ { data: pongB } ] = yield inflightB;
+        let [ { data: pongB } ] = await inflightB;
         is(pongB, "A", "Frame B message manager acquired after swap gets reply A after swap");
       }
 
       // Verify browser API frame scripts destroyed if swapped out of browser frame
       if (frameA.hasAttribute("mozbrowser") != frameB.hasAttribute("mozbrowser")) {
         let mmA = frameA.frameLoader.messageManager;
         let mmB = frameB.frameLoader.messageManager;
 
         let inflightA = once(mmA, "check-browser-api");
         let inflightB = once(mmB, "check-browser-api");
 
         info("Check browser API for frame A");
         mmA.sendAsyncMessage("check-browser-api");
-        let [ { data: apiA } ] = yield inflightA;
+        let [ { data: apiA } ] = await inflightA;
         if (frameA.hasAttribute("mozbrowser")) {
           ok(apiA.exists && apiA.running, "Frame A browser API exists and is running");
         } else {
           ok(apiA.exists && !apiA.running, "Frame A browser API did exist but is now destroyed");
         }
 
         info("Check browser API for frame B");
         mmB.sendAsyncMessage("check-browser-api");
-        let [ { data: apiB } ] = yield inflightB;
+        let [ { data: apiB } ] = await inflightB;
         if (frameB.hasAttribute("mozbrowser")) {
           ok(apiB.exists && apiB.running, "Frame B browser API exists and is running");
         } else {
           ok(apiB.exists && !apiB.running, "Frame B browser API did exist but is now destroyed");
         }
       } else {
         info("Frames have matching mozbrowser state, skipping browser API destruction check");
       }
--- a/dom/base/test/mozbrowser_api_utils.js
+++ b/dom/base/test/mozbrowser_api_utils.js
@@ -42,19 +42,19 @@ function once(target, eventName, useCapt
           }, useCapture);
 	});
         break;
       }
     }
   });
 }
 
-function* loadFrame(attributes = {}) {
+async function loadFrame(attributes = {}) {
   let iframe = document.createElement("iframe");
   iframe.setAttribute("src", FRAME_URL);
   for (let key in attributes) {
     iframe.setAttribute(key, attributes[key]);
   }
   let loaded = once(iframe, [ "load", "mozbrowserloadend" ]);
   document.body.appendChild(iframe);
-  yield loaded;
+  await loaded;
   return iframe;
 }
--- a/dom/base/test/test_blockParsing.html
+++ b/dom/base/test/test_blockParsing.html
@@ -5,17 +5,17 @@
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
   <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css">
 </head>
 <body>
 <script>
 Components.utils.import("resource://testing-common/TestUtils.jsm");
 
-function* runTest(url, initialHTML, finalHTML) {
+async function runTest(url, initialHTML, finalHTML) {
   let iframe = document.createElement("iframe");
   iframe.src = url;
 
   let blockerPromise;
   let promise = TestUtils.topicObserved("document-element-inserted", document => {
     blockerPromise = new Promise(resolve => {
       setTimeout(resolve, 0);
     }).then(() => {
@@ -34,60 +34,60 @@ function* runTest(url, initialHTML, fina
     return true;
   }).then(([document]) => {
     return document;
   });
 
   document.body.appendChild(iframe);
 
   // Wait for document-element-inserted to fire.
-  let doc = yield promise;
+  let doc = await promise;
   let win = doc.defaultView.wrappedJSObject;
   let root = doc.documentElement;
 
   // At this point, if the parser was successfully blocked, we should still
   // have the initial skeleton HTML for the page.
   is(root.outerHTML, initialHTML, "Should have initial HTML after document-element-inserted returns");
   is(win.scriptRan, undefined, "Script node should still not have run");
 
-  yield blockerPromise;
+  await blockerPromise;
 
   // Just after the promise that's blocking the parser fires, we shouldn't have
   // returned to the main event loop, so we should still have the initial HTML.
   is(root.outerHTML, initialHTML, "Should still have initial HTML");
   is(win.scriptRan, undefined, "Script node should still not have run");
 
-  yield new Promise(resolve => win.addEventListener("DOMContentLoaded", resolve, {once: true}));
+  await new Promise(resolve => win.addEventListener("DOMContentLoaded", resolve, {once: true}));
 
   // Parsing should have resumed, and we should have finished loading the document.
   is(root.outerHTML, finalHTML, "Should have final HTML");
   is(win.scriptRan, true, "Script node should have run");
 
   iframe.remove();
 }
 
-add_task(function* () {
-  yield runTest("http://mochi.test:8888/chrome/dom/base/test/file_inline_script.html",
+add_task(async function() {
+  await runTest("http://mochi.test:8888/chrome/dom/base/test/file_inline_script.html",
                 '<html lang="en"></html>',
                 '<html lang="en"><head>\n  <script>window.scriptRan = true;<\/script>\n  <meta charset="utf-8">\n  <title></title>\n</head>\n<body>\n  <p>Hello Mochitest</p>\n\n\n</body></html>');
 
-  yield runTest("http://mochi.test:8888/chrome/dom/base/test/file_inline_script.xhtml",
+  await runTest("http://mochi.test:8888/chrome/dom/base/test/file_inline_script.xhtml",
                 '<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"></html>',
                 '<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">\n<head>\n  <script>window.scriptRan = true;<\/script>\n  <title></title>\n</head>\n<body>\n  <p>Hello Mochitest</p>\n</body>\n</html>');
 
-  yield runTest("http://mochi.test:8888/chrome/dom/base/test/file_external_script.html",
+  await runTest("http://mochi.test:8888/chrome/dom/base/test/file_external_script.html",
                 '<html lang="en"></html>',
                 '<html lang="en"><head>\n  <script src="file_script.js"><\/script>\n  <meta charset="utf-8">\n  <title></title>\n</head>\n<body>\n  <p>Hello Mochitest</p>\n\n\n</body></html>');
 
-  yield runTest("http://mochi.test:8888/chrome/dom/base/test/file_external_script.xhtml",
+  await runTest("http://mochi.test:8888/chrome/dom/base/test/file_external_script.xhtml",
                 '<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"></html>',
                 '<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">\n<head>\n  <script src="file_script.js"><\/script>\n  <title></title>\n</head>\n<body>\n  <p>Hello Mochitest</p>\n</body>\n</html>');
 });
 
-add_task(function* test_cleanup() {
+add_task(async function test_cleanup() {
   const TOPIC = "blocking-promise-destroyed";
 
   const finalizationWitness = Components.classes["@mozilla.org/toolkit/finalizationwitness;1"]
       .getService(Components.interfaces.nsIFinalizationWitnessService);
 
   for (let url of ["http://mochi.test:8888/chrome/dom/base/test/file_inline_script.html",
                    "http://mochi.test:8888/chrome/dom/base/test/file_inline_script.xhtml"]) {
     let iframe = document.createElement("iframe");
@@ -104,28 +104,28 @@ add_task(function* test_cleanup() {
 
     let insertedPromise = TestUtils.topicObserved("document-element-inserted", document => {
       document.blockParsing(blockerPromise).witness = witness;
 
       return true;
     });
 
     document.body.appendChild(iframe);
-    yield insertedPromise;
+    await insertedPromise;
 
     // Clear the promise reference, destroy the document, and force GC/CC. This should
     // trigger any potential leaks or cleanup issues.
     blockerPromise = null;
     witness = null;
     iframe.remove();
 
     Components.utils.forceGC();
     Components.utils.forceCC();
     Components.utils.forceGC();
 
     // Make sure the blocker promise has been collected.
-    let [, data] = yield destroyedPromise;
+    let [, data] = await destroyedPromise;
     is(data, url, "Should have correct finalizer URL");
   }
 });
 </script>
 </body>
 </html>
--- a/dom/base/test/test_bug1281963.html
+++ b/dom/base/test/test_bug1281963.html
@@ -14,27 +14,27 @@ https://bugzilla.mozilla.org/1281963
 <p id="display"></p>
 <div id="content"></div>
 
 <script class="testbody" type="application/javascript">
 
 // __setPref(key, value)__.
 // Set a pref value asynchronously, returning a promise that resolves
 // when it succeeds.
-let setPref = function* (key, value) {
+let setPref = function(key, value) {
   return SpecialPowers.pushPrefEnv({"set": [[key, value]]});
 };
 
 // Run a test to see that we don't expose the supported mimeTypes
 // or installed plugins when "privacy.resistFingerprinting" is active.
-add_task(function* () {
+add_task(async function() {
   let exampleMimeType = undefined,
       examplePlugin = undefined;
   // Disable fingerprinting resistance.
-  yield setPref("privacy.resistFingerprinting", false);
+  await setPref("privacy.resistFingerprinting", false);
   // Depending on the testing platform, we may have at least
   // one mimeType and plugin available.
   exampleMimeType = navigator.mimeTypes[0];
   examplePlugin = navigator.plugins[0];
 
   // First check that we can retrieve mimeType or plugin by name and that
   // the array length is nonzero.
   if (exampleMimeType) {
@@ -42,17 +42,17 @@ add_task(function* () {
     isnot(navigator.mimeTypes.length, 0, "navigator.mimeTypes.length should be nonzero");
   }
   if (examplePlugin) {
     isnot(navigator.plugins[examplePlugin.name], undefined, "Should reveal plugin");
     isnot(navigator.plugins.length, 0, "navigator.plugins.length should be nonzero");
   }
 
   // Now test with fingerprinting resistance enabled
-  yield setPref("privacy.resistFingerprinting", true);
+  await setPref("privacy.resistFingerprinting", true);
   if (exampleMimeType) {
     is(navigator.mimeTypes[exampleMimeType.type], undefined, "Don't reveal mime type");
   }
   is(navigator.mimeTypes[0], undefined, "Don't reveal mime type");
   is(navigator.mimeTypes.length, 0, "navigator.mimeTypes.length should be 0");
   if (examplePlugin) {
     is(navigator.plugins[examplePlugin.name], undefined, "Don't reveal plugin");
   }
--- a/dom/base/test/test_explicit_user_agent.html
+++ b/dom/base/test/test_explicit_user_agent.html
@@ -11,53 +11,53 @@
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script class="testbody" type="application/javascript">
   "use strict";
 
-  add_task(function*() {
-    yield new Promise((r) => {
+  add_task(async function() {
+    await new Promise((r) => {
       let xhr = new XMLHttpRequest();
       xhr.open('GET', 'file_explicit_user_agent.sjs', true);
       xhr.onreadystatechange = function() {
         if (xhr.readyState == 4) {
           is(xhr.getResponseHeader("Result-User-Agent"), navigator.userAgent,
              "The resulting user-agent is the navigator's UA");
           r();
         }
       }
       xhr.send(null);
     });
 
-    yield new Promise((r) => {
+    await new Promise((r) => {
       let xhr = new XMLHttpRequest();
       xhr.open('GET', 'file_explicit_user_agent.sjs', true);
       xhr.setRequestHeader('User-Agent', 'custom-ua/10.0');
       xhr.onreadystatechange = function() {
         if (xhr.readyState == 4) {
           is(xhr.getResponseHeader("Result-User-Agent"), 'custom-ua/10.0',
              "The resulting user-agent is the custom UA");
           r();
         }
       }
       xhr.send(null);
     });
 
-    var response = yield fetch('file_explicit_user_agent.sjs', {
+    var response = await fetch('file_explicit_user_agent.sjs', {
       method: 'GET'
     });
     is(response.headers.get("Result-User-Agent"), navigator.userAgent,
        "The user-agent is the navigator's UA");
 
     var headers = new Headers();
     headers.set('User-Agent', 'custom-ua/20.0');
-    var response2 = yield fetch('file_explicit_user_agent.sjs', {
+    var response2 = await fetch('file_explicit_user_agent.sjs', {
       method: 'GET',
       headers: headers,
     });
     is(response2.headers.get("Result-User-Agent"), 'custom-ua/20.0',
        "The user-agent is the custom UA");
   });
 </script>
 </pre>
--- a/dom/base/test/test_mozbrowser_apis_allowed.html
+++ b/dom/base/test/test_mozbrowser_apis_allowed.html
@@ -5,25 +5,25 @@
   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
   <script type="text/javascript" src="mozbrowser_api_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 </head>
 
 <body>
 <script type="application/javascript">
-  add_task(function*() {
-    yield SpecialPowers.pushPrefEnv(
+  add_task(async function() {
+    await SpecialPowers.pushPrefEnv(
       { "set": [["dom.mozBrowserFramesEnabled", true],
                 ["network.disable.ipc.security", true]] });
   });
 
-  add_task(function*() {
+  add_task(async function() {
     // Create <iframe mozbrowser>
-    let frame = yield loadFrame({
+    let frame = await loadFrame({
       mozbrowser: "true",
       // FIXME: Bug 1270790
       remote: true
     });
 
     // Verify that mozbrowser APIs are accessible
     for (let method in METHODS) {
       let { alwaysFails } = METHODS[method];
--- a/dom/base/test/test_mozbrowser_apis_blocked.html
+++ b/dom/base/test/test_mozbrowser_apis_blocked.html
@@ -5,25 +5,25 @@
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
   <script type="text/javascript" src="mozbrowser_api_utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 
 <body>
 <script type="application/javascript">
-  add_task(function*() {
-    yield SpecialPowers.pushPrefEnv(
+  add_task(async function() {
+    await SpecialPowers.pushPrefEnv(
       { "set": [["dom.mozBrowserFramesEnabled", true],
                 ["network.disable.ipc.security", true]] });
   });
 
-  add_task(function*() {
+  add_task(async function() {
     // Create <iframe mozbrowser>
-    let frame = yield loadFrame({
+    let frame = await loadFrame({
       mozbrowser: "true"
     });
 
     // Verify that mozbrowser APIs are not accessible
     for (let method in METHODS) {
       ok(!(method in frame), `frame does not have method ${method}`);
     }
     for (let attribute of ATTRIBUTES) {
--- a/dom/base/test/test_postMessage_originAttributes.html
+++ b/dom/base/test/test_postMessage_originAttributes.html
@@ -6,32 +6,32 @@
   <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 
 <body>
 <iframe id="target-iframe"></iframe>
 <script type="application/javascript">
 
-add_task(function*() {
-  yield SpecialPowers.pushPrefEnv(
+add_task(async function() {
+  await SpecialPowers.pushPrefEnv(
     { "set": [["network.disable.ipc.security", true]] });
 });
 
-add_task(function*() {
+add_task(async function() {
   let iframe = document.querySelector("#target-iframe");
 
   let win = SpecialPowers.wrap(iframe).contentWindow;
   let docShell = win.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
                     .getInterface(SpecialPowers.Ci.nsIDocShell);
 
   // Add private browsing ID to docShell origin and load document.
   docShell.setOriginAttributes({privateBrowsingId: 1});
 
-  yield new Promise(resolve => {
+  await new Promise(resolve => {
     iframe.addEventListener("load", resolve, true);
 
     iframe.src = SimpleTest.getTestFileURL("file_receiveMessage.html");
   });
 
   // Set up console monitor to wait for warning.
   const expectedMessage = (
     'Attempting to post a message to window with url ' +
@@ -40,20 +40,20 @@ add_task(function*() {
     'principal scope with mismatched origin "[System Principal]".');
 
   let consolePromise = new Promise(resolve => {
     SimpleTest.monitorConsole(resolve, [e => e.message == expectedMessage]);
   });
 
   // Post to the content window via SpecialPowers' system principal scope.
   win.postMessage("Hello. o/", "http://mochi.test:8888");
-  yield new Promise(resolve => setTimeout(resolve, 0));
+  await new Promise(resolve => setTimeout(resolve, 0));
 
   SimpleTest.endMonitorConsole();
-  yield consolePromise;
+  await consolePromise;
 
   // Check that the window received and handled the message.
   is(win.document.body.textContent, "|Hello. o/",
      "Content window received the expected message");
 });
 </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/browser_private_browsing.js
+++ b/dom/broadcastchannel/tests/browser_private_browsing.js
@@ -1,72 +1,72 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const URL = "http://mochi.test:8888/browser/dom/broadcastchannel/tests/blank.html";
 
-add_task(function*() {
+add_task(async function() {
   var win1 = OpenBrowserWindow({private: true});
   var win1Promise = new win1.Promise(resolve => {
     win1.addEventListener("load", function() {
       resolve();
     }, {once: true});
   });
-  yield win1Promise;
+  await win1Promise;
 
   var win2 = OpenBrowserWindow({private: false});
   var win2Promise = new win2.Promise(resolve => {
     win2.addEventListener("load", function() {
       resolve();
     }, {once: true});
   });
-  yield win2Promise;
+  await win2Promise;
 
   var tab1 = win1.gBrowser.addTab(URL);
-  yield BrowserTestUtils.browserLoaded(win1.gBrowser.getBrowserForTab(tab1));
+  await BrowserTestUtils.browserLoaded(win1.gBrowser.getBrowserForTab(tab1));
   var browser1 = gBrowser.getBrowserForTab(tab1);
 
   var tab2 = win2.gBrowser.addTab(URL);
-  yield BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
+  await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
   var browser2 = gBrowser.getBrowserForTab(tab2);
 
   var p1 = ContentTask.spawn(browser1, null, function(opts) {
     return new content.window.Promise(resolve => {
       content.window.bc = new content.window.BroadcastChannel('foobar');
       content.window.bc.onmessage = function(e) { resolve(e.data); }
     });
   });
 
   var p2 = ContentTask.spawn(browser2, null, function(opts) {
     return new content.window.Promise(resolve => {
       content.window.bc = new content.window.BroadcastChannel('foobar');
       content.window.bc.onmessage = function(e) { resolve(e.data); }
     });
   });
 
-  yield ContentTask.spawn(browser1, null, function(opts) {
+  await ContentTask.spawn(browser1, null, function(opts) {
     return new content.window.Promise(resolve => {
       var bc = new content.window.BroadcastChannel('foobar');
       bc.postMessage('hello world from private browsing');
       resolve();
     });
   });
 
-  yield ContentTask.spawn(browser2, null, function(opts) {
+  await ContentTask.spawn(browser2, null, function(opts) {
     return new content.window.Promise(resolve => {
       var bc = new content.window.BroadcastChannel('foobar');
       bc.postMessage('hello world from non private browsing');
       resolve();
     });
   });
 
-  var what1 = yield p1;
+  var what1 = await p1;
   ok(what1, 'hello world from private browsing', 'No messages received from the other window.');
 
-  var what2 = yield p2;
+  var what2 = await p2;
   ok(what1, 'hello world from non private browsing', 'No messages received from the other window.');
 
-  yield BrowserTestUtils.removeTab(tab1);
-  yield BrowserTestUtils.closeWindow(win1);
+  await BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.closeWindow(win1);
 
-  yield BrowserTestUtils.removeTab(tab2);
-  yield BrowserTestUtils.closeWindow(win2);
+  await BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.closeWindow(win2);
 });
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -11,17 +11,16 @@ function debug(msg) {
 debug("loaded");
 
 var BrowserElementIsReady;
 
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu }  = Components;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/BrowserElementPromptService.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "ManifestFinder",
                                   "resource://gre/modules/ManifestFinder.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ManifestObtainer",
                                   "resource://gre/modules/ManifestObtainer.jsm");
 
 
 var kLongestReturnedString = 128;
@@ -1303,36 +1302,36 @@ BrowserElementChild.prototype = {
     let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.stop(webNav.STOP_NETWORK);
   },
 
   _recvZoom: function(data) {
     docShell.contentViewer.fullZoom = data.json.zoom;
   },
 
-  _recvGetWebManifest: Task.async(function* (data) {
+  async _recvGetWebManifest(data) {
     debug(`Received GetWebManifest message: (${data.json.id})`);
     let manifest = null;
     let hasManifest = ManifestFinder.contentHasManifestLink(content);
     if (hasManifest) {
       try {
-        manifest = yield ManifestObtainer.contentObtainManifest(content);
+        manifest = await ManifestObtainer.contentObtainManifest(content);
       } catch (e) {
         sendAsyncMsg('got-web-manifest', {
           id: data.json.id,
           errorMsg: `Error fetching web manifest: ${e}.`,
         });
         return;
       }
     }
     sendAsyncMsg('got-web-manifest', {
       id: data.json.id,
       successRv: manifest
     });
-  }),
+  },
 
   _initFinder: function() {
     if (!this._finder) {
       let {Finder} = Components.utils.import("resource://gre/modules/Finder.jsm", {});
       this._finder = new Finder(docShell);
     }
     let listener = {
       onMatchesCountResult: (data) => {
--- a/dom/browser-element/mochitest/browserElement_getWebManifest.js
+++ b/dom/browser-element/mochitest/browserElement_getWebManifest.js
@@ -4,34 +4,34 @@
 
 // Bug 1169633 - getWebManifest tests
 'use strict';
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 
 // request to load a manifest from a page that doesn't have a manifest.
 // The expected result to be null.
-var test1 = async(function* () {
-  var manifest = yield requestManifest('file_empty.html');
+var test1 = async(async function() {
+  var manifest = await requestManifest('file_empty.html');
   is(manifest, null, 'it should be null.');
 });
 
 // request to load a manifest from a page that has a manifest.
 // The expected manifest to have a property name whose value is 'pass'.
-var test2 = async(function* () {
-  var manifest = yield requestManifest('file_web_manifest.html');
+var test2 = async(async function() {
+  var manifest = await requestManifest('file_web_manifest.html');
   is(manifest && manifest.name, 'pass', 'it should return a manifest with name pass.');
 });
 
 // Cause an exception by attempting to fetch a file URL,
 // expect onerror to be called.
-var test3 = async(function* () {
+var test3 = async(async function() {
   var gotError = false;
   try {
-    yield requestManifest('file_illegal_web_manifest.html');
+    await requestManifest('file_illegal_web_manifest.html');
   } catch (err) {
     gotError = true;
   }
   ok(gotError, 'onerror was called on the DOMRequest.');
 });
 
 // Run the tests
 addEventListener('testready', () => {
--- a/dom/events/test/test_DataTransferItemList.html
+++ b/dom/events/test/test_DataTransferItemList.html
@@ -19,18 +19,18 @@
     // Defer to the event loop twice to wait for any events to be flushed out.
     return new Promise(function(a) {
       SimpleTest.executeSoon(function() {
         SimpleTest.executeSoon(a)
       });
     });
   }
 
-  add_task(function* () {
-    yield spin();
+  add_task(async function() {
+    await spin();
     var draggable = document.getElementById('image');
     var over = document.getElementById('over');
 
     var dragstartFired = 0;
     draggable.addEventListener('dragstart', onDragStart);
     function onDragStart(e) {
       draggable.removeEventListener('dragstart', onDragStart);
 
@@ -196,17 +196,17 @@
         getAsStringCalled++;
         is(s, "this is some text", "Should provide the correct string");
       });
     }
 
     synthesizeDrop(draggable, over, null, null);
 
     // Wait for the getAsString callbacks to complete
-    yield spin();
+    await spin();
     is(getAsStringCalled, 2, "getAsString should be called twice");
 
     // Sanity-check to make sure that the events were actually run
     is(dragstartFired, 1, "dragstart fired");
     is(dragenterFired, 1, "dragenter fired");
     is(dropFired, 1, "drop fired");
   });
 
--- a/dom/file/ipc/tests/browser_ipcBlob.js
+++ b/dom/file/ipc/tests/browser_ipcBlob.js
@@ -2,205 +2,205 @@
 
 requestLongerTimeout(3);
 
 var {Promise: promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
 
 const BASE_URI = "http://mochi.test:8888/browser/dom/file/ipc/tests/empty.html";
 
 // More than 1mb memory blob childA-parent-childB.
-add_task(function* test_CtoPtoC_big() {
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+add_task(async function test_CtoPtoC_big() {
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser1 = gBrowser.getBrowserForTab(tab1);
 
-  let blob = yield ContentTask.spawn(browser1, null, function() {
+  let blob = await ContentTask.spawn(browser1, null, function() {
     let blob = new Blob([new Array(1024*1024).join('123456789ABCDEF')]);
     return blob;
   });
 
   ok(blob, "CtoPtoC-big: We have a blob!");
   is(blob.size, new Array(1024*1024).join('123456789ABCDEF').length, "CtoPtoC-big: The size matches");
 
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser2 = gBrowser.getBrowserForTab(tab2);
 
-  let status = yield ContentTask.spawn(browser2, blob, function(blob) {
+  let status = await ContentTask.spawn(browser2, blob, function(blob) {
     return new Promise(resolve => {
       let fr = new content.FileReader();
       fr.readAsText(blob);
       fr.onloadend = function() {
         resolve(fr.result == new Array(1024*1024).join('123456789ABCDEF'));
       }
     });
   });
 
   ok(status, "CtoPtoC-big: Data match!");
 
-  yield BrowserTestUtils.removeTab(tab1);
-  yield BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab2);
 });
 
 // Less than 1mb memory blob childA-parent-childB.
-add_task(function* test_CtoPtoC_small() {
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+add_task(async function test_CtoPtoC_small() {
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser1 = gBrowser.getBrowserForTab(tab1);
 
-  let blob = yield ContentTask.spawn(browser1, null, function() {
+  let blob = await ContentTask.spawn(browser1, null, function() {
     let blob = new Blob(["hello world!"]);
     return blob;
   });
 
   ok(blob, "CtoPtoC-small: We have a blob!");
   is(blob.size, "hello world!".length, "CtoPtoC-small: The size matches");
 
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser2 = gBrowser.getBrowserForTab(tab2);
 
-  let status = yield ContentTask.spawn(browser2, blob, function(blob) {
+  let status = await ContentTask.spawn(browser2, blob, function(blob) {
     return new Promise(resolve => {
       let fr = new content.FileReader();
       fr.readAsText(blob);
       fr.onloadend = function() {
         resolve(fr.result == "hello world!");
       }
     });
   });
 
   ok(status, "CtoPtoC-small: Data match!");
 
-  yield BrowserTestUtils.removeTab(tab1);
-  yield BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab2);
 });
 
 // More than 1mb memory blob childA-parent-childB: BroadcastChannel
-add_task(function* test_CtoPtoC_bc_big() {
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+add_task(async function test_CtoPtoC_bc_big() {
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser1 = gBrowser.getBrowserForTab(tab1);
 
-  yield ContentTask.spawn(browser1, null, function() {
+  await ContentTask.spawn(browser1, null, function() {
     var bc = new content.BroadcastChannel('test');
     bc.onmessage = function() {
       bc.postMessage(new Blob([new Array(1024*1024).join('123456789ABCDEF')]));
     }
   });
 
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser2 = gBrowser.getBrowserForTab(tab2);
 
-  let status = yield ContentTask.spawn(browser2, null, function() {
+  let status = await ContentTask.spawn(browser2, null, function() {
     return new Promise(resolve => {
       var bc = new content.BroadcastChannel('test');
       bc.onmessage = function(e) {
         let fr = new content.FileReader();
         fr.readAsText(e.data);
         fr.onloadend = function() {
           resolve(fr.result == new Array(1024*1024).join('123456789ABCDEF'));
         }
       }
 
       bc.postMessage("GO!");
     });
   });
 
   ok(status, "CtoPtoC-broadcastChannel-big: Data match!");
 
-  yield BrowserTestUtils.removeTab(tab1);
-  yield BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab2);
 });
 
 // Less than 1mb memory blob childA-parent-childB: BroadcastChannel
-add_task(function* test_CtoPtoC_bc_small() {
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+add_task(async function test_CtoPtoC_bc_small() {
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser1 = gBrowser.getBrowserForTab(tab1);
 
-  yield ContentTask.spawn(browser1, null, function() {
+  await ContentTask.spawn(browser1, null, function() {
     var bc = new content.BroadcastChannel('test');
     bc.onmessage = function() {
       bc.postMessage(new Blob(["hello world!"]));
     }
   });
 
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser2 = gBrowser.getBrowserForTab(tab2);
 
-  let status = yield ContentTask.spawn(browser2, null, function() {
+  let status = await ContentTask.spawn(browser2, null, function() {
     return new Promise(resolve => {
       var bc = new content.BroadcastChannel('test');
       bc.onmessage = function(e) {
         let fr = new content.FileReader();
         fr.readAsText(e.data);
         fr.onloadend = function() {
           resolve(fr.result == "hello world!");
         }
       }
 
       bc.postMessage("GO!");
     });
   });
 
   ok(status, "CtoPtoC-broadcastChannel-small: Data match!");
 
-  yield BrowserTestUtils.removeTab(tab1);
-  yield BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab2);
 });
 
 // blob URL childA-parent-childB
-add_task(function* test_CtoPtoC_bc_small() {
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+add_task(async function test_CtoPtoC_bc_small() {
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser1 = gBrowser.getBrowserForTab(tab1);
 
-  let blobURL = yield ContentTask.spawn(browser1, null, function() {
+  let blobURL = await ContentTask.spawn(browser1, null, function() {
     return content.URL.createObjectURL(new content.Blob(["hello world!"]));
   });
 
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser2 = gBrowser.getBrowserForTab(tab2);
 
-  let status = yield ContentTask.spawn(browser2, blobURL, function(blobURL) {
+  let status = await ContentTask.spawn(browser2, blobURL, function(blobURL) {
     return new Promise(resolve => {
       var xhr = new content.XMLHttpRequest();
       xhr.open("GET", blobURL);
       xhr.onloadend = function() {
         resolve(xhr.response == "hello world!");
       }
 
       xhr.send();
     });
   });
 
   ok(status, "CtoPtoC-blobURL: Data match!");
 
-  yield BrowserTestUtils.removeTab(tab1);
-  yield BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab2);
 });
 
 // Multipart Blob childA-parent-childB.
-add_task(function* test_CtoPtoC_multipart() {
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+add_task(async function test_CtoPtoC_multipart() {
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser1 = gBrowser.getBrowserForTab(tab1);
 
-  let blob = yield ContentTask.spawn(browser1, null, function() {
+  let blob = await ContentTask.spawn(browser1, null, function() {
     return new Blob(["!"]);
   });
 
   ok(blob, "CtoPtoC-,ultipart: We have a blob!");
   is(blob.size, "!".length, "CtoPtoC-multipart: The size matches");
 
   let newBlob = new Blob(["world", blob]);
 
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, BASE_URI);
   let browser2 = gBrowser.getBrowserForTab(tab2);
 
-  let status = yield ContentTask.spawn(browser2, newBlob, function(blob) {
+  let status = await ContentTask.spawn(browser2, newBlob, function(blob) {
     return new Promise(resolve => {
       let fr = new content.FileReader();
       fr.readAsText(new Blob(["hello ", blob]));
       fr.onloadend = function() {
         resolve(fr.result == "hello world!");
       }
     });
   });
 
   ok(status, "CtoPtoC-multipart: Data match!");
 
-  yield BrowserTestUtils.removeTab(tab1);
-  yield BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab2);
 });
--- a/dom/html/test/browser_DOMDocElementInserted.js
+++ b/dom/html/test/browser_DOMDocElementInserted.js
@@ -1,10 +1,10 @@
 // Tests that the DOMDocElementInserted event is visible on the frame
-add_task(function*() {
+add_task(async function() {
   let tab = BrowserTestUtils.addTab(gBrowser);
   let uri = "data:text/html;charset=utf-8,<html/>"
 
   let eventPromise = ContentTask.spawn(tab.linkedBrowser, null, function() {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
     let deferred = PromiseUtils.defer();
 
     let listener = (event) => {
@@ -12,13 +12,13 @@ add_task(function*() {
       deferred.resolve(event.target.documentURIObject.spec);
     };
     addEventListener("DOMDocElementInserted", listener, true);
 
     return deferred.promise;
   });
 
   tab.linkedBrowser.loadURI(uri);
-  let loadedURI = yield eventPromise;
+  let loadedURI = await eventPromise;
   is(loadedURI, uri, "Should have seen the event for the right URI");
 
   gBrowser.removeTab(tab);
 });
--- a/dom/html/test/browser_content_contextmenu_userinput.js
+++ b/dom/html/test/browser_content_contextmenu_userinput.js
@@ -1,50 +1,50 @@
 "use strict";
 
 const kPage = "http://example.org/browser/" +
               "dom/html/test/file_content_contextmenu.html";
 
-add_task(function* () {
-  yield BrowserTestUtils.withNewTab({
+add_task(async function() {
+  await BrowserTestUtils.withNewTab({
     gBrowser,
     url: kPage
-  }, function*(aBrowser) {
+  }, async function(aBrowser) {
     let contextMenu = document.getElementById("contentAreaContextMenu");
     ok(contextMenu, "Got context menu");
 
     info("Open context menu");
     is(contextMenu.state, "closed", "Should not have opened context menu");
     let popupShownPromise = promiseWaitForEvent(window, "popupshown");
     EventUtils.synthesizeMouse(aBrowser, window.innerWidth / 3,
                                window.innerHeight / 3,
                                {type: "contextmenu", button: 2}, window);
-    yield popupShownPromise;
+    await popupShownPromise;
     is(contextMenu.state, "open", "Should have opened context menu");
 
     let pageMenuSep = document.getElementById("page-menu-separator");
     ok(pageMenuSep && !pageMenuSep.hidden,
        "Page menu separator should be shown");
 
     let testMenuSep = pageMenuSep.previousSibling;
     ok(testMenuSep && !testMenuSep.hidden,
        "User-added menu separator should be shown");
 
     let testMenuItem = testMenuSep.previousSibling;
     is(testMenuItem.label, "Test Context Menu Click", "Got context menu item");
 
-    let promiseCtxMenuClick = ContentTask.spawn(aBrowser, null, function*() {
-      yield new Promise(resolve => {
+    let promiseCtxMenuClick = ContentTask.spawn(aBrowser, null, async function() {
+      await new Promise(resolve => {
         let Ci = Components.interfaces;
         let windowUtils = content.QueryInterface(Ci.nsIInterfaceRequestor)
                                  .getInterface(Ci.nsIDOMWindowUtils);
         let menuitem = content.document.getElementById("menuitem");
         menuitem.addEventListener("click", function() {
           Assert.ok(windowUtils.isHandlingUserInput,
                     "Content menu click should be a user input");
           resolve();
         });
       });
     });
     EventUtils.synthesizeMouseAtCenter(testMenuItem, {}, window);
-    yield promiseCtxMenuClick;
+    await promiseCtxMenuClick;
   });
 });
--- a/dom/html/test/browser_fullscreen-api-keys.js
+++ b/dom/html/test/browser_fullscreen-api-keys.js
@@ -57,32 +57,32 @@ function listenOneMessage(aMsg, aListene
 function promiseOneMessage(aMsg) {
   return new Promise(resolve => listenOneMessage(aMsg, resolve));
 }
 
 function captureUnexpectedFullscreenChange() {
   ok(false, "Caught an unexpected fullscreen change");
 }
 
-function* temporaryRemoveUnexpectedFullscreenChangeCapture(callback) {
+async function temporaryRemoveUnexpectedFullscreenChangeCapture(callback) {
   gMessageManager.removeMessageListener(
     "Test:FullscreenChanged", captureUnexpectedFullscreenChange);
-  yield* callback();
+  await callback();
   gMessageManager.addMessageListener(
     "Test:FullscreenChanged", captureUnexpectedFullscreenChange);
 }
 
 function captureUnexpectedKeyEvent(type) {
   ok(false, `Caught an unexpected ${type} event`);
 }
 
-function* temporaryRemoveUnexpectedKeyEventCapture(callback) {
+async function temporaryRemoveUnexpectedKeyEventCapture(callback) {
   gMessageManager.removeMessageListener(
     "Test:KeyReceived", captureUnexpectedKeyEvent);
-  yield* callback();
+  await callback();
   gMessageManager.addMessageListener(
     "Test:KeyReceived", captureUnexpectedKeyEvent);
 }
 
 function receiveExpectedKeyEvents(keyCode) {
   return new Promise(resolve => {
     let events = ["keydown", "keypress", "keyup"];
     function listener({ data }) {
@@ -97,34 +97,34 @@ function receiveExpectedKeyEvents(keyCod
     }
     gMessageManager.addMessageListener("Test:KeyReceived", listener);
   });
 }
 
 const kPage = "http://example.org/browser/" +
               "dom/html/test/file_fullscreen-api-keys.html";
 
-add_task(function* () {
-  yield pushPrefs(
+add_task(async function() {
+  await pushPrefs(
     ["full-screen-api.transition-duration.enter", "0 0"],
     ["full-screen-api.transition-duration.leave", "0 0"]);
 
   let tab = BrowserTestUtils.addTab(gBrowser, kPage);
   let browser = tab.linkedBrowser;
   gBrowser.selectedTab = tab;
   registerCleanupFunction(() => gBrowser.removeTab(tab));
-  yield waitForDocLoadComplete();
+  await waitForDocLoadComplete();
 
   gMessageManager = browser.messageManager;
   gMessageManager.loadFrameScript(
     "data:,(" + frameScript.toString() + ")();", false);
 
   // Wait for the document being actived, so that
   // fullscreen request won't be denied.
-  yield promiseOneMessage("Test:Activated");
+  await promiseOneMessage("Test:Activated");
 
   // Register listener to capture unexpected events
   gMessageManager.addMessageListener(
     "Test:FullscreenChanged", captureUnexpectedFullscreenChange);
   gMessageManager.addMessageListener(
     "Test:KeyReceived", captureUnexpectedKeyEvent);
   registerCleanupFunction(() => {
     gMessageManager.removeMessageListener(
@@ -133,38 +133,38 @@ add_task(function* () {
       "Test:KeyReceived", captureUnexpectedKeyEvent);
   });
 
   for (let {code, suppressed} of kKeyList) {
     var keyCode = KeyEvent["DOM_" + code];
     info(`Test keycode ${code} (${keyCode})`);
 
     info("Enter fullscreen");
-    yield* temporaryRemoveUnexpectedFullscreenChangeCapture(function* () {
+    await temporaryRemoveUnexpectedFullscreenChangeCapture(async function() {
       gMessageManager.sendAsyncMessage("Test:RequestFullscreen");
-      let state = yield promiseOneMessage("Test:FullscreenChanged");
+      let state = await promiseOneMessage("Test:FullscreenChanged");
       ok(state, "The content should have entered fullscreen");
       ok(document.fullscreenElement,
          "The chrome should also be in fullscreen");
     });
 
     info("Dispatch untrusted key events from content");
-    yield* temporaryRemoveUnexpectedKeyEventCapture(function* () {
+    await temporaryRemoveUnexpectedKeyEventCapture(async function() {
       let promiseExpectedKeyEvents = receiveExpectedKeyEvents(keyCode);
       gMessageManager.sendAsyncMessage("Test:DispatchUntrustedKeyEvents", code);
-      yield promiseExpectedKeyEvents;
+      await promiseExpectedKeyEvents;
     });
 
     info("Send trusted key events");
-    yield* temporaryRemoveUnexpectedFullscreenChangeCapture(function* () {
-      yield* temporaryRemoveUnexpectedKeyEventCapture(function* () {
+    await temporaryRemoveUnexpectedFullscreenChangeCapture(async function() {
+      await temporaryRemoveUnexpectedKeyEventCapture(async function() {
         let promiseExpectedKeyEvents = suppressed ?
           Promise.resolve() : receiveExpectedKeyEvents(keyCode);
         EventUtils.synthesizeKey(code, {});
-        yield promiseExpectedKeyEvents;
-        let state = yield promiseOneMessage("Test:FullscreenChanged");
+        await promiseExpectedKeyEvents;
+        let state = await promiseOneMessage("Test:FullscreenChanged");
         ok(!state, "The content should have exited fullscreen");
         ok(!document.fullscreenElement,
            "The chrome should also have exited fullscreen");
       });
     });
   }
 });
--- a/dom/html/test/browser_fullscreen-contextmenu-esc.js
+++ b/dom/html/test/browser_fullscreen-contextmenu-esc.js
@@ -38,70 +38,70 @@ function promiseOneMessage(aMsg) {
 }
 
 function captureUnexpectedFullscreenChange() {
   ok(false, "Caught an unexpected fullscreen change");
 }
 
 const kPage = "http://example.org/browser/dom/html/test/dummy_page.html";
 
-add_task(function* () {
-  yield pushPrefs(
+add_task(async function() {
+  await pushPrefs(
     ["full-screen-api.transition-duration.enter", "0 0"],
     ["full-screen-api.transition-duration.leave", "0 0"]);
 
   let tab = BrowserTestUtils.addTab(gBrowser, kPage);
   registerCleanupFunction(() => gBrowser.removeTab(tab));
   let browser = tab.linkedBrowser;
   gBrowser.selectedTab = tab;
-  yield waitForDocLoadComplete();
+  await waitForDocLoadComplete();
 
   gMessageManager = browser.messageManager;
   gMessageManager.loadFrameScript(
     "data:,(" + frameScript.toString() + ")();", false);
 
   // Wait for the document being activated, so that
   // fullscreen request won't be denied.
-  yield promiseOneMessage("Test:Activated");
+  await promiseOneMessage("Test:Activated");
 
   let contextMenu = document.getElementById("contentAreaContextMenu");
   ok(contextMenu, "Got context menu");
 
   let state;
   info("Enter DOM fullscreen");
   gMessageManager.sendAsyncMessage("Test:RequestFullscreen");
-  state = yield promiseOneMessage("Test:FullscreenChanged");
+  state = await promiseOneMessage("Test:FullscreenChanged");
   ok(state, "The content should have entered fullscreen");
   ok(document.fullscreenElement, "The chrome should also be in fullscreen");
   gMessageManager.addMessageListener(
     "Test:FullscreenChanged", captureUnexpectedFullscreenChange);
 
   info("Open context menu");
   is(contextMenu.state, "closed", "Should not have opened context menu");
   let popupShownPromise = promiseWaitForEvent(window, "popupshown");
   EventUtils.synthesizeMouse(browser, screen.width / 2, screen.height / 2,
                              {type: "contextmenu", button: 2}, window);
-  yield popupShownPromise;
+  await popupShownPromise;
   is(contextMenu.state, "open", "Should have opened context menu");
 
   info("Send the first escape");
   let popupHidePromise = promiseWaitForEvent(window, "popuphidden");
   EventUtils.synthesizeKey("VK_ESCAPE", {});
-  yield popupHidePromise;
+  await popupHidePromise;
   is(contextMenu.state, "closed", "Should have closed context menu");
 
   // Wait a small time to confirm that the first ESC key
   // does not exit fullscreen.
-  yield new Promise(resolve => setTimeout(resolve, 1000));
+  await new Promise(resolve => setTimeout(resolve, 1000));
   gMessageManager.sendAsyncMessage("Test:QueryFullscreenState");
-  state = yield promiseOneMessage("Test:FullscreenState");
+  state = await promiseOneMessage("Test:FullscreenState");
   ok(state, "The content should still be in fullscreen");
   ok(document.fullscreenElement, "The chrome should still be in fullscreen");
 
   info("Send the second escape");
   gMessageManager.removeMessageListener(
     "Test:FullscreenChanged", captureUnexpectedFullscreenChange);
   let fullscreenExitPromise = promiseOneMessage("Test:FullscreenChanged");
   EventUtils.synthesizeKey("VK_ESCAPE", {});
-  state = yield fullscreenExitPromise;
+  state = await fullscreenExitPromise;
   ok(!state, "The content should have exited fullscreen");
   ok(!document.fullscreenElement, "The chrome should have exited fullscreen");
 });
--- a/dom/html/test/forms/test_autocompleteinfo.html
+++ b/dom/html/test/forms/test_autocompleteinfo.html
@@ -150,22 +150,22 @@ function testAutocomplete(aField, aType,
   } else {
     is(aField.getAutocompleteInfo(), null, "getAutocompleteInfo should return null");
   }
 }
 
 // getAutocompleteInfo() should be able to parse all tokens as defined
 // in the spec regardless of whether dom.forms.autocomplete.experimental pref
 // is on or off.
-add_task(function* testAutocompletePreferenceEnabled() {
-  yield SpecialPowers.pushPrefEnv({"set": [["dom.forms.autocomplete.experimental", true]]}, testInputTypes);
+add_task(async function testAutocompletePreferenceEnabled() {
+  await SpecialPowers.pushPrefEnv({"set": [["dom.forms.autocomplete.experimental", true]]}, testInputTypes);
   testAutocompleteInfoValue(true);
 });
 
-add_task(function* testAutocompletePreferenceDisabled() {
-  yield SpecialPowers.pushPrefEnv({"set": [["dom.forms.autocomplete.experimental", false]]}, testInputTypes);
+add_task(async function testAutocompletePreferenceDisabled() {
+  await SpecialPowers.pushPrefEnv({"set": [["dom.forms.autocomplete.experimental", false]]}, testInputTypes);
   testAutocompleteInfoValue(false);
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/test_anchor_ping.html
+++ b/dom/html/test/test_anchor_ping.html
@@ -15,34 +15,33 @@ https://bugzilla.mozilla.org/show_bug.cg
 SimpleTest.waitForExplicitFinish();
 
 var Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
 
 addLoadEvent(function () {
-  Task.spawn(function* run_tests() {
+  (async function run_tests() {
     while (tests.length) {
       let test = tests.shift();
       info("-- running " + test.name);
-      yield* test();
+      await test();
     }
 
     SimpleTest.finish();
-  });
+  })();
 });
 
 let tests = [
 
   // Ensure that sending pings is enabled.
-  function* setup() {
+  function setup() {
     Services.prefs.setBoolPref("browser.send_pings", true);
     Services.prefs.setIntPref("browser.send_pings.max_per_link", -1);
     Services.prefs.setBoolPref("security.mixed_content.block_active_content", false);
     // The server we create can't handle the priming HEAD requests
     Services.prefs.setBoolPref("security.mixed_content.send_hsts_priming", false);
 
     SimpleTest.registerCleanupFunction(() => {
       Services.prefs.clearUserPref("browser.send_pings");
@@ -52,17 +51,17 @@ let tests = [
     });
   },
 
   // If both the address of the document containing the hyperlink being audited
   // and ping URL have the same origin then the request must include a Ping-From
   // HTTP header with, as its value, the address of the document containing the
   // hyperlink, and a Ping-To HTTP header with, as its value, the target URL.
   // The request must not include a Referer (sic) HTTP header.
-  function* same_origin() {
+  async function same_origin() {
     let from = "/ping-from/" + Math.random();
     let to = "/ping-to/" + Math.random();
     let ping = "/ping/" + Math.random();
 
     let base;
     let server = new HttpServer();
 
     // The page that contains the link.
@@ -77,29 +76,29 @@ let tests = [
     });
 
     // Start the server, get its base URL and run the test.
     server.start(-1);
     base = "http://localhost:" + server.identity.primaryPort;
     navigate(base + from);
 
     // Wait until the target and ping url have loaded.
-    yield Promise.all([promiseHref, promisePing]);
+    await Promise.all([promiseHref, promisePing]);
 
     // Cleanup.
-    yield stopServer(server);
+    await stopServer(server);
   },
 
   // If the origins are different, but the document containing the hyperlink
   // being audited was not retrieved over an encrypted connection then the
   // request must include a Referer (sic) HTTP header with, as its value, the
   // address of the document containing the hyperlink, a Ping-From HTTP header
   // with the same value, and a Ping-To HTTP header with, as its value, target
   // URL.
-  function* diff_origin() {
+  async function diff_origin() {
     let from = "/ping-from/" + Math.random();
     let to = "/ping-to/" + Math.random();
     let ping = "/ping/" + Math.random();
 
     // We will use two servers to simulate two different origins.
     let base, base2;
     let server = new HttpServer();
     let server2 = new HttpServer();
@@ -120,29 +119,29 @@ let tests = [
     });
 
     // Start the second server, get its base URL and run the test.
     server2.start(-1);
     base2 = "http://localhost:" + server2.identity.primaryPort;
     navigate(base + from);
 
     // Wait until the target and ping url have loaded.
-    yield Promise.all([promiseHref, promisePing]);
+    await Promise.all([promiseHref, promisePing]);
 
     // Cleanup.
-    yield stopServer(server);
-    yield stopServer(server2);
+    await stopServer(server);
+    await stopServer(server2);
   },
 
   // If the origins are different and the document containing the hyperlink
   // being audited was retrieved over an encrypted connection then the request
   // must include a Ping-To HTTP header with, as its value, target URL. The
   // request must neither include a Referer (sic) HTTP header nor include a
   // Ping-From HTTP header.
-  function* diff_origin_secure_referrer() {
+  async function diff_origin_secure_referrer() {
     let ping = "/ping/" + Math.random();
     let server = new HttpServer();
 
     // The ping we want to receive.
     let promisePing = createPingPathHandler(server, ping, () => {
       return {to: "https://example.com/"};
     });
 
@@ -150,25 +149,25 @@ let tests = [
     server.start(-1);
 
     // The referrer will be loaded using a secure channel.
     navigate("https://example.com/chrome/dom/html/test/" +
              "file_anchor_ping.html?" + "http://localhost:" +
              server.identity.primaryPort + ping);
 
     // Wait until the ping has been sent.
-    yield promisePing;
+    await promisePing;
 
     // Cleanup.
-    yield stopServer(server);
+    await stopServer(server);
   },
 
   // Test that the <a ping> attribute is properly tokenized using ASCII white
   // space characters as separators.
-  function* tokenize_white_space() {
+  async function tokenize_white_space() {
     let from = "/ping-from/" + Math.random();
     let to = "/ping-to/" + Math.random();
 
     let base;
     let server = new HttpServer();
 
     let pings = [
       "/ping1/" + Math.random(),
@@ -192,20 +191,20 @@ let tests = [
     });
 
     // Start the server, get its base URL and run the test.
     server.start(-1);
     base = "http://localhost:" + server.identity.primaryPort;
     navigate(base + from);
 
     // Wait until the target and ping url have loaded.
-    yield Promise.all([promiseHref, ...pingPathHandlers]);
+    await Promise.all([promiseHref, ...pingPathHandlers]);
 
     // Cleanup.
-    yield stopServer(server);
+    await stopServer(server);
   }
 ];
 
 // Navigate the iframe used for testing to a new URL.
 function navigate(uri) {
   document.getElementById("frame").src = uri;
 }
 
--- a/dom/html/test/test_bug1166138.html
+++ b/dom/html/test/test_bug1166138.html
@@ -58,72 +58,72 @@ https://bugzilla.mozilla.org/show_bug.cg
       ok(onLoadCallback, "Expected a load event");
       if (onLoadCallback) {
         var cb = onLoadCallback;
         onLoadCallback = null;
         cb();
       }
     }
 
-    add_task(function* () {
-      yield startPromise;
+    add_task(async function() {
+      await startPromise;
       var image = document.querySelector('img');
       is(image.currentSrc, img2x, "initial scale must be 2x");
 
       SpecialPowers.pushPrefEnv({'set': [['layout.css.devPixelsPerPx', 1]]});
-      yield spin(true);
+      await spin(true);
       is(image.currentSrc, img1x, "pre-existing img tag to 1x");
 
       SpecialPowers.pushPrefEnv({'set': [['layout.css.devPixelsPerPx', 2]]});
-      yield spin(true);
+      await spin(true);
       is(image.currentSrc, img2x, "pre-existing img tag to 2x");
 
       // Try removing & re-adding the image
       document.body.removeChild(image);
 
       SpecialPowers.pushPrefEnv({'set': [['layout.css.devPixelsPerPx', 1]]});
-      yield spin(false); // No load should occur because the element is unbound
+      await spin(false); // No load should occur because the element is unbound
 
       document.body.appendChild(image);
-      yield spin(true);
+      await spin(true);
       is(image.currentSrc, img1x, "remove and re-add tag after changing to 1x");
 
       document.body.removeChild(image);
       SpecialPowers.pushPrefEnv({'set': [['layout.css.devPixelsPerPx', 2]]});
-      yield spin(false); // No load should occur because the element is unbound
+      await spin(false); // No load should occur because the element is unbound
 
       document.body.appendChild(image);
-      yield spin(true);
+      await spin(true);
       is(image.currentSrc, img2x, "remove and re-add tag after changing to 2x");
 
       // get rid of the srcset attribute! It should become the default
       image.removeAttribute('srcset');
-      yield spin(true);
+      await spin(true);
       is(image.currentSrc, imgdef, "remove srcset attribute");
 
       // Setting srcset again should return it to the correct value
       image.setAttribute('srcset', "file_bug1166138_1x.png 1x, file_bug1166138_2x.png 2x");
-      yield spin(true);
+      await spin(true);
       is(image.currentSrc, img2x, "restore srcset attribute");
 
       // Create a new image
       var newImage = document.createElement('img');
       // Switch load listening over to newImage
       newImage.addEventListener('load', onLoad);
       image.removeEventListener('load', onLoad);
 
       document.body.appendChild(newImage);
-      yield spin(false); // no load event should fire - as the image has no attributes
+      await spin(false); // no load event should fire - as the image has no attributes
       is(newImage.currentSrc, "", "New element with no attributes");
       newImage.setAttribute('srcset', "file_bug1166138_1x.png 1x, file_bug1166138_2x.png 2x");
-      yield spin(true);
+      await spin(true);
       is(newImage.currentSrc, img2x, "Adding srcset attribute");
 
       SpecialPowers.pushPrefEnv({'set': [['layout.css.devPixelsPerPx', 1]]});
-      yield spin(true);
+      await spin(true);
       is(newImage.currentSrc, img1x, "new image after switching to 1x");
       is(image.currentSrc, img1x, "old image after switching to 1x");
 
       // Clear the listener
       done = true;
     });
   </script>
 </body>
--- a/dom/indexedDB/test/browser_permissionsPromptDeny.js
+++ b/dom/indexedDB/test/browser_permissionsPromptDeny.js
@@ -3,107 +3,107 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const testPageURL = "http://mochi.test:8888/browser/" +
   "dom/indexedDB/test/browser_permissionsPrompt.html";
 const notificationID = "indexedDB-permissions-prompt";
 
 function promiseMessage(aMessage, browser) {
-  return ContentTask.spawn(browser.selectedBrowser, aMessage, function* (aMessage) {
-    yield new Promise((resolve, reject) => {
+  return ContentTask.spawn(browser.selectedBrowser, aMessage, async function(aMessage) {
+    await new Promise((resolve, reject) => {
       content.addEventListener("message", function(event) {
         is(event.data, aMessage, "received " + aMessage);
         if (event.data == aMessage)
           resolve();
         else
           reject();
       }, {once: true});
     });
   });
 }
 
-add_task(function* test1() {
+add_task(async function test1() {
   removePermission(testPageURL, "indexedDB");
 
   info("creating tab");
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   info("loading test page: " + testPageURL);
   gBrowser.selectedBrowser.loadURI(testPageURL);
-  yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
   registerPopupEventHandler("popupshowing", function() {
     ok(true, "prompt showing");
   });
   registerPopupEventHandler("popupshown", function() {
     ok(true, "prompt shown");
     triggerSecondaryCommand(this);
   });
   registerPopupEventHandler("popuphidden", function() {
     ok(true, "prompt hidden");
   });
 
-  yield promiseMessage("InvalidStateError", gBrowser);
+  await promiseMessage("InvalidStateError", gBrowser);
 
   is(getPermission(testPageURL, "indexedDB"),
      Components.interfaces.nsIPermissionManager.DENY_ACTION,
      "Correct permission set");
   gBrowser.removeCurrentTab();
 });
 
-add_task(function* test2() {
+add_task(async function test2() {
   info("creating private window");
-  let win = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
+  let win = await BrowserTestUtils.openNewBrowserWindow({ private: true });
 
   info("creating private tab");
   win.gBrowser.selectedTab = win.gBrowser.addTab();
 
   info("loading test page: " + testPageURL);
   win.gBrowser.selectedBrowser.loadURI(testPageURL);
-  yield BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
+  await BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
 
   registerPopupEventHandler("popupshowing", function() {
     ok(false, "prompt showing");
   });
   registerPopupEventHandler("popupshown", function() {
     ok(false, "prompt shown");
   });
   registerPopupEventHandler("popuphidden", function() {
     ok(false, "prompt hidden");
   });
-  yield promiseMessage("InvalidStateError", win.gBrowser);
+  await promiseMessage("InvalidStateError", win.gBrowser);
 
   is(getPermission(testPageURL, "indexedDB"),
      Components.interfaces.nsIPermissionManager.DENY_ACTION,
      "Correct permission set");
   unregisterAllPopupEventHandlers();
   win.gBrowser.removeCurrentTab();
   win.close();
 });
 
-add_task(function* test3() {
+add_task(async function test3() {
   info("creating tab");
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   info("loading test page: " + testPageURL);
   gBrowser.selectedBrowser.loadURI(testPageURL);
-  yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
   registerPopupEventHandler("popupshowing", function() {
     ok(false, "Shouldn't show a popup this time");
   });
   registerPopupEventHandler("popupshown", function() {
     ok(false, "Shouldn't show a popup this time");
   });
   registerPopupEventHandler("popuphidden", function() {
     ok(false, "Shouldn't show a popup this time");
   });
 
-  yield promiseMessage("InvalidStateError", gBrowser);
+  await promiseMessage("InvalidStateError", gBrowser);
 
   is(getPermission(testPageURL, "indexedDB"),
      Components.interfaces.nsIPermissionManager.DENY_ACTION,
      "Correct permission set");
   gBrowser.removeCurrentTab();
   unregisterAllPopupEventHandlers();
   removePermission(testPageURL, "indexedDB");
 });
--- a/dom/indexedDB/test/head.js
+++ b/dom/indexedDB/test/head.js
@@ -63,18 +63,18 @@ function dismissNotification(popup)
   });
 }
 
 function setFinishedCallback(callback, win)
 {
   if (!win) {
     win = window;
   }
-  ContentTask.spawn(win.gBrowser.selectedBrowser, null, function*() {
-    return yield new Promise(resolve => {
+  ContentTask.spawn(win.gBrowser.selectedBrowser, null, async function() {
+    return await new Promise(resolve => {
       content.wrappedJSObject.testFinishedCallback = (result, exception) => {
         info("got finished callback");
         resolve({result, exception});
       };
     });
   }).then(({result, exception}) => {
     callback(result, exception);
   });
--- a/dom/ipc/manifestMessages.js
+++ b/dom/ipc/manifestMessages.js
@@ -12,17 +12,16 @@
  * BUG: https://bugzilla.mozilla.org/show_bug.cgi?id=1083410
  */
 /*globals Task, ManifestObtainer, ManifestFinder, content, sendAsyncMessage, addMessageListener, Components*/
 "use strict";
 const {
   utils: Cu,
 } = Components;
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "ManifestObtainer",
 				  "resource://gre/modules/ManifestObtainer.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ManifestFinder",
 				  "resource://gre/modules/ManifestFinder.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ManifestIcons",
 				  "resource://gre/modules/ManifestIcons.jsm");
 
@@ -59,26 +58,26 @@ const MessageHandler = {
   },
 
   /**
    * Asynchronously obtains a web manifest from content by using the
    * ManifestObtainer and messages back the result.
    * @param {Object} aMsg The IPC message, which is destructured to just
    *                      get the id.
    */
-  obtainManifest: Task.async(function* ({data: {id}}) {
+  async obtainManifest({data: {id}}) {
     const response = makeMsgResponse(id);
     try {
-      response.result = yield ManifestObtainer.contentObtainManifest(content);
+      response.result = await ManifestObtainer.contentObtainManifest(content);
       response.success = true;
     } catch (err) {
       response.result = serializeError(err);
     }
     sendAsyncMessage("DOM:ManifestObtainer:Obtain", response);
-  }),
+  },
 
   fireAppInstalledEvent({data: {id}}){
     const ev = new Event("appinstalled");
     const response = makeMsgResponse(id);
     if (!content || content.top !== content) {
       const msg = "Can only dispatch install event on top-level browsing contexts.";
       response.result = serializeError(new Error(msg));
     } else {
@@ -87,27 +86,27 @@ const MessageHandler = {
     }
     sendAsyncMessage("DOM:Manifest:FireAppInstalledEvent", response);
   },
 
   /**
    * Given a manifest and an expected icon size, ask ManifestIcons
    * to fetch the appropriate icon and send along result
    */
-  fetchIcon: Task.async(function* ({data: {id, manifest, iconSize}}) {
+  async fetchIcon({data: {id, manifest, iconSize}}) {
     const response = makeMsgResponse(id);
     try {
       response.result =
-        yield ManifestIcons.contentFetchIcon(content, manifest, iconSize);
+        await ManifestIcons.contentFetchIcon(content, manifest, iconSize);
       response.success = true;
     } catch (err) {
       response.result = serializeError(err);
     }
     sendAsyncMessage("DOM:WebManifest:fetchIcon", response);
-  }),
+  },
 
 };
 /**
  * Utility function to Serializes an JS Error, so it can be transferred over
  * the message channel.
  * FIX ME: https://bugzilla.mozilla.org/show_bug.cgi?id=1172586
  * @param  {Error} aError The error to serialize.
  * @return {Object} The serialized object.
--- a/dom/ipc/tests/browser_domainPolicy.js
+++ b/dom/ipc/tests/browser_domainPolicy.js
@@ -6,27 +6,27 @@ function activateDomainPolicy() {
 
 function deactivateDomainPolicy() {
   if (policy) {
     policy.deactivate();
     policy = null;
   }
 }
 
-function* test_domainPolicy() {
+async function test_domainPolicy() {
 
   XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm");
   let deferred = Promise.defer();
   let currentTask = deferred.promise;
   SpecialPowers.pushPrefEnv(
     {set: [["dom.ipc.browser_frames.oop_by_default", false],
           ["browser.pagethumbnails.capturing_disabled", false],
           ["dom.mozBrowserFramesEnabled", false]]},
     () => { return deferred.resolve()});
-  yield currentTask;
+  await currentTask;
 
   // Create tab
   let tab;
 
   // Init test
   function initProcess() {
     tab = BrowserTestUtils.addTab(gBrowser);
     gBrowser.selectedTab = tab;
@@ -108,31 +108,31 @@ function* test_domainPolicy() {
       return deferred.promise;
     }
   }
 
   info("Testing simple blacklist policy");
 
   info("Creating child process first, activating domainPolicy after");
   currentTask = initProcess();
-  yield currentTask;
+  await currentTask;
   activateDomainPolicy();
   var bl = policy.blacklist;
   bl.add(Services.io.newURI('http://example.com'));
   currentTask = runTest(testDomain("http://example.com"));
-  checkAndCleanup(yield currentTask);
+  checkAndCleanup(await currentTask);
 
   info("Activating domainPolicy first, creating child process after");
   activateDomainPolicy();
   var bl = policy.blacklist;
   bl.add(Services.io.newURI('http://example.com'));
   currentTask = initProcess();
-  yield currentTask;
+  await currentTask;
   currentTask = runTest(testDomain("http://example.com"));
-  checkAndCleanup(yield currentTask);
+  checkAndCleanup(await currentTask);
 
   function testList(expectEnabled, list) {
     ipcArgs.expectEnabled = expectEnabled;
     ipcArgs.list = list;
     return (aUtils) => {
       Cu.import("resource://gre/modules/PromiseUtils.jsm");
       var ipcArgs;
       var utils = {};
@@ -178,61 +178,61 @@ function* test_domainPolicy() {
     for (var e of superExceptions)
       superSet.add(makeURI(e));
   };
 
   info("Testing Blacklist-style Domain Policy");
   info("Activating domainPolicy first, creating child process after");
   activate(true, testPolicy.exceptions, testPolicy.superExceptions);
   currentTask = initProcess();
-  yield currentTask;
+  await currentTask;
   let results = [];
   currentTask = runTest(testList(true, testPolicy.notExempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   currentTask = runTest(testList(false, testPolicy.exempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   checkAndCleanup(results);
 
   info("Creating child process first, activating domainPolicy after");
   currentTask = initProcess();
-  yield currentTask;
+  await currentTask;
   activate(true, testPolicy.exceptions, testPolicy.superExceptions);
   results = [];
   currentTask = runTest(testList(true, testPolicy.notExempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   currentTask = runTest(testList(false, testPolicy.exempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   checkAndCleanup(results);
 
   info("Testing Whitelist-style Domain Policy");
   deferred = Promise.defer();
   currentTask = deferred.promise;
   SpecialPowers.pushPrefEnv({set:[["javascript.enabled", false]]}, () => { return deferred.resolve()});
-  yield currentTask;
+  await currentTask;
 
   info("Activating domainPolicy first, creating child process after");
   activate(false, testPolicy.exceptions, testPolicy.superExceptions);
   currentTask = initProcess();
-  yield currentTask;
+  await currentTask;
   results = [];
   currentTask = runTest(testList(false, testPolicy.notExempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   currentTask = runTest(testList(true, testPolicy.exempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   checkAndCleanup(results);
 
   info("Creating child process first, activating domainPolicy after");
   currentTask = initProcess();
-  yield currentTask;
+  await currentTask;
   activate(false, testPolicy.exceptions, testPolicy.superExceptions);
   results = [];
   currentTask = runTest(testList(false, testPolicy.notExempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   currentTask = runTest(testList(true, testPolicy.exempt));
-  results = results.concat(yield currentTask);
+  results = results.concat(await currentTask);
   checkAndCleanup(results);
   finish();
 }
 
 
 add_task(test_domainPolicy);
 
 registerCleanupFunction(()=>{
--- a/dom/ipc/tests/browser_memory_distribution_telemetry.js
+++ b/dom/ipc/tests/browser_memory_distribution_telemetry.js
@@ -12,46 +12,46 @@ const DUMMY_PAGE_DATA_URI = `data:text/h
         <h1 id='header'>Just a regular everyday normal page.</h1>
       </body>
     </html>`;
 
 /**
  * Tests the MEMORY_DISTRIBUTION_AMONG_CONTENT probe by opening a few tabs, then triggering
  * the memory probes and waiting for the "gather-memory-telemetry-finished" notification.
  */
-add_task(function* test_memory_distribution() {
+add_task(async function test_memory_distribution() {
   waitForExplicitFinish();
 
   if (SpecialPowers.getIntPref("dom.ipc.processCount", 1) < 2) {
     ok(true, "Skip this test if e10s-multi is disabled.");
     finish();
     return;
   }
 
-  yield SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.enabled", true]]});
+  await SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.enabled", true]]});
   Services.telemetry.canRecordExtended = true;
 
   let histogram = Services.telemetry.getKeyedHistogramById("MEMORY_DISTRIBUTION_AMONG_CONTENT");
   histogram.clear();
 
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE_DATA_URI);
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE_DATA_URI);
-  let tab3 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE_DATA_URI);
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE_DATA_URI);
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE_DATA_URI);
+  let tab3 = await BrowserTestUtils.openNewForegroundTab(gBrowser, DUMMY_PAGE_DATA_URI);
 
   let finishedGathering = new Promise(resolve => {
     let obs = function () {
       Services.obs.removeObserver(obs, "gather-memory-telemetry-finished");
       resolve();
     }
     Services.obs.addObserver(obs, "gather-memory-telemetry-finished");
   });
 
   session.TelemetrySession.getPayload();
 
-  yield finishedGathering;
+  await finishedGathering;
 
   let s = histogram.snapshot();
   ok("0 - 10 tabs" in s, "We should have some samples by now in this bucket.")
   for (var key in s) {
     is(key, "0 - 10 tabs");
     let fewTabsSnapshot = s[key];
     ok(fewTabsSnapshot.sum > 0, "Zero difference between all the content processes is unlikely, what happened?");
     ok(fewTabsSnapshot.sum < 80, "20 percentage difference on average is unlikely, what happened?");
@@ -59,13 +59,13 @@ add_task(function* test_memory_distribut
     for (let i = 10; i < c.length; i++) {
       // If this check fails it means that one of the content processes uses at least 20% more or 20% less than the mean.
       is(c[i], 0, "All the buckets above 10 should be empty");
     }
   }
 
   histogram.clear();
 
-  yield BrowserTestUtils.removeTab(tab3);
-  yield BrowserTestUtils.removeTab(tab2);
-  yield BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab3);
+  await BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
   finish();
 });
--- a/dom/ipc/tests/browser_remote_navigation_delay_telemetry.js
+++ b/dom/ipc/tests/browser_remote_navigation_delay_telemetry.js
@@ -1,52 +1,52 @@
 "use strict";
 
 var session = Cu.import("resource://gre/modules/TelemetrySession.jsm", {});
 
-add_task(function* test_memory_distribution() {
+add_task(async function test_memory_distribution() {
   if (Services.prefs.getIntPref("dom.ipc.processCount", 1) < 2) {
     ok(true, "Skip this test if e10s-multi is disabled.");
     return;
   }
 
-  yield SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.enabled", true]]});
+  await SpecialPowers.pushPrefEnv({set: [["toolkit.telemetry.enabled", true]]});
   let canRecordExtended = Services.telemetry.canRecordExtended;
   Services.telemetry.canRecordExtended = true;
   registerCleanupFunction(() => Services.telemetry.canRecordExtended = canRecordExtended);
 
   // Note the #content suffix after the id. This is the only way this API lets us fetch the
   // histogram entries reported by a content process.
   let histogram = Services.telemetry.getKeyedHistogramById("FX_TAB_REMOTE_NAVIGATION_DELAY_MS#content");
   histogram.clear();
 
   // Open a remote page in a new tab to trigger the WebNavigation:LoadURI.
-  let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com");
+  let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com");
   ok(tab1.linkedBrowser.isRemoteBrowser, "|tab1| should have a remote browser.");
 
   // Open a new tab with about:robots, so it ends up in the parent process with a non-remote browser.
-  let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:robots");
+  let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:robots");
   ok(!tab2.linkedBrowser.isRemoteBrowser, "|tab2| should have a non-remote browser.");
   // Navigate the tab, so it will change remotness and it triggers the SessionStore:restoreTabContent case.
-  yield BrowserTestUtils.loadURI(tab2.linkedBrowser, "http://example.com");
+  await BrowserTestUtils.loadURI(tab2.linkedBrowser, "http://example.com");
   ok(tab2.linkedBrowser.isRemoteBrowser, "|tab2| should have a remote browser by now.");
 
   // There is no good way to make sure that the parent received the histogram entries from the child processes.
   // Let's stick to the ugly, spinning the event loop until we have a good approach (Bug 1357509).
-  yield BrowserTestUtils.waitForCondition(() => {
+  await BrowserTestUtils.waitForCondition(() => {
     let s = histogram.snapshot();
     return "WebNavigation:LoadURI" in s && "SessionStore:restoreTabContent" in s;
   });
 
   let s = histogram.snapshot();
   let restoreTabSnapshot = s["SessionStore:restoreTabContent"];
   ok(restoreTabSnapshot.sum > 0, "Zero delay for the restoreTabContent case is unlikely.");
   ok(restoreTabSnapshot.sum < 10000, "More than 10 seconds delay for the restoreTabContent case is unlikely.");
 
   let loadURISnapshot = s["WebNavigation:LoadURI"];
   ok(loadURISnapshot.sum > 0, "Zero delay for the LoadURI case is unlikely.");
   ok(loadURISnapshot.sum < 10000, "More than 10 seconds delay for the LoadURI case is unlikely.");
 
   histogram.clear();
 
-  yield BrowserTestUtils.removeTab(tab2);
-  yield BrowserTestUtils.removeTab(tab1);
+  await BrowserTestUtils.removeTab(tab2);
+  await BrowserTestUtils.removeTab(tab1);
 });
--- a/dom/manifest/ManifestFinder.jsm
+++ b/dom/manifest/ManifestFinder.jsm
@@ -2,17 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 /* globals Components, Task, PromiseMessage */
 "use strict";
 const {
   utils: Cu
 } = Components;
 Cu.import("resource://gre/modules/PromiseMessage.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
 
 this.ManifestFinder = {// jshint ignore:line
   /**
   * Check from content process if DOM Window has a conforming
   * manifest link relationship.
   * @param aContent DOM Window to check.
   * @return {Promise<Boolean>}
   */
@@ -24,27 +23,25 @@ this.ManifestFinder = {// jshint ignore:
   },
 
   /**
   * Check from a XUL browser (parent process) if it's content document has a
   * manifest link relationship.
   * @param aBrowser The XUL browser to check.
   * @return {Promise}
   */
-  browserHasManifestLink: Task.async(
-    function* (aBrowser) {
+  async browserHasManifestLink(aBrowser) {
       if (!isXULBrowser(aBrowser)) {
         throw new TypeError("Invalid input.");
       }
       const msgKey = "DOM:WebManifest:hasManifestLink";
       const mm = aBrowser.messageManager;
-      const reply = yield PromiseMessage.send(mm, msgKey);
+      const reply = await PromiseMessage.send(mm, msgKey);
       return reply.data.result;
     }
-  )
 };
 
 function isXULBrowser(aBrowser) {
   if (!aBrowser || !aBrowser.namespaceURI || !aBrowser.localName) {
     return false;
   }
   const XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
   return (aBrowser.namespaceURI === XUL && aBrowser.localName === "browser");
--- a/dom/manifest/ManifestObtainer.jsm
+++ b/dom/manifest/ManifestObtainer.jsm
@@ -25,61 +25,59 @@
  */
 /*globals Components, Task, PromiseMessage, XPCOMUtils, ManifestProcessor, BrowserUtils*/
 "use strict";
 const {
   utils: Cu,
   classes: Cc,
   interfaces: Ci
 } = Components;
-Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/PromiseMessage.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/ManifestProcessor.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",  // jshint ignore:line
   "resource://gre/modules/BrowserUtils.jsm");
 
 this.ManifestObtainer = { // jshint ignore:line
   /**
   * Public interface for obtaining a web manifest from a XUL browser, to use
   * on the parent process.
   * @param  {XULBrowser} The browser to check for the manifest.
   * @return {Promise<Object>} The processed manifest.
   */
-  browserObtainManifest: Task.async(function* (aBrowser) {
+  async browserObtainManifest(aBrowser) {
     const msgKey = "DOM:ManifestObtainer:Obtain";
     if (!isXULBrowser(aBrowser)) {
       throw new TypeError("Invalid input. Expected XUL browser.");
     }
     const mm = aBrowser.messageManager;
-    const {data: {success, result}} = yield PromiseMessage.send(mm, msgKey);
+    const {data: {success, result}} = await PromiseMessage.send(mm, msgKey);
     if (!success) {
       const error = toError(result);
       throw error;
     }
     return result;
-  }),
+  },
   /**
    * Public interface for obtaining a web manifest from a XUL browser.
    * @param  {Window} The content Window from which to extract the manifest.
    * @return {Promise<Object>} The processed manifest.
    */
-  contentObtainManifest: Task.async(function* (aContent) {
+  async contentObtainManifest(aContent) {
     if (!aContent || isXULBrowser(aContent)) {
       throw new TypeError("Invalid input. Expected a DOM Window.");
     }
     let manifest;
     try {
-      manifest = yield fetchManifest(aContent);
+      manifest = await fetchManifest(aContent);
     } catch (err) {
       throw err;
     }
     return manifest;
-  }
-)};
+  }};
 
 function toError(aErrorClone) {
   let error;
   switch (aErrorClone.name) {
   case "TypeError":
     error = new TypeError();
     break;
   default:
@@ -100,39 +98,39 @@ function isXULBrowser(aBrowser) {
 
 /**
  * Asynchronously processes the result of response after having fetched
  * a manifest.
  * @param {Response} aResp Response from fetch().
  * @param {Window} aContentWindow The content window.
  * @return {Promise<Object>} The processed manifest.
  */
-const processResponse = Task.async(function* (aResp, aContentWindow) {
+const processResponse = async function(aResp, aContentWindow) {
   const badStatus = aResp.status < 200 || aResp.status >= 300;
   if (aResp.type === "error" || badStatus) {
     const msg =
       `Fetch error: ${aResp.status} - ${aResp.statusText} at ${aResp.url}`;
     throw new Error(msg);
   }
-  const text = yield aResp.text();
+  const text = await aResp.text();
   const args = {
     jsonText: text,
     manifestURL: aResp.url,
     docURL: aContentWindow.location.href
   };
   const manifest = ManifestProcessor.process(args);
   return manifest;
-});
+};
 
 /**
  * Asynchronously fetches a web manifest.
  * @param {Window} a The content Window from where to extract the manifest.
  * @return {Promise<Object>}
  */
-const fetchManifest = Task.async(function* (aWindow) {
+const fetchManifest = async function(aWindow) {
   if (!aWindow || aWindow.top !== aWindow) {
     let msg = "Window must be a top-level browsing context.";
     throw new Error(msg);
   }
   const elem = aWindow.document.querySelector("link[rel~='manifest']");
   if (!elem || !elem.getAttribute("href")) {
     let msg = `No manifest to fetch at ${aWindow.location}`;
     throw new Error(msg);
@@ -144,17 +142,17 @@ const fetchManifest = Task.async(functio
   };
   if (elem.crossOrigin === "use-credentials") {
     reqInit.credentials = "include";
   }
   const request = new aWindow.Request(manifestURL, reqInit);
   request.overrideContentPolicyType(Ci.nsIContentPolicy.TYPE_WEB_MANIFEST);
   let response;
   try {
-    response = yield aWindow.fetch(request);
+    response = await aWindow.fetch(request);
   } catch (err) {
     throw err;
   }
-  const manifest = yield processResponse(response, aWindow);
+  const manifest = await processResponse(response, aWindow);
   return manifest;
-});
+};
 
 this.EXPORTED_SYMBOLS = ["ManifestObtainer"]; // jshint ignore:line
--- a/dom/manifest/test/browser_ManifestFinder_browserHasManifestLink.js
+++ b/dom/manifest/test/browser_ManifestFinder_browserHasManifestLink.js
@@ -42,43 +42,43 @@ function makeTestURL({ body }) {
   const url = new URL(defaultURL);
   url.searchParams.set("body", encodeURIComponent(body));
   return url.href;
 }
 
 /**
  * Test basic API error conditions
  */
-add_task(function*() {
+add_task(async function() {
   const expected = "Invalid types should throw a TypeError.";
   for (let invalidValue of [undefined, null, 1, {}, "test"]) {
     try {
-      yield ManifestFinder.contentManifestLink(invalidValue);
+      await ManifestFinder.contentManifestLink(invalidValue);
       ok(false, expected);
     } catch (e) {
       is(e.name, "TypeError", expected);
     }
     try {
-      yield ManifestFinder.browserManifestLink(invalidValue);
+      await ManifestFinder.browserManifestLink(invalidValue);
       ok(false, expected);
     } catch (e) {
       is(e.name, "TypeError", expected);
     }
   }
 });
 
-add_task(function*() {
+add_task(async function() {
   const runningTests = tests
     .map(
       test => ({
         gBrowser,
         test,
         url: makeTestURL(test),
       })
     )
     .map(
-      tabOptions => BrowserTestUtils.withNewTab(tabOptions, function*(browser) {
-        const result = yield ManifestFinder.browserHasManifestLink(browser);
+      tabOptions => BrowserTestUtils.withNewTab(tabOptions, async function(browser) {
+        const result = await ManifestFinder.browserHasManifestLink(browser);
         tabOptions.test.run(result);
       })
     );
-  yield Promise.all(runningTests);
+  await Promise.all(runningTests);
 });
--- a/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js
+++ b/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js
@@ -36,21 +36,21 @@ function getIconColor(icon) {
     };
     image.onerror = function() {
       reject(new Error("could not create image"));
     };
     image.src = icon;
   });
 }
 
-add_task(function*() {
+add_task(async function() {
   const tabOptions = {gBrowser, url: makeTestURL(manifest)};
-  yield BrowserTestUtils.withNewTab(tabOptions, function*(browser) {
-    const manifest = yield ManifestObtainer.browserObtainManifest(browser);
-    let icon = yield ManifestIcons.browserFetchIcon(browser, manifest, 25);
-    let color = yield ContentTask.spawn(browser, icon, getIconColor);
+  await BrowserTestUtils.withNewTab(tabOptions, async function(browser) {
+    const manifest = await ManifestObtainer.browserObtainManifest(browser);
+    let icon = await ManifestIcons.browserFetchIcon(browser, manifest, 25);
+    let color = await ContentTask.spawn(browser, icon, getIconColor);
     is(color[0], 255, 'Fetched red icon');
 
-    icon = yield ManifestIcons.browserFetchIcon(browser, manifest, 500);
-    color = yield ContentTask.spawn(browser, icon, getIconColor);
+    icon = await ManifestIcons.browserFetchIcon(browser, manifest, 500);
+    color = await ContentTask.spawn(browser, icon, getIconColor);
     is(color[2], 255, 'Fetched blue icon');
   });
 });
--- a/dom/manifest/test/browser_ManifestObtainer_obtain.js
+++ b/dom/manifest/test/browser_ManifestObtainer_obtain.js
@@ -82,49 +82,49 @@ const tests = [
 ];
 
 function makeTestURL({ body }) {
   const url = new URL(defaultURL);
   url.searchParams.set('body', encodeURIComponent(body));
   return url.href;
 }
 
-add_task(function*() {
+add_task(async function() {
   const promises = tests
     .map(test => ({
       gBrowser,
       testRunner: testObtainingManifest(test),
       url: makeTestURL(test)
     }))
     .reduce((collector, tabOpts) => {
       const promise = BrowserTestUtils.withNewTab(tabOpts, tabOpts.testRunner);
       collector.push(promise);
       return collector;
     }, []);
 
-  const results = yield Promise.all(promises);
+  const results = await Promise.all(promises);
 
   function testObtainingManifest(aTest) {
-    return function*(aBrowser) {
+    return async function(aBrowser) {
       try {
-        const manifest = yield ManifestObtainer.browserObtainManifest(aBrowser);
+        const manifest = await ManifestObtainer.browserObtainManifest(aBrowser);
         aTest.run(manifest);
       } catch (e) {
         aTest.run(e);
       }
     };
   }
 });
 
 /*
  * e10s race condition tests
  * Open a bunch of tabs and load manifests
  * in each tab. They should all return pass.
  */
-add_task(function*() {
+add_task(async function() {
   const defaultPath = '/browser/dom/manifest/test/manifestLoader.html';
   const tabURLs = [
     `http://example.com:80${defaultPath}`,
     `http://example.org:80${defaultPath}`,
     `http://example.org:8000${defaultPath}`,
     `http://mochi.test:8888${defaultPath}`,
     `http://sub1.test1.example.com:80${defaultPath}`,
     `http://sub1.test1.example.org:80${defaultPath}`,
@@ -151,22 +151,22 @@ add_task(function*() {
     `http://test:80${defaultPath}`,
     `http://www.example.com:80${defaultPath}`,
   ];
   // Open tabs an collect corresponding browsers
   let browsers = [
     for (url of tabURLs) BrowserTestUtils.addTab(gBrowser, url).linkedBrowser
   ];
   // Once all the pages have loaded, run a bunch of tests in "parallel".
-  yield Promise.all((
+  await Promise.all((
     for (browser of browsers) BrowserTestUtils.browserLoaded(browser)
   ));
   // Flood random browsers with requests. Once promises settle, check that
   // responses all pass.
-  const results = yield Promise.all((
+  const results = await Promise.all((
     for (browser of randBrowsers(browsers, 50)) ManifestObtainer.browserObtainManifest(browser)
   ));
   const pass = results.every(manifest => manifest.name === 'pass');
   ok(pass, 'Expect every manifest to have name equal to `pass`.');
   //cleanup
   browsers
     .map(browser => gBrowser.getTabForBrowser(browser))
     .forEach(tab => gBrowser.removeTab(tab));
--- a/dom/manifest/test/browser_Manifest_install.js
+++ b/dom/manifest/test/browser_Manifest_install.js
@@ -13,34 +13,34 @@ const manifestUrl = `${defaultURL}&body=
 function makeTestURL(manifest) {
   const url = new URL(defaultURL);
   const body = `<link rel="manifest" href='${manifestUrl}'>`;
   url.searchParams.set("Content-Type", "text/html; charset=utf-8");
   url.searchParams.set("body", encodeURIComponent(body));
   return url.href;
 }
 
-add_task(function*() {
+add_task(async function() {
 
   const tabOptions = {gBrowser, url: makeTestURL(manifest)};
 
-  yield BrowserTestUtils.withNewTab(tabOptions, function*(browser) {
+  await BrowserTestUtils.withNewTab(tabOptions, async function(browser) {
 
-    let manifest = yield Manifests.getManifest(browser, manifestUrl);
+    let manifest = await Manifests.getManifest(browser, manifestUrl);
     is(manifest.installed, false, "We havent installed this manifest yet");
 
-    yield manifest.install(browser);
+    await manifest.install(browser);
     is(manifest.name, "hello World", "Manifest has correct name");
     is(manifest.installed, true, "Manifest is installed");
     is(manifest.url, manifestUrl, "has correct url");
 
-    manifest = yield Manifests.getManifest(browser, manifestUrl);
+    manifest = await Manifests.getManifest(browser, manifestUrl);
     is(manifest.installed, true, "New instances are installed");
 
-    manifest = yield Manifests.getManifest(browser);
+    manifest = await Manifests.getManifest(browser);
     is(manifest.installed, true, "Will find manifest without being given url");
 
     let foundManifest = Manifests.findManifestUrl("http://example.org/browser/dom/");
     is(foundManifest, manifestUrl, "Finds manifests within scope");
 
     foundManifest = Manifests.findManifestUrl("http://example.org/");
     is(foundManifest, null, "Does not find manifests outside scope");
   });
--- a/dom/manifest/test/browser_fire_appinstalled_event.js
+++ b/dom/manifest/test/browser_fire_appinstalled_event.js
@@ -14,36 +14,36 @@ function enableOnAppInstalledPref() {
       ["dom.manifest.onappinstalled", true],
     ],
   };
   return SpecialPowers.pushPrefEnv(ops);
 }
 
 // Send a message for the even to be fired.
 // This cause file_reg_install_event.html to be dynamically change.
-function* theTest(aBrowser) {
+async function theTest(aBrowser) {
   aBrowser.allowEvents = true;
-  let waitForInstall = ContentTask.spawn(aBrowser, null, function*() {
-    yield ContentTaskUtils.waitForEvent(content.window, "appinstalled");
+  let waitForInstall = ContentTask.spawn(aBrowser, null, async function() {
+    await ContentTaskUtils.waitForEvent(content.window, "appinstalled");
   });
-  const { data: { success } } = yield PromiseMessage
+  const { data: { success } } = await PromiseMessage
     .send(aBrowser.messageManager, "DOM:Manifest:FireAppInstalledEvent");
   ok(success, "message sent and received successfully.");
   try {
-    yield waitForInstall;
+    await waitForInstall;
     ok(true, "AppInstalled event fired");
   } catch (err) {
     ok(false, "AppInstalled event didn't fire: " + err.message);
   }
 }
 
 // Open a tab and run the test
-add_task(function*() {
-  yield enableOnAppInstalledPref();
+add_task(async function() {
+  await enableOnAppInstalledPref();
   let tabOptions = {
     gBrowser: gBrowser,
     url: testURL.href,
   };
-  yield BrowserTestUtils.withNewTab(
+  await BrowserTestUtils.withNewTab(
     tabOptions,
     theTest
   );
 });
--- a/dom/network/tests/test_tcpsocket_client_and_server_basics.js
+++ b/dom/network/tests/test_tcpsocket_client_and_server_basics.js
@@ -179,17 +179,17 @@ function defer() {
   deferred.promise = new Promise(function(resolve, reject) {
     deferred.resolve = resolve;
     deferred.reject = reject;
   });
   return deferred;
 }
 
 
-function* test_basics() {
+async function test_basics() {
   // See bug 903830; in e10s mode we never get to find out the localPort if we
   // let it pick a free port by choosing 0.  This is the same port the xpcshell
   // test was using.
   let serverPort = 8085;
 
   // - Start up a listening socket.
   let listeningServer = createServer(serverPort,
                                      { binaryType: 'arraybuffer' },
@@ -198,236 +198,236 @@ function* test_basics() {
   let connectedPromise = waitForConnection(listeningServer);
 
   // -- Open a connection to the server
   let clientSocket = createSocket('127.0.0.1', serverPort,
                                   { binaryType: 'arraybuffer' });
   let clientQueue = listenForEventsOnSocket(clientSocket, 'client');
 
   // (the client connects)
-  is((yield clientQueue.waitForEvent()).type, 'open', 'got open event');
+  is((await clientQueue.waitForEvent()).type, 'open', 'got open event');
   is(clientSocket.readyState, 'open', 'client readyState is open');
 
   // (the server connected)
-  let { socket: serverSocket, queue: serverQueue } = yield connectedPromise;
+  let { socket: serverSocket, queue: serverQueue } = await connectedPromise;
   is(serverSocket.readyState, 'open', 'server readyState is open');
 
   // -- Simple send / receive
   // - Send data from client to server
   // (But not so much we cross the drain threshold.)
   let smallUint8Array = new Uint8Array(256);
   for (let i = 0; i < smallUint8Array.length; i++) {
     smallUint8Array[i] = i;
   }
   is(clientSocket.send(smallUint8Array.buffer, 0, smallUint8Array.length), true,
      'Client sending less than 64k, buffer should not be full.');
 
-  let serverReceived = yield serverQueue.waitForDataWithAtLeastLength(256);
+  let serverReceived = await serverQueue.waitForDataWithAtLeastLength(256);
   assertUint8ArraysEqual(serverReceived, smallUint8Array,
                          'Server received/client sent');
 
   // - Send data from server to client
   // (But not so much we cross the drain threshold.)
   is(serverSocket.send(smallUint8Array.buffer, 0, smallUint8Array.length), true,
      'Server sending less than 64k, buffer should not be full.');
 
-  let clientReceived = yield clientQueue.waitForDataWithAtLeastLength(256);
+  let clientReceived = await clientQueue.waitForDataWithAtLeastLength(256);
   assertUint8ArraysEqual(clientReceived, smallUint8Array,
                          'Client received/server sent');
 
   // -- Perform sending multiple times with different buffer slices
   // - Send data from client to server
   // (But not so much we cross the drain threshold.)
   is(clientSocket.send(smallUint8Array.buffer, 0, 7),
      true, 'Client sending less than 64k, buffer should not be full.');
   is(clientSocket.send(smallUint8Array.buffer, 7, smallUint8Array.length - 7),
      true, 'Client sending less than 64k, buffer should not be full.');
 
-  serverReceived = yield serverQueue.waitForDataWithAtLeastLength(256);
+  serverReceived = await serverQueue.waitForDataWithAtLeastLength(256);
   assertUint8ArraysEqual(serverReceived, smallUint8Array,
                          'Server received/client sent');
 
   // - Send data from server to client
   // (But not so much we cross the drain threshold.)
   is(serverSocket.send(smallUint8Array.buffer, 0, 7),
      true, 'Server sending less than 64k, buffer should not be full.');
   is(serverSocket.send(smallUint8Array.buffer, 7, smallUint8Array.length - 7),
      true, 'Server sending less than 64k, buffer should not be full.');
 
-  clientReceived = yield clientQueue.waitForDataWithAtLeastLength(256);
+  clientReceived = await clientQueue.waitForDataWithAtLeastLength(256);
   assertUint8ArraysEqual(clientReceived, smallUint8Array,
                          'Client received/server sent');
 
 
   // -- Send "big" data in both directions
   // (Enough to cross the buffering/drain threshold; 64KiB)
   let bigUint8Array = new Uint8Array(65536 + 3);
   for (let i = 0; i < bigUint8Array.length; i++) {
     bigUint8Array[i] = i % 256;
   }
   // Do this twice so we have confidence that the 'drain' event machinery
   // doesn't break after the first use.
   for (let iSend = 0; iSend < 2; iSend++) {
     // - Send "big" data from the client to the server
     is(clientSocket.send(bigUint8Array.buffer, 0, bigUint8Array.length), false,
        'Client sending more than 64k should result in the buffer being full.');
-    is((yield clientQueue.waitForEvent()).type, 'drain',
+    is((await clientQueue.waitForEvent()).type, 'drain',
        'The drain event should fire after a large send that indicated full.');
 
-    serverReceived = yield serverQueue.waitForDataWithAtLeastLength(
+    serverReceived = await serverQueue.waitForDataWithAtLeastLength(
       bigUint8Array.length);
     assertUint8ArraysEqual(serverReceived, bigUint8Array,
                            'server received/client sent');
 
     // - Send "big" data from the server to the client
     is(serverSocket.send(bigUint8Array.buffer, 0, bigUint8Array.length), false,
        'Server sending more than 64k should result in the buffer being full.');
-    is((yield serverQueue.waitForEvent()).type, 'drain',
+    is((await serverQueue.waitForEvent()).type, 'drain',
        'The drain event should fire after a large send that indicated full.');
 
-    clientReceived = yield clientQueue.waitForDataWithAtLeastLength(
+    clientReceived = await clientQueue.waitForDataWithAtLeastLength(
       bigUint8Array.length);
     assertUint8ArraysEqual(clientReceived, bigUint8Array,
                            'client received/server sent');
   }
 
   // -- Server closes the connection
   serverSocket.close();
   is(serverSocket.readyState, 'closing',
      'readyState should be closing immediately after calling close');
 
-  is((yield clientQueue.waitForEvent()).type, 'close',
+  is((await clientQueue.waitForEvent()).type, 'close',
      'The client should get a close event when the server closes.');
   is(clientSocket.readyState, 'closed',
      'client readyState should be closed after close event');
-  is((yield serverQueue.waitForEvent()).type, 'close',
+  is((await serverQueue.waitForEvent()).type, 'close',
      'The server should get a close event when it closes itself.');
   is(serverSocket.readyState, 'closed',
      'server readyState should be closed after close event');
 
   // -- Re-establish connection
   connectedPromise = waitForConnection(listeningServer);
   clientSocket = createSocket('127.0.0.1', serverPort,
                               { binaryType: 'arraybuffer' });
   clientQueue = listenForEventsOnSocket(clientSocket, 'client');
-  is((yield clientQueue.waitForEvent()).type, 'open', 'got open event');
+  is((await clientQueue.waitForEvent()).type, 'open', 'got open event');
 
-  let connectedResult = yield connectedPromise;
+  let connectedResult = await connectedPromise;
   // destructuring assignment is not yet ES6 compliant, must manually unpack
   serverSocket = connectedResult.socket;
   serverQueue = connectedResult.queue;
 
   // -- Client closes the connection
   clientSocket.close();
   is(clientSocket.readyState, 'closing',
      'client readyState should be losing immediately after calling close');
 
-  is((yield clientQueue.waitForEvent()).type, 'close',
+  is((await clientQueue.waitForEvent()).type, 'close',
      'The client should get a close event when it closes itself.');
   is(clientSocket.readyState, 'closed',
      'client readyState should be closed after the close event is received');
-  is((yield serverQueue.waitForEvent()).type, 'close',
+  is((await serverQueue.waitForEvent()).type, 'close',
      'The server should get a close event when the client closes.');
   is(serverSocket.readyState, 'closed',
      'server readyState should be closed after the close event is received');
 
 
   // -- Re-establish connection
   connectedPromise = waitForConnection(listeningServer);
   clientSocket = createSocket('127.0.0.1', serverPort,
                               { binaryType: 'arraybuffer' });
   clientQueue = listenForEventsOnSocket(clientSocket, 'client');
-  is((yield clientQueue.waitForEvent()).type, 'open', 'got open event');
+  is((await clientQueue.waitForEvent()).type, 'open', 'got open event');
 
-  connectedResult = yield connectedPromise;
+  connectedResult = await connectedPromise;
   // destructuring assignment is not yet ES6 compliant, must manually unpack
   serverSocket = connectedResult.socket;
   serverQueue = connectedResult.queue;
 
   // -- Call close after enqueueing a lot of data, make sure it goes through.
   // We'll have the client send and close.
   is(clientSocket.send(bigUint8Array.buffer, 0, bigUint8Array.length), false,
      'Client sending more than 64k should result in the buffer being full.');
   clientSocket.close();
   // The drain will still fire
-  is((yield clientQueue.waitForEvent()).type, 'drain',
+  is((await clientQueue.waitForEvent()).type, 'drain',
      'The drain event should fire after a large send that returned true.');
   // Then we'll get a close
-  is((yield clientQueue.waitForEvent()).type, 'close',
+  is((await clientQueue.waitForEvent()).type, 'close',
      'The close event should fire after the drain event.');
 
   // The server will get its data
-  serverReceived = yield serverQueue.waitForDataWithAtLeastLength(
+  serverReceived = await serverQueue.waitForDataWithAtLeastLength(
     bigUint8Array.length);
   assertUint8ArraysEqual(serverReceived, bigUint8Array,
                          'server received/client sent');
   // And a close.
-  is((yield serverQueue.waitForEvent()).type, 'close',
+  is((await serverQueue.waitForEvent()).type, 'close',
      'The drain event should fire after a large send that returned true.');
 
 
   // -- Re-establish connection
   connectedPromise = waitForConnection(listeningServer);
   clientSocket = createSocket('127.0.0.1', serverPort,
                               { binaryType: 'string' });
   clientQueue = listenForEventsOnSocket(clientSocket, 'client');
-  is((yield clientQueue.waitForEvent()).type, 'open', 'got open event');
+  is((await clientQueue.waitForEvent()).type, 'open', 'got open event');
 
-  connectedResult = yield connectedPromise;
+  connectedResult = await connectedPromise;
   // destructuring assignment is not yet ES6 compliant, must manually unpack
   serverSocket = connectedResult.socket;
   serverQueue = connectedResult.queue;
 
   // -- Attempt to send non-string data.
   // Restore the original behavior by replacing toString with
   // Object.prototype.toString. (bug 1121938)
   bigUint8Array.toString = Object.prototype.toString;
   is(clientSocket.send(bigUint8Array), true,
      'Client sending a large non-string should only send a small string.');
   clientSocket.close();
   // The server will get its data
-  serverReceived = yield serverQueue.waitForDataWithAtLeastLength(
+  serverReceived = await serverQueue.waitForDataWithAtLeastLength(
     bigUint8Array.toString().length);
   // Then we'll get a close
-  is((yield clientQueue.waitForEvent()).type, 'close',
+  is((await clientQueue.waitForEvent()).type, 'close',
      'The close event should fire after the drain event.');
 
   // -- Re-establish connection (Test for Close Immediately)
   connectedPromise = waitForConnection(listeningServer);
   clientSocket = createSocket('127.0.0.1', serverPort,
                                { binaryType: 'arraybuffer' });
   clientQueue = listenForEventsOnSocket(clientSocket, 'client');
-  is((yield clientQueue.waitForEvent()).type, 'open', 'got open event');
+  is((await clientQueue.waitForEvent()).type, 'open', 'got open event');
 
-  connectedResult = yield connectedPromise;
+  connectedResult = await connectedPromise;
   // destructuring assignment is not yet ES6 compliant, must manually unpack
   serverSocket = connectedResult.socket;
   serverQueue = connectedResult.queue;
 
   // -- Attempt to send two non-string data.
   is(clientSocket.send(bigUint8Array.buffer, 0, bigUint8Array.length), false,
      'Server sending more than 64k should result in the buffer being full.');
   is(clientSocket.send(bigUint8Array.buffer, 0, bigUint8Array.length), false,
      'Server sending more than 64k should result in the buffer being full.');
   clientSocket.closeImmediately();
 
-  serverReceived = yield serverQueue.waitForAnyDataAndClose();
+  serverReceived = await serverQueue.waitForAnyDataAndClose();
 
   is(serverReceived.length < (2 * bigUint8Array.length), true, 'Received array length less than sent array length');
 
   // -- Close the listening server (and try to connect)
   // We want to verify that the server actually closes / stops listening when
   // we tell it to.
   listeningServer.close();
 
   // (We don't run this check on OS X where it's flakey; see definition up top.)
   if (testConnectingToNonListeningPort) {
     // - try and connect, get an error
     clientSocket = createSocket('127.0.0.1', serverPort,
                                 { binaryType: 'arraybuffer' });
     clientQueue = listenForEventsOnSocket(clientSocket, 'client');
-    is((yield clientQueue.waitForEvent()).type, 'error', 'fail to connect');
+    is((await clientQueue.waitForEvent()).type, 'error', 'fail to connect');
     is(clientSocket.readyState, 'closed',
        'client readyState should be closed after the failure to connect');
   }
 }
 
 add_task(test_basics);
--- a/dom/notification/test/browser/browser_permission_dismiss.js
+++ b/dom/notification/test/browser/browser_permission_dismiss.js
@@ -47,71 +47,71 @@ function clickDoorhangerButton(aButtonIn
  *                   closes.
  */
 function tabWithRequest(task, permission) {
   Services.perms.remove(ORIGIN_URI, PERMISSION_NAME);
 
   return BrowserTestUtils.withNewTab({
     gBrowser,
     url: TEST_URL,
-  }, function*(browser) {
+  }, async function(browser) {
     let requestPromise = ContentTask.spawn(browser, {
       permission
-    }, function*({permission}) {
+    }, async function({permission}) {
       function requestCallback(perm) {
         is(perm, permission,
           "Should call the legacy callback with the permission state");
       }
-      let perm = yield content.window.Notification
+      let perm = await content.window.Notification
                               .requestPermission(requestCallback);
       is(perm, permission,
          "Should resolve the promise with the permission state");
     });
 
-    yield BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
-    yield task();
-    yield requestPromise;
+    await BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
+    await task();
+    await requestPromise;
   });
 }
 
-add_task(function* setup() {
+add_task(async function setup() {
   SimpleTest.registerCleanupFunction(() => {
     Services.perms.remove(ORIGIN_URI, PERMISSION_NAME);
   });
 });
 
-add_task(function* test_requestPermission_granted() {
-  yield tabWithRequest(function() {
+add_task(async function test_requestPermission_granted() {
+  await tabWithRequest(function() {
     clickDoorhangerButton(PROMPT_ALLOW_BUTTON);
   }, "granted");
 
   ok(!PopupNotifications.getNotification("web-notifications"),
      "Should remove the doorhanger notification icon if granted");
 
   is(Services.perms.testPermission(ORIGIN_URI, PERMISSION_NAME),
      Services.perms.ALLOW_ACTION,
      "Check permission in perm. manager");
 });
 
-add_task(function* test_requestPermission_denied_temporarily() {
-  yield tabWithRequest(function() {
+add_task(async function test_requestPermission_denied_temporarily() {
+  await tabWithRequest(function() {
     clickDoorhangerButton(PROMPT_NOT_NOW_BUTTON);
   }, "default");
 
   ok(!PopupNotifications.getNotification("web-notifications"),
      "Should remove the doorhanger notification icon if denied");
 
   is(Services.perms.testPermission(ORIGIN_URI, PERMISSION_NAME),
      Services.perms.UNKNOWN_ACTION,
      "Check permission in perm. manager");
 });
 
-add_task(function* test_requestPermission_denied_permanently() {
-  yield tabWithRequest(function*() {
-    yield clickDoorhangerButton(PROMPT_NEVER_BUTTON);
+add_task(async function test_requestPermission_denied_permanently() {
+  await tabWithRequest(async function() {
+    await clickDoorhangerButton(PROMPT_NEVER_BUTTON);
   }, "denied");
 
   ok(!PopupNotifications.getNotification("web-notifications"),
      "Should remove the doorhanger notification icon if denied");
 
   is(Services.perms.testPermission(ORIGIN_URI, PERMISSION_NAME),
      Services.perms.DENY_ACTION,
      "Check permission in perm. manager");
--- a/dom/payments/test/browser_multiple_construction.js
+++ b/dom/payments/test/browser_multiple_construction.js
@@ -1,19 +1,19 @@
 "use strict";
 
 // kTestRoot is from head.js
 const kTestPage = kTestRoot + "multiple_payment_request.html";
 
 registerCleanupFunction(cleanup);
 
-add_task(function*() {
+add_task(async function() {
   Services.prefs.setBoolPref("dom.payments.request.enabled", true);
-  yield BrowserTestUtils.withNewTab(kTestPage,
-    function*(browser) {
+  await BrowserTestUtils.withNewTab(kTestPage,
+    function(browser) {
 
       const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"].getService(Ci.nsIPaymentRequestService);
       ok(paymentSrv, "Fail to get PaymentRequestService.");
 
       const paymentEnum = paymentSrv.enumerate();
       ok(paymentEnum.hasMoreElements(), "PaymentRequestService should have at least one payment request.");
       while (paymentEnum.hasMoreElements()) {
         let payment = paymentEnum.getNext().QueryInterface(Ci.nsIPaymentRequest);
--- a/dom/payments/test/browser_payment_construction.js
+++ b/dom/payments/test/browser_payment_construction.js
@@ -1,19 +1,19 @@
 "use strict";
 
 // kTestRoot is from head.js
 const kTestPage = kTestRoot + "simple_payment_request.html";
 
 registerCleanupFunction(cleanup);
 
-add_task(function*() {
+add_task(async function() {
   Services.prefs.setBoolPref("dom.payments.request.enabled", true);
-  yield BrowserTestUtils.withNewTab(kTestPage,
-    function*(browser) {
+  await BrowserTestUtils.withNewTab(kTestPage,
+    function(browser) {
 
       const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"].getService(Ci.nsIPaymentRequestService);
       ok(paymentSrv, "Fail to get PaymentRequestService.");
 
       const paymentEnum = paymentSrv.enumerate();
       ok(paymentEnum.hasMoreElements(), "PaymentRequestService should have at least one payment request.");
       while (paymentEnum.hasMoreElements()) {
         let payment = paymentEnum.getNext().QueryInterface(Ci.nsIPaymentRequest);
--- a/dom/payments/test/browser_payment_in_different_tabs.js
+++ b/dom/payments/test/browser_payment_in_different_tabs.js
@@ -1,21 +1,21 @@
 "use strict";
 
 // kTestRoot is from head.js
 const kTestPage = kTestRoot + "simple_payment_request.html";
 
 registerCleanupFunction(cleanup);
 
-add_task(function*() {
+add_task(async function() {
   Services.prefs.setBoolPref("dom.payments.request.enabled", true);
-  yield BrowserTestUtils.withNewTab(kTestPage,
-    function*(browser) {
-      yield BrowserTestUtils.withNewTab(kTestPage,
-        function*(browser) {
+  await BrowserTestUtils.withNewTab(kTestPage,
+    async function(browser) {
+      await BrowserTestUtils.withNewTab(kTestPage,
+        function(browser) {
           const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"].getService(Ci.nsIPaymentRequestService);
           ok(paymentSrv, "Fail to get PaymentRequestService.");
 
           const paymentEnum = paymentSrv.enumerate();
           ok(paymentEnum.hasMoreElements(), "PaymentRequestService should have at least one payment request.");
           let tabIds = [];
           while (paymentEnum.hasMoreElements()) {
             let payment = paymentEnum.getNext().QueryInterface(Ci.nsIPaymentRequest);
--- a/dom/plugins/test/mochitest/browser_bug1163570.js
+++ b/dom/plugins/test/mochitest/browser_bug1163570.js
@@ -26,69 +26,69 @@ function promiseWaitForEvent(object, eve
     function listener(event) {
       object.removeEventListener(eventName, listener, capturing, chrome);
       resolve(event);
     }
     object.addEventListener(eventName, listener, capturing, chrome);
   });
 }
 
-add_task(function* () {
+add_task(async function() {
   registerCleanupFunction(function () {
     window.focus();
   });
 });
 
-add_task(function* () {
+add_task(async function() {
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
   let pluginTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
   let prefTab = BrowserTestUtils.addTab(gBrowser);
 
-  yield promiseTabLoad(pluginTab, gTestRoot + "plugin_test.html");
-  yield promiseTabLoad(prefTab, "about:preferences");
+  await promiseTabLoad(pluginTab, gTestRoot + "plugin_test.html");
+  await promiseTabLoad(prefTab, "about:preferences");
 
-  yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
+  await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     Assert.ok(!!plugin, "plugin is loaded");
   });
 
   let ppromise = promiseWaitForEvent(window, "MozAfterPaint");
   gBrowser.selectedTab = prefTab;
-  yield ppromise;
+  await ppromise;
 
   // We're going to switch tabs using actual mouse clicks, which helps
   // reproduce this bug.
   let tabStripContainer = document.getElementById("tabbrowser-tabs");
 
   // diagnosis if front end layout changes
   info("-> " + tabStripContainer.tagName); // tabs
   info("-> " + tabStripContainer.firstChild.tagName); // tab
   info("-> " + tabStripContainer.childNodes[0].label); // test harness tab
   info("-> " + tabStripContainer.childNodes[1].label); // plugin tab
   info("-> " + tabStripContainer.childNodes[2].label); // preferences tab
 
   for (let iteration = 0; iteration < 5; iteration++) {
     ppromise = promiseWaitForEvent(window, "MozAfterPaint");
     EventUtils.synthesizeMouseAtCenter(tabStripContainer.childNodes[1], {}, window);
-    yield ppromise;
+    await ppromise;
 
-    yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+    await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
       let doc = content.document;
       let plugin = doc.getElementById("testplugin");
       Assert.ok(XPCNativeWrapper.unwrap(plugin).nativeWidgetIsVisible(),
         "plugin is visible");
     });
 
     ppromise = promiseWaitForEvent(window, "MozAfterPaint");
     EventUtils.synthesizeMouseAtCenter(tabStripContainer.childNodes[2], {}, window);
-    yield ppromise;
+    await ppromise;
 
-    yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+    await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
       let doc = content.document;
       let plugin = doc.getElementById("testplugin");
       Assert.ok(!XPCNativeWrapper.unwrap(plugin).nativeWidgetIsVisible(),
         "plugin is hidden");
     });
   }
 
   gBrowser.removeTab(prefTab);
--- a/dom/plugins/test/mochitest/browser_bug1196539.js
+++ b/dom/plugins/test/mochitest/browser_bug1196539.js
@@ -6,113 +6,113 @@ function checkPaintCount(aCount) {
 }
 
 // maximum number of paints we allow before failing. The test plugin doesn't
 // animate so this should really be just 1, but operating systems can
 // occasionally fire a few of these so we give these tests a fudge factor.
 // A bad regression would either be 0, or 100+.
 const kMaxPaints = 10;
 
-add_task(function* () {
+add_task(async function() {
   let result, tabSwitchedPromise;
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
   let testTab = gBrowser.selectedTab;
-  let pluginTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
-  let homeTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
+  let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
+  let homeTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
 
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return !!plugin;
   });
   is(result, true, "plugin is loaded");
 
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return !XPCNativeWrapper.unwrap(plugin).nativeWidgetIsVisible();
   });
   is(result, true, "plugin is hidden");
 
   // reset plugin paint count
-  yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     XPCNativeWrapper.unwrap(plugin).resetPaintCount();
   });
 
   // select plugin tab
   tabSwitchedPromise = waitTabSwitched();
   gBrowser.selectedTab = pluginTab;
-  yield tabSwitchedPromise;
+  await tabSwitchedPromise;
 
   // wait a bit for spurious paints
-  yield waitForMs(100);
+  await waitForMs(100);
 
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return XPCNativeWrapper.unwrap(plugin).nativeWidgetIsVisible();
   });
   is(result, true, "plugin is visible");
 
   // check for good paint count
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return XPCNativeWrapper.unwrap(plugin).getPaintCount();
   });
   checkPaintCount(result);
 
   // select home tab
   tabSwitchedPromise = waitTabSwitched();
   gBrowser.selectedTab = homeTab;
-  yield tabSwitchedPromise;
+  await tabSwitchedPromise;
 
   // reset paint count
-  yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     XPCNativeWrapper.unwrap(plugin).resetPaintCount();
   });
 
   // wait a bit for spurious paints
-  yield waitForMs(100);
+  await waitForMs(100);
 
   // check for no paint count
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return XPCNativeWrapper.unwrap(plugin).getPaintCount();
   });
   is(result, 0, "no paints, this is correct.");
 
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return !XPCNativeWrapper.unwrap(plugin).nativeWidgetIsVisible();
   });
   is(result, true, "plugin is hidden");
 
   // reset paint count
-  yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     XPCNativeWrapper.unwrap(plugin).resetPaintCount();
   });
 
   // select plugin tab
   tabSwitchedPromise = waitTabSwitched();
   gBrowser.selectedTab = pluginTab;
-  yield tabSwitchedPromise;
+  await tabSwitchedPromise;
 
   // check paint count
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return XPCNativeWrapper.unwrap(plugin).getPaintCount();
   });
   checkPaintCount(result);
 
   gBrowser.removeTab(homeTab);
   gBrowser.removeTab(pluginTab);
--- a/dom/plugins/test/mochitest/browser_bug1335475.js
+++ b/dom/plugins/test/mochitest/browser_bug1335475.js
@@ -1,64 +1,64 @@
 var rootDir = getRootDirectory(gTestPath);
 const gTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
 
-add_task(function*() {
+add_task(async function() {
   is(navigator.plugins.length, 0,
      "plugins should not be available to chrome-privilege pages");
   ok(!("application/x-test" in navigator.mimeTypes),
      "plugins should not be available to chrome-privilege pages");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function*(browser) {
+  await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, async function(browser) {
     // about:blank triggered from a toplevel load should not inherit permissions
-    yield ContentTask.spawn(browser, null, function*() {
+    await ContentTask.spawn(browser, null, async function() {
       is(content.window.navigator.plugins.length, 0,
          "plugins should not be available to null-principal about:blank");
       ok(!("application/x-test" in content.window.navigator.mimeTypes),
          "plugins should not be available to null-principal about:blank");
     });
 
     let promise = BrowserTestUtils.browserLoaded(browser);
     browser.loadURI(gTestRoot + "plugin_test.html");
-    yield promise;
+    await promise;
 
-    yield ContentTask.spawn(browser, null, function*() {
+    await ContentTask.spawn(browser, null, async function() {
       ok(content.window.navigator.plugins.length > 0,
          "plugins should be available to HTTP-loaded pages");
       ok("application/x-test" in content.window.navigator.mimeTypes,
          "plugins should be available to HTTP-loaded pages");
 
       let subwindow = content.document.getElementById("subf").contentWindow;
 
       ok("application/x-test" in subwindow.navigator.mimeTypes,
          "plugins should be available to an about:blank subframe loaded from a site");
     });
 
     // navigate from the HTTP page to an about:blank page which ought to
     // inherit permissions
     promise = BrowserTestUtils.browserLoaded(browser);
-    yield ContentTask.spawn(browser, null, function*() {
+    await ContentTask.spawn(browser, null, async function() {
       content.document.getElementById("aboutlink").click();
     });
-    yield promise;
+    await promise;
 
-    yield ContentTask.spawn(browser, null, function*() {
+    await ContentTask.spawn(browser, null, async function() {
       is(content.window.location.href, "about:blank", "sanity-check about:blank load");
       ok("application/x-test" in content.window.navigator.mimeTypes,
          "plugins should be available when a site triggers an about:blank load");
     });
 
     // navigate to the file: URI, which shouldn't allow plugins. This might
     // be wrapped in jar:, but that shouldn't matter for this test
     promise = BrowserTestUtils.browserLoaded(browser);
     let converteduri = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry).convertChromeURL(Services.io.newURI(rootDir + "plugin_test.html"));
     browser.loadURI(converteduri.spec);
-    yield promise;
+    await promise;
 
-    yield ContentTask.spawn(browser, null, function*() {
+    await ContentTask.spawn(browser, null, async function() {
       ok(!("application/x-test" in content.window.navigator.mimeTypes),
          "plugins should not be available to file: URI content");
     });
   });
 
   // As much as it would be nice, this doesn't actually check ftp:// because
   // we don't have a synthetic server.
 });
--- a/dom/plugins/test/mochitest/browser_pluginscroll.js
+++ b/dom/plugins/test/mochitest/browser_pluginscroll.js
@@ -13,288 +13,288 @@ function coordinatesRelativeToWindow(aX,
     y: targetWindow.mozInnerScreenY + ((rect.top + aY) * scale)
   };
 }
 
 var apzEnabled = Preferences.get("layers.async-pan-zoom.enabled", false);
 var pluginHideEnabled = Preferences.get("gfx.e10s.hide-plugins-for-scroll", true);
 
 
-add_task(function* () {
+add_task(async function() {
   registerCleanupFunction(function () {
     setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   });
 });
 
-add_task(function*() {
-  yield SpecialPowers.pushPrefEnv({
+add_task(async function() {
+  await SpecialPowers.pushPrefEnv({
     "set": [
              ["general.smoothScroll", true],
              ["general.smoothScroll.other", true],
              ["general.smoothScroll.mouseWheel", true],
              ["general.smoothScroll.other.durationMaxMS", 2000],
              ["general.smoothScroll.other.durationMinMS", 1999],
              ["general.smoothScroll.mouseWheel.durationMaxMS", 2000],
              ["general.smoothScroll.mouseWheel.durationMinMS", 1999],
            ]});
 });
 
 /*
  * test plugin visibility when scrolling with scroll wheel and apz in a top level document.
  */
 
-add_task(function* () {
+add_task(async function() {
   let result;
 
   if (!apzEnabled) {
     ok(true, "nothing to test, need apz");
     return;
   }
 
   if (!pluginHideEnabled) {
     ok(true, "nothing to test, need gfx.e10s.hide-plugins-for-scroll");
     return;
   }
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
   let testTab = gBrowser.selectedTab;
-  let pluginTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
+  let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
 
-  result = yield ContentTask.spawn(pluginTab.linkedBrowser, null, function*() {
+  result = await ContentTask.spawn(pluginTab.linkedBrowser, null