Bug 1321218 - Remove legacy generator from dom/. r=smaug
authorTooru Fujisawa <arai_a@mac.com>
Thu, 01 Dec 2016 18:11:32 +0900
changeset 324983 4a8703321e8a8bf3c8769dec1007e72dad3b01dd
parent 324982 43472882f637c01e43e3ecbfd37c1ffff7fabfa1
child 324984 d29194b9a835f320ddfb8507db29a089375bd3e6
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerssmaug
bugs1321218
milestone53.0a1
Bug 1321218 - Remove legacy generator from dom/. r=smaug
dom/archivereader/test/helpers.js
dom/archivereader/test/test_basic.html
dom/archivereader/test/test_nonUnicode.html
dom/archivereader/test/test_zip_in_zip.html
dom/base/test/browser_use_counters.js
dom/base/test/referrer_helper.js
dom/base/test/test_audioNotificationSilent_audioFile.html
dom/base/test/test_audioNotificationSilent_webAudio.html
dom/base/test/test_bug1163743.html
dom/base/test/test_bug1165501.html
dom/base/test/test_bug544642.html
dom/base/test/test_bug590870.html
dom/base/test/test_bug682592.html
dom/base/test/test_bug704320.html
dom/base/test/test_bug704320_policyset.html
dom/base/test/test_bug704320_policyset2.html
dom/base/test/test_bug704320_preload.html
dom/base/test/test_change_policy.html
dom/base/test/test_img_referrer.html
dom/browser-element/mochitest/browserElement_ActiveStateChange.js
dom/browser-element/mochitest/browserElement_AudioChannelSeeking.js
dom/browser-element/mochitest/browserElement_NoAudioTrack.js
dom/devicestorage/test/test_app_permissions.html
dom/devicestorage/test/test_fs_app_permissions.html
dom/events/test/bug426082.html
dom/events/test/bug656379-1.html
dom/events/test/test_bug415498.xul
dom/events/test/test_bug656379-2.html
dom/file/tests/test_mozfiledataurl.html
dom/html/test/forms/test_input_color_input_change_events.html
dom/html/test/forms/test_input_color_picker_initial.html
dom/html/test/forms/test_input_color_picker_popup.html
dom/html/test/forms/test_input_color_picker_update.html
dom/html/test/forms/test_input_textarea_set_value_no_scroll.html
dom/html/test/forms/test_input_typing_sanitization.html
dom/html/test/test_anchor_ping.html
dom/html/test/test_bug209275.xhtml
dom/html/test/test_bug481335.xhtml
dom/html/test/test_formSubmission.html
dom/html/test/test_formSubmission2.html
dom/indexedDB/test/browserHelpers.js
dom/indexedDB/test/browser_forgetThisSiteAdd.html
dom/indexedDB/test/browser_forgetThisSiteGet.html
dom/indexedDB/test/browser_permissionsPrompt.html
dom/indexedDB/test/browser_permissionsPromptDeny.js
dom/indexedDB/test/chromeHelpers.js
dom/indexedDB/test/error_events_abort_transactions_iframe.html
dom/indexedDB/test/event_propagation_iframe.html
dom/indexedDB/test/exceptions_in_events_iframe.html
dom/indexedDB/test/file.js
dom/indexedDB/test/helpers.js
dom/indexedDB/test/test_bfcache.html
dom/indexedDB/test/test_blob_archive.html
dom/indexedDB/test/test_blob_simple.html
dom/indexedDB/test/test_blob_worker_crash.html
dom/indexedDB/test/test_blob_worker_xhr_post.html
dom/indexedDB/test/test_blob_worker_xhr_post_multifile.html
dom/indexedDB/test/test_blob_worker_xhr_read.html
dom/indexedDB/test/test_blob_worker_xhr_read_slice.html
dom/indexedDB/test/test_file_array.html
dom/indexedDB/test/test_file_cross_database_copying.html
dom/indexedDB/test/test_file_delete.html
dom/indexedDB/test/test_file_os_delete.html
dom/indexedDB/test/test_file_put_get_object.html
dom/indexedDB/test/test_file_put_get_values.html
dom/indexedDB/test/test_file_replace.html
dom/indexedDB/test/test_file_resurrection_delete.html
dom/indexedDB/test/test_file_resurrection_transaction_abort.html
dom/indexedDB/test/test_file_sharing.html
dom/indexedDB/test/test_file_transaction_abort.html
dom/indexedDB/test/test_filehandle_compat.html
dom/indexedDB/test/test_filehandle_disabled_pref.html
dom/indexedDB/test/test_filehandle_getFile.html
dom/indexedDB/test/test_filehandle_iteration.html
dom/indexedDB/test/test_filehandle_lifetimes.html
dom/indexedDB/test/test_filehandle_lifetimes_nested.html
dom/indexedDB/test/test_filehandle_location.html
dom/indexedDB/test/test_filehandle_ordering.html
dom/indexedDB/test/test_filehandle_overlapping.html
dom/indexedDB/test/test_filehandle_progress_events.html
dom/indexedDB/test/test_filehandle_readonly_exceptions.html
dom/indexedDB/test/test_filehandle_request_readyState.html
dom/indexedDB/test/test_filehandle_serialization.html
dom/indexedDB/test/test_filehandle_store_snapshot.html
dom/indexedDB/test/test_filehandle_stream_tracking.html
dom/indexedDB/test/test_filehandle_success_events_after_abort.html
dom/indexedDB/test/test_filehandle_truncate.html
dom/indexedDB/test/test_filehandle_workers.html
dom/indexedDB/test/test_filehandle_write_read_data.html
dom/indexedDB/test/test_globalObjects_chrome.xul
dom/indexedDB/test/test_globalObjects_content.html
dom/indexedDB/test/test_globalObjects_other.xul
dom/indexedDB/test/test_leaving_page.html
dom/indexedDB/test/test_message_manager_ipc.html
dom/indexedDB/test/test_open_for_principal.html
dom/indexedDB/test/test_persistenceType.html
dom/indexedDB/test/unit/test_abort_deleted_index.js
dom/indexedDB/test/unit/test_abort_deleted_objectStore.js
dom/indexedDB/test/unit/test_add_put.js
dom/indexedDB/test/unit/test_add_twice_failure.js
dom/indexedDB/test/unit/test_advance.js
dom/indexedDB/test/unit/test_autoIncrement.js
dom/indexedDB/test/unit/test_autoIncrement_indexes.js
dom/indexedDB/test/unit/test_blob_file_backed.js
dom/indexedDB/test/unit/test_blocked_order.js
dom/indexedDB/test/unit/test_cleanup_transaction.js
dom/indexedDB/test/unit/test_clear.js
dom/indexedDB/test/unit/test_complex_keyPaths.js
dom/indexedDB/test/unit/test_count.js
dom/indexedDB/test/unit/test_create_index.js
dom/indexedDB/test/unit/test_create_index_with_integer_keys.js
dom/indexedDB/test/unit/test_create_locale_aware_index.js
dom/indexedDB/test/unit/test_create_objectStore.js
dom/indexedDB/test/unit/test_cursor_mutation.js
dom/indexedDB/test/unit/test_cursor_update_updates_indexes.js
dom/indexedDB/test/unit/test_cursors.js
dom/indexedDB/test/unit/test_database_onclose.js
dom/indexedDB/test/unit/test_deleteDatabase.js
dom/indexedDB/test/unit/test_deleteDatabase_interactions.js
dom/indexedDB/test/unit/test_deleteDatabase_onblocked.js
dom/indexedDB/test/unit/test_deleteDatabase_onblocked_duringVersionChange.js
dom/indexedDB/test/unit/test_event_source.js
dom/indexedDB/test/unit/test_filehandle_append_read_data.js
dom/indexedDB/test/unit/test_getAll.js
dom/indexedDB/test/unit/test_global_data.js
dom/indexedDB/test/unit/test_index_empty_keyPath.js
dom/indexedDB/test/unit/test_index_getAll.js
dom/indexedDB/test/unit/test_index_getAllObjects.js
dom/indexedDB/test/unit/test_index_object_cursors.js
dom/indexedDB/test/unit/test_index_update_delete.js
dom/indexedDB/test/unit/test_indexes.js
dom/indexedDB/test/unit/test_indexes_bad_values.js
dom/indexedDB/test/unit/test_indexes_funny_things.js
dom/indexedDB/test/unit/test_invalid_cursor.js
dom/indexedDB/test/unit/test_invalid_version.js
dom/indexedDB/test/unit/test_key_requirements.js
dom/indexedDB/test/unit/test_keys.js
dom/indexedDB/test/unit/test_locale_aware_index_getAll.js
dom/indexedDB/test/unit/test_locale_aware_index_getAllObjects.js
dom/indexedDB/test/unit/test_locale_aware_indexes.js
dom/indexedDB/test/unit/test_lowDiskSpace.js
dom/indexedDB/test/unit/test_maximal_serialized_object_size.js
dom/indexedDB/test/unit/test_multientry.js
dom/indexedDB/test/unit/test_names_sorted.js
dom/indexedDB/test/unit/test_objectCursors.js
dom/indexedDB/test/unit/test_objectStore_getAllKeys.js
dom/indexedDB/test/unit/test_objectStore_inline_autoincrement_key_added_on_put.js
dom/indexedDB/test/unit/test_objectStore_openKeyCursor.js
dom/indexedDB/test/unit/test_objectStore_remove_values.js
dom/indexedDB/test/unit/test_object_identity.js
dom/indexedDB/test/unit/test_odd_result_order.js
dom/indexedDB/test/unit/test_open_empty_db.js
dom/indexedDB/test/unit/test_open_objectStore.js
dom/indexedDB/test/unit/test_optionalArguments.js
dom/indexedDB/test/unit/test_overlapping_transactions.js
dom/indexedDB/test/unit/test_put_get_values.js
dom/indexedDB/test/unit/test_put_get_values_autoIncrement.js
dom/indexedDB/test/unit/test_quotaExceeded_recovery.js
dom/indexedDB/test/unit/test_readonly_transactions.js
dom/indexedDB/test/unit/test_readwriteflush_disabled.js
dom/indexedDB/test/unit/test_remove_index.js
dom/indexedDB/test/unit/test_remove_objectStore.js
dom/indexedDB/test/unit/test_rename_index.js
dom/indexedDB/test/unit/test_rename_index_errors.js
dom/indexedDB/test/unit/test_rename_objectStore.js
dom/indexedDB/test/unit/test_rename_objectStore_errors.js
dom/indexedDB/test/unit/test_request_readyState.js
dom/indexedDB/test/unit/test_setVersion.js
dom/indexedDB/test/unit/test_setVersion_abort.js
dom/indexedDB/test/unit/test_setVersion_events.js
dom/indexedDB/test/unit/test_setVersion_exclusion.js
dom/indexedDB/test/unit/test_setVersion_throw.js
dom/indexedDB/test/unit/test_storage_manager_estimate.js
dom/indexedDB/test/unit/test_success_events_after_abort.js
dom/indexedDB/test/unit/test_table_locks.js
dom/indexedDB/test/unit/test_table_rollback.js
dom/indexedDB/test/unit/test_temporary_storage.js
dom/indexedDB/test/unit/test_traffic_jam.js
dom/indexedDB/test/unit/test_transaction_abort.js
dom/indexedDB/test/unit/test_transaction_abort_hang.js
dom/indexedDB/test/unit/test_transaction_duplicate_store_names.js
dom/indexedDB/test/unit/test_transaction_error.js
dom/indexedDB/test/unit/test_transaction_lifetimes.js
dom/indexedDB/test/unit/test_transaction_lifetimes_nested.js
dom/indexedDB/test/unit/test_transaction_ordering.js
dom/indexedDB/test/unit/test_unique_index_update.js
dom/indexedDB/test/unit/test_view_put_get_values.js
dom/indexedDB/test/unit/test_wasm_getAll.js
dom/indexedDB/test/unit/test_wasm_put_get_values.js
dom/indexedDB/test/unit/xpcshell-head-parent-process.js
dom/ipc/tests/test_blob_sliced_from_parent_process.html
dom/security/test/contentverifier/head.js
dom/security/test/cors/test_CrossSiteXHR.html
dom/security/test/cors/test_CrossSiteXHR_cache.html
dom/security/test/cors/test_CrossSiteXHR_origin.html
dom/tests/browser/browser_bug1008941_dismissGeolocationHanger.js
dom/tests/mochitest/general/test_bug504220.html
dom/tests/mochitest/general/test_domWindowUtils.html
dom/tests/mochitest/general/test_spacetopagedown.html
dom/tests/mochitest/storageevent/test_storageNotifications.html
dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.html
dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js
dom/tests/mochitest/whatwg/test_postMessage_structured_clone.html
dom/workers/test/referrer_worker.html
dom/workers/test/test_multi_sharedWorker.html
dom/workers/test/test_multi_sharedWorker_lifetimes.html
dom/xbl/test/test_bug591198.html
dom/xhr/tests/test_XHR.html
dom/xhr/tests/test_XHRDocURI.html
dom/xhr/tests/test_XHRSendData.html
dom/xhr/tests/test_xhr_progressevents.html
--- a/dom/archivereader/test/helpers.js
+++ b/dom/archivereader/test/helpers.js
@@ -1,31 +1,27 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-var testGenerator;
-
 function runTest()
 {
   SimpleTest.waitForExplicitFinish();
 
   SpecialPowers.pushPrefEnv({'set': [ ["dom.archivereader.enabled", true] ]}, function() {
     SpecialPowers.createFiles(filesToCreate(),
                               function (files) {
-                                testGenerator = testSteps(files);
-                                return testGenerator.next();
+                                testSteps(files);
                               },
                               function (msg) {
                                 ok(false, "File creation error: " + msg);
                                 finishTest();
                               });
   });
 }
 
 function finishTest()
 {
   SpecialPowers.popPrefEnv(function() {
-    testGenerator.close();
     SimpleTest.finish();
   });
 }
--- a/dom/archivereader/test/test_basic.html
+++ b/dom/archivereader/test/test_basic.html
@@ -207,17 +207,16 @@
       is(this.result[1].type, "text/plain", "ArchiveReader.getFile('test/a.txt') the type MUST be 'text/plain'");
 
       markTestDone();
     }
     handle5.onerror = function() {
       ok(false, "ArchiveReader.getFiles() should not return an 'error'");
       markTestDone();
     }
-    yield undefined;
   }
 
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 </head>
 
 <body onload="runTest();">
 <p id="display">
--- a/dom/archivereader/test/test_nonUnicode.html
+++ b/dom/archivereader/test/test_nonUnicode.html
@@ -46,17 +46,16 @@
       ok(e instanceof RangeError, "Expected a RangeError");
     }
     finishTest();
   }
 
   function testSteps(files)
   {
     test1(files[0]);
-    yield undefined;
   }
 
 
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
--- a/dom/archivereader/test/test_zip_in_zip.html
+++ b/dom/archivereader/test/test_zip_in_zip.html
@@ -20,18 +20,16 @@
   }
 
   function testSteps(files)
   {
     var binaryFile = files[0];
 
     // The input is 4 nested zip archives:
     doLoop(binaryFile, 4);
-
-    yield undefined;
   }
 
   function doLoop(blob, loop)
   {
     var r = new ArchiveReader(blob);
     isnot(r, null, "ArchiveReader cannot be null");
 
     // GetFilename
--- a/dom/base/test/browser_use_counters.js
+++ b/dom/base/test/browser_use_counters.js
@@ -78,17 +78,17 @@ add_task(function* () {
   yield check_use_counter_iframe("file_use_counter_svg_list_style_image.html",
                                  "PROPERTY_FILL");
 });
 
 add_task(function* () {
   let Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
   Telemetry.canRecordExtended = gOldParentCanRecord;
 
-  yield ContentTask.spawn(gBrowser.selectedBrowser, { oldCanRecord: gOldContentCanRecord }, function (arg) {
+  yield ContentTask.spawn(gBrowser.selectedBrowser, { oldCanRecord: gOldContentCanRecord }, function* (arg) {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
     yield new Promise(resolve => {
       let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
       telemetry.canRecordExtended = arg.oldCanRecord;
       resolve();
     });
   });
 });
@@ -122,34 +122,34 @@ function grabHistogramsFromContent(use_c
     telemetry.getHistogramById("CONTENT_DOCUMENTS_DESTROYED" + suffix).snapshot().sum,
     telemetry.getHistogramById("TOP_LEVEL_CONTENT_DOCUMENTS_DESTROYED" + suffix).snapshot().sum,
   ];
   return BrowserTestUtils.waitForCondition(() => {
     return page_before != telemetry.getHistogramById("USE_COUNTER2_" + use_counter_middlefix + "_PAGE" + suffix).snapshot().sum;
   }).then(gather, gather);
 }
 
-var check_use_counter_iframe = Task.async(function* (file, use_counter_middlefix, check_documents=true) {
+var check_use_counter_iframe = async function(file, use_counter_middlefix, check_documents=true) {
   info("checking " + file + " with histogram " + use_counter_middlefix);
 
   let newTab = gBrowser.addTab( "about:blank");
   gBrowser.selectedTab = newTab;
   newTab.linkedBrowser.stop();
 
   // 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] =
-      yield grabHistogramsFromContent(use_counter_middlefix);
+      await grabHistogramsFromContent(use_counter_middlefix);
 
   gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
-  yield waitForPageLoad(gBrowser.selectedBrowser);
+  await waitForPageLoad(gBrowser.selectedBrowser);
 
   // Inject our desired file into the iframe of the newly-loaded page.
-  yield ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, function(opts) {
+  await ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, function(opts) {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
     let deferred = PromiseUtils.defer();
 
     let wu = content.window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
 
     let iframe = content.document.getElementById('content');
     iframe.src = opts.file;
     let listener = (event) => {
@@ -169,51 +169,51 @@ var check_use_counter_iframe = Task.asyn
   });
   
   // Tear down the page.
   gBrowser.removeTab(newTab);
 
   // The histograms only get recorded when the document actually gets
   // destroyed, which might not have happened yet due to GC/CC effects, etc.
   // Try to force document destruction.
-  yield waitForDestroyedDocuments();
+  await waitForDestroyedDocuments();
 
   // Grab histograms again and compare.
   let [histogram_page_after, histogram_document_after,
        histogram_docs_after, histogram_toplevel_docs_after] =
-      yield grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
+      await grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
 
   is(histogram_page_after, histogram_page_before + 1,
      "page counts for " + use_counter_middlefix + " after are correct");
   ok(histogram_toplevel_docs_after >= histogram_toplevel_docs_before + 1,
      "top level document counts are correct");
   if (check_documents) {
     is(histogram_document_after, histogram_document_before + 1,
        "document counts for " + use_counter_middlefix + " after are correct");
   }
-});
+};
 
-var check_use_counter_img = Task.async(function* (file, use_counter_middlefix) {
+var check_use_counter_img = async function(file, use_counter_middlefix) {
   info("checking " + file + " as image with histogram " + use_counter_middlefix);
 
   let newTab = gBrowser.addTab("about:blank");
   gBrowser.selectedTab = newTab;
   newTab.linkedBrowser.stop();
 
   // 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] =
-      yield grabHistogramsFromContent(use_counter_middlefix);
+      await grabHistogramsFromContent(use_counter_middlefix);
 
   gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
-  yield waitForPageLoad(gBrowser.selectedBrowser);
+  await waitForPageLoad(gBrowser.selectedBrowser);
 
   // Inject our desired file into the img of the newly-loaded page.
-  yield ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, function(opts) {
+  await ContentTask.spawn(gBrowser.selectedBrowser, { file: file }, 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);
 
@@ -234,49 +234,49 @@ var check_use_counter_img = Task.async(f
   });
   
   // Tear down the page.
   gBrowser.removeTab(newTab);
 
   // The histograms only get recorded when the document actually gets
   // destroyed, which might not have happened yet due to GC/CC effects, etc.
   // Try to force document destruction.
-  yield waitForDestroyedDocuments();
+  await waitForDestroyedDocuments();
 
   // Grab histograms again and compare.
   let [histogram_page_after, histogram_document_after,
        histogram_docs_after, histogram_toplevel_docs_after] =
-      yield grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
+      await grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
   is(histogram_page_after, histogram_page_before + 1,
      "page counts for " + use_counter_middlefix + " after are correct");
   is(histogram_document_after, histogram_document_before + 1,
      "document counts for " + use_counter_middlefix + " after are correct");
   ok(histogram_toplevel_docs_after >= histogram_toplevel_docs_before + 1,
      "top level document counts are correct");
   // 2 documents: one for the outer html page containing the <img> element, and
   // one for the SVG image itself.
   ok(histogram_docs_after >= histogram_docs_before + 2,
      "document counts are correct");
-});
+};
 
-var check_use_counter_direct = Task.async(function* (file, use_counter_middlefix, xfail=false) {
+var check_use_counter_direct = async function(file, use_counter_middlefix, xfail=false) {
   info("checking " + file + " with histogram " + use_counter_middlefix);
 
   let newTab = gBrowser.addTab( "about:blank");
   gBrowser.selectedTab = newTab;
   newTab.linkedBrowser.stop();
 
   // 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] =
-      yield grabHistogramsFromContent(use_counter_middlefix);
+      await grabHistogramsFromContent(use_counter_middlefix);
 
   gBrowser.selectedBrowser.loadURI(gHttpTestRoot + file);
-  yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
+  await ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
     Cu.import("resource://gre/modules/PromiseUtils.jsm");
     yield new Promise(resolve => {
       let listener = () => {
         removeEventListener("load", listener, true);
 
         let wu = content.window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
         wu.forceUseCounterFlush(content.document);
 
@@ -287,23 +287,23 @@ var check_use_counter_direct = Task.asyn
   });
   
   // Tear down the page.
   gBrowser.removeTab(newTab);
 
   // The histograms only get recorded when the document actually gets
   // destroyed, which might not have happened yet due to GC/CC effects, etc.
   // Try to force document destruction.
-  yield waitForDestroyedDocuments();
+  await waitForDestroyedDocuments();
 
   // Grab histograms again and compare.
   let [histogram_page_after, histogram_document_after,
        histogram_docs_after, histogram_toplevel_docs_after] =
-      yield grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
+      await grabHistogramsFromContent(use_counter_middlefix, histogram_page_before);
   (xfail ? todo_is : is)(histogram_page_after, histogram_page_before + 1,
                          "page counts for " + use_counter_middlefix + " after are correct");
   (xfail ? todo_is : is)(histogram_document_after, histogram_document_before + 1,
                          "document counts for " + use_counter_middlefix + " after are correct");
   ok(histogram_toplevel_docs_after >= histogram_toplevel_docs_before + 1,
      "top level document counts are correct");
   ok(histogram_docs_after >= histogram_docs_before + 1,
      "document counts are correct");
-});
+};
--- a/dom/base/test/referrer_helper.js
+++ b/dom/base/test/referrer_helper.js
@@ -61,17 +61,17 @@ function resetState() {
       ok(false, "error in reset state");
       SimpleTest.finish();
     });
 }
 
 /**
  * testing if anchor and area referrer attributes are honoured (1174913)
  */
-var tests = (function() {
+var tests = (function*() {
 
   // enable referrer attribute
   yield SpecialPowers.pushPrefEnv({"set": [['network.http.enablePerElementReferrer', true]]}, advance);
   yield SpecialPowers.pushPrefEnv({"set": [['security.mixed_content.block_active_content', false]]}, advance);
   yield SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], advance);
 
   var iframe = document.getElementById("testframe");
 
@@ -92,11 +92,11 @@ var tests = (function() {
         }
         var schemeFrom = tests[i].SCHEME_FROM || "http";
         yield iframe.src = schemeFrom + SJS + searchParams.toString();
         yield checkIndividualResults(tests[i].DESC, tests[i].RESULT, tests[i].NAME);
       };
     };
   };
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
-})();
\ No newline at end of file
+  // complete.
+  SimpleTest.finish();
+})();
--- a/dom/base/test/test_audioNotificationSilent_audioFile.html
+++ b/dom/base/test/test_audioNotificationSilent_audioFile.html
@@ -23,21 +23,17 @@ var observer = {
   observe: function(subject, topic, data) {
     is(topic, "audio-playback", "audio-playback received");
     is(data, expectedPlaybackActive, "Corrrect audible state");
     continueTest();
   }
 };
 
 function continueTest() {
-  try {
-    generator.next();
-  } catch (e if e instanceof StopIteration) {
-    error("Stop test because of exception!");
-  }
+  generator.next();
 }
 
 function audioPlayingStart() {
   observerService.addObserver(observer, "audio-playback", false);
   ok(true, "Observer set");
 
   expectedPlaybackActive = 'active';
 
@@ -53,21 +49,21 @@ function audioBecomeSilentDuringPlaying(
 
 function finish() {
   observerService.removeObserver(observer, "audio-playback");
   ok(true, "Observer removed");
 
   SimpleTest.finish();
 }
 
-function runTest() {
+function* runTest() {
   yield audioPlayingStart();
 
   yield audioBecomeSilentDuringPlaying();
 
-  yield finish();
+  finish();
 }
 
 continueTest();
 
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>
--- a/dom/base/test/test_audioNotificationSilent_webAudio.html
+++ b/dom/base/test/test_audioNotificationSilent_webAudio.html
@@ -25,21 +25,17 @@ var observer = {
     is(topic, "audio-playback", "audio-playback received");
     is(data, expectedPlaybackActive, "Corrrect audible state");
     is(ac.state, expectedPlaying, "Corrrect playing state");
     continueTest();
   }
 };
 
 function continueTest() {
-  try {
-    generator.next();
-  } catch (e if e instanceof StopIteration) {
-    error("Stop test because of exception!");
-  }
+  generator.next();
 }
 
 function playOscillatorNode() {
   var dest = ac.destination;
   var osc = ac.createOscillator();
   osc.connect(dest);
   osc.start(0);
   osc.stop(ac.currentTime + audibleDuration);
@@ -81,23 +77,23 @@ function startAudioContext() {
       }
     }
   } else {
     ok(true, "AudioContext is running!");
     continueTest();
   }
 }
 
-function runTest() {
+function* runTest() {
   yield startAudioContext();
 
   yield audioPlayingStart();
 
   yield audioBecomeSilentDuringPlaying();
 
-  yield finish();
+  finish();
 }
 
 continueTest();
 
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>
--- a/dom/base/test/test_bug1163743.html
+++ b/dom/base/test/test_bug1163743.html
@@ -15,27 +15,27 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript;version=1.7">
 
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
  * testing legacy support for origin-when-crossorigin (1163743)
  */
-var tests = (function() {
+var tests = (function*() {
   var iframe = document.getElementById("testframe");
   const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test";
 
   // origin when crossorigin (trimming whitespace)
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape(' origin-when-crossorigin');
   yield checkIndividualResults("origin-when-cross-origin", ["origin", "full"]);
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 </script>
 </head>
 
 <body onload="tests.next();">
   <iframe id="testframe"></iframe>
 
--- a/dom/base/test/test_bug1165501.html
+++ b/dom/base/test/test_bug1165501.html
@@ -16,33 +16,33 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
  * testing if policy is overwritten if there are two meta statements (1165501)
  * XXX: would be nice to test this with CSP and meta as well
  */
-var tests = (function() {
+var tests = (function*() {
   var iframe = document.getElementById("testframe");
   const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test";
 
   // setting first unsafe-url and then origin - origin shall prevail
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape('origin')+ "&wrongPolicy=" + escape('unsafe-url');
   yield checkIndividualResults("unsafe-url then origin", ["origin"]);
 
   // setting first no-referrer and then default - default shall prevail
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape('default')+ "&wrongPolicy=" + escape('no-referrer');
   yield checkIndividualResults("no-referrer then default", ["full"]);
 
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 </script>
 </head>
 
 <body onload="tests.next();">
   <iframe id="testframe"></iframe>
 
--- a/dom/base/test/test_bug544642.html
+++ b/dom/base/test/test_bug544642.html
@@ -12,33 +12,31 @@
 <iframe id=iframe></iframe>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.8">
 SimpleTest.waitForExplicitFinish();
 var gen = runTest();
 
 addLoadEvent(function() { gen.next(); });
 
-function runTest() {
+function* runTest() {
   var iframe = $('iframe');
-  iframe.onerror = function() { gen.send("error"); };
-  iframe.onload = function() { gen.send("load"); };
+  iframe.onerror = function() { gen.next("error"); };
+  iframe.onload = function() { gen.next("load"); };
 
   iframe.src = "data:text/plain,hello";
   is((yield), "load", "plaintext data");
 
   iframe.src = "file://foo/bar";
   is((yield), "error", "file");
 
   // We should do this test too, however it brings up a modal dialog which
   // we can't dismiss.
   //iframe.src = "http:////";
   //is((yield), "error", "invalid http");
 
   SimpleTest.finish();
-  
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/base/test/test_bug590870.html
+++ b/dom/base/test/test_bug590870.html
@@ -10,28 +10,27 @@
 <body onload="gen.next()">
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=590870">Mozilla Bug 590870</a>
 <p id="display"></p>
 <iframe id=iframe></iframe>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.8">
 
 SimpleTest.waitForExplicitFinish();
-window.addEventListener("message", function(e) { gen.send(e.data) }, false);
+window.addEventListener("message", function(e) { gen.next(e.data) }, false);
 
 var gen = runTest();
 
-function runTest() {
+function* runTest() {
   var iframe = $('iframe');
   iframe.src = "http://noxul.example.com/tests/dom/base/test/file_bug590870.html";
   is((yield), true, "shouldn't be able to create XUL elements");
 
   iframe.src = "file_bug590870.html";
   is((yield), false, "should be able to create XUL elements");
 
   SimpleTest.finish();
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/base/test/test_bug682592.html
+++ b/dom/base/test/test_bug682592.html
@@ -46,24 +46,24 @@ if (navigator.platform.startsWith("Linux
 
 var page = `data:text/html;charset=UTF-8,<!DOCTYPE html>
 <html><body><p id="content"></p></body></html>`;
 var refFrame = document.getElementById("iframe-ref")
 var testFrame = document.getElementById("iframe-test");
 
 refFrame.addEventListener("load", function() {
   testFrame.addEventListener("load", function() {
-    try {
-      tests.next();
+    let {done} = tests.next();
+    if (!done) {
       ok(compareSnapshots(snapshotWindow(testFrame.contentWindow), 
                           snapshotWindow(refFrame.contentWindow), true)[0], 
          "bidi is not detected correctly");
 
       testFrame.contentWindow.location.reload();
-    } catch (err if err instanceof StopIteration) {
+    } else {
       SimpleTest.finish();
     }
   }, false);
   testFrame.src = page;
 }, false);
 refFrame.src = page;
 
 var rtl = "עִבְרִית";
@@ -73,17 +73,17 @@ var is8bit = "a";
 // concats aStr aNumber of times
 function strMult(aStr, aNumber) {
   if (aNumber === 0) {
     return "";
   }
   return strMult(aStr, aNumber - 1) + aStr;
 }
 
-function runTests () {
+function* runTests () {
   var ltr = "", prefix = null;
   var refContainer = refFrame.contentDocument.getElementById('content');
   var testContainer, textNode;
   var i = 0;
 
   // 8bit chars + bidi
   for (i = 0; i <= 16; i++) {
     ltr = strMult(is8bit, i);
--- a/dom/base/test/test_bug704320.html
+++ b/dom/base/test/test_bug704320.html
@@ -36,34 +36,34 @@ testIframeUrls = testIframeUrls.concat(g
 
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
  * This is the main test routine -- serialized by use of a generator.
  * It performs all tests in sequence using in the same iframe.
  */
-var tests = (function() {
+var tests = (function*() {
   SimpleTest.requestLongerTimeout(4);
   var iframe = document.getElementById("testframe");
   iframe.onload = function() {
      advance();
   }
 
   // load the test frame from testIframeUrls[url]
   // it will call back into this function via postMessage when it finishes loading.
   // and continue beyond the yield.
   for(url in testIframeUrls) {
     yield iframe.src = testIframeUrls[url];
     // run test and check result for loaded test URL
     yield checkExpectedGlobalResults();
   }
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 </script>
 </head>
 
 <body onload="tests.next();">
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704320">Mozilla Bug 704320 - HTTP/HTTPS to HTTPS/HTTP</a>
 <p id="display"></p>
--- a/dom/base/test/test_bug704320_policyset.html
+++ b/dom/base/test/test_bug704320_policyset.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
  * This is the main test routine -- serialized by use of a generator.
  * It resets the counter, then performs two tests in sequence using
  * the same iframe.
  */
-var tests = (function() {
+var tests = (function*() {
   var iframe = document.getElementById("testframe");
   const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test";
 
 
   // basic calibration check
   // reset the counter
   yield resetCounter();
 
@@ -84,18 +84,18 @@ var tests = (function() {
   yield iframe.src = sjs + "&policy=" + escape('no-referrer');
   yield checkIndividualResults("no-referrer", ["none"]);
 
   // Case insensitive
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape('\f OrigIn');
   yield checkIndividualResults("origin case insensitive", ["origin"]);
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 </script>
 </head>
 
 <body onload="tests.next();">
   <iframe id="testframe"></iframe>
 
--- a/dom/base/test/test_bug704320_policyset2.html
+++ b/dom/base/test/test_bug704320_policyset2.html
@@ -17,26 +17,26 @@ https://bugzilla.mozilla.org/show_bug.cg
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
  * This is the main test routine -- serialized by use of a generator.
  * It resets the counter, then performs two tests in sequence using
  * the same iframe.
  */
-var tests = (function() {
+var tests = (function*() {
   var iframe = document.getElementById("testframe");
   const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test";
 
   yield resetCounter();
   yield iframe.src = sjs + "&policy=" + escape(' \f\r\n\t  ');
   yield checkIndividualResults("whitespace only policy", ["full"]);
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 </script>
 </head>
 
 <body onload="tests.next();">
   <iframe id="testframe"></iframe>
 
--- a/dom/base/test/test_bug704320_preload.html
+++ b/dom/base/test/test_bug704320_preload.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
  * This is the main test routine -- serialized by use of a generator.
  * It resets the counter, then performs two tests in sequence using
  * the same iframe.
  */
-var tests = (function() {
+var tests = (function*() {
   var iframe = document.getElementById("testframe");
 
   // reset the counter
   yield resetCounter();
 
   // load the first test frame
   // it will call back into this function via postMessage when it finishes loading.
   // and continue beyond the yield.
@@ -42,18 +42,18 @@ var tests = (function() {
   // load the second test frame
   // it will call back into this function via postMessage when it finishes loading.
   // and continue beyond the yield.
   yield iframe.src = 'file_bug704320_preload_reuse.html';
 
   // check the second test
   yield checkResults(finalizePreloadReuse);
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 // Helper functions below.
 
 /**
  * This checks the first test: a test where the preloads should not
  * be reused.  * we expect two requests for each image, script, js request
  * since the referrer policy changed after speculative loads were started.
--- a/dom/base/test/test_change_policy.html
+++ b/dom/base/test/test_change_policy.html
@@ -73,17 +73,17 @@ function resetState() {
 }
 
 
 /**
  * This is the main test routine -- serialized by use of a generator.
  * It resets the counter, then performs two tests in sequence using
  * the same iframe.
  */
-var tests = (function() {
+var tests = (function*() {
   var iframe = document.getElementById("testframe");
   var sjs = "/tests/dom/base/test/referrer_change_server.sjs?action=generate-policy-test";
 
   yield resetState();
   var name = "no-referrer-unsafe-url";
   yield iframe.src = sjs + "&policy=" + escape('no-referrer') + "&name=" + name + "&newPolicy=" + escape('unsafe-url');
   yield checkIndividualResults("unsafe-url (changed) with no-referrer first", ["full"], [name+'unsafe-url']);
 
@@ -109,18 +109,18 @@ var tests = (function() {
   yield iframe.src = sjs + "&policy=" + escape('origin') + "&name=" + name + "&newPolicy=" + escape('no-referrer');
   yield checkIndividualResults("no-referrer (changed) with origin first", ["none"], [name+'no-referrer']);
 
   yield resetState();
   var name = "unsafe-url-no-referrer";
   yield iframe.src = sjs + "&policy=" + escape('unsafe-url') + "&name=" + name + "&newPolicy=" + escape('no-referrer');
   yield checkIndividualResults("no-referrer (changed) with unsafe-url first", ["none"], [name+'no-referrer']);
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 </script>
 </head>
 
 <body onload="tests.next();">
   <iframe id="testframe"></iframe>
 
--- a/dom/base/test/test_img_referrer.html
+++ b/dom/base/test/test_img_referrer.html
@@ -77,17 +77,17 @@ function resetState() {
       ok(false, "error in reset state");
       SimpleTest.finish();
     });
 }
 
 /**
  * testing if img referrer attribute is honoured (1165501)
  */
-var tests = (function() {
+var tests = (function*() {
 
   // enable referrer attribute
   yield SpecialPowers.pushPrefEnv({"set": [['network.http.enablePerElementReferrer', true]]}, advance);
 
   var iframe = document.getElementById("testframe");
   var sjs = "/tests/dom/base/test/img_referrer_testserver.sjs?action=generate-img-policy-test";
 
   // setting img unsafe-url and meta origin - unsafe-url shall prevail (should use speculative load)
@@ -169,18 +169,18 @@ var tests = (function() {
 
   yield resetState();
   sjs =
     "/tests/dom/base/test/img_referrer_testserver.sjs?action=generate-setAttribute-test2";
   name = 'set-invalid-referrer-policy-attribute-before-src-invalid';
   yield iframe.src = sjs + "&imgPolicy=" + escape('default') + "&policy=" + escape('unsafe-url') + "&name=" + name;
   yield checkIndividualResults("unsafe-url in meta, default in img", ["full"], [name]);
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield SimpleTest.finish();
+  // complete.
+  SimpleTest.finish();
 })();
 
 </script>
 </head>
 
 <body onload="tests.next();">
   <iframe id="testframe"></iframe>
 
--- a/dom/browser-element/mochitest/browserElement_ActiveStateChange.js
+++ b/dom/browser-element/mochitest/browserElement_ActiveStateChange.js
@@ -1,105 +1,94 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 
 var fileURL = 'chrome://mochitests/content/chrome/dom/browser-element/mochitest/file_browserElement_ActiveStateChange.html';
-var generator = runTests();
 var testFrame;
 var ac;
 
 function assert(aVal, aMessage) {
   return (!aVal) ? error(aMessage) : 0;
 }
 
 function error(aMessage) {
   ok(false, "Error : " + aMessage);
   finish();
 }
 
-function continueTest() {
-  try {
-    generator.next();
-  } catch (e if e instanceof StopIteration) {
-    error("Stop test because of exception!");
-  }
-}
-
 function finish() {
   document.body.removeChild(testFrame);
   SimpleTest.finish();
 }
 
 function setCommand(aArg) {
-  assert(!!ac, "Audio channel doesn't exist!");
-  info("# Command = " + aArg);
+  return new Promise(resolve => {
+    assert(!!ac, "Audio channel doesn't exist!");
+    info("# Command = " + aArg);
 
-  testFrame.src = fileURL + '#' + aArg;
-  var expectedActive = false;
-  switch (aArg) {
-    case 'play':
-      expectedActive = true;
-      break;
-    case 'pause':
-      expectedActive = false;
-      break;
-    default :
-      error("Undefined command!");
-  }
+    testFrame.src = fileURL + '#' + aArg;
+    var expectedActive = false;
+    switch (aArg) {
+      case 'play':
+        expectedActive = true;
+        break;
+      case 'pause':
+        expectedActive = false;
+        break;
+      default :
+        error("Undefined command!");
+    }
 
-  ac.onactivestatechanged = () => {
-    ac.onactivestatechanged = null;
-    ac.isActive().onsuccess = (e) => {
-      is(expectedActive, e.target.result,
-         "Correct active state = " + expectedActive);
-      continueTest();
-    }
-  };
+    ac.onactivestatechanged = () => {
+      ac.onactivestatechanged = null;
+      ac.isActive().onsuccess = (e) => {
+        is(expectedActive, e.target.result,
+           "Correct active state = " + expectedActive);
+        resolve();
+      };
+    };
+  });
 }
 
-function runTests() {
-  setCommand('play');
-  yield undefined;
+async function runTests() {
+  await setCommand('play');
 
-  setCommand('pause');
-  yield undefined;
+  await setCommand('pause');
 
   finish();
-  yield undefined;
 }
 
 function setupTestFrame() {
   testFrame = document.createElement('iframe');
   testFrame.setAttribute('mozbrowser', 'true');
   testFrame.src = fileURL;
 
   function loadend() {
-    testFrame.removeEventListener('mozbrowserloadend', loadend);
     ok("allowedAudioChannels" in testFrame, "allowedAudioChannels exist");
     var channels = testFrame.allowedAudioChannels;
     is(channels.length, 9, "9 audio channel by default");
 
     ac = channels[0];
 
     ok(ac instanceof BrowserElementAudioChannel, "Correct class");
     ok("isActive" in ac, "isActive exists");
     ok("onactivestatechanged" in ac, "onactivestatechanged exists");
 
-    generator.next();
+    runTests();
   }
 
   function alertError(e) {
     testFrame.removeEventListener('mozbrowsershowmodalprompt', alertError);
     var message = e.detail.message
     error(message);
   }
 
-  testFrame.addEventListener('mozbrowserloadend', loadend);
+  testFrame.addEventListener('mozbrowserloadend', loadend, {once: true});
   testFrame.addEventListener('mozbrowsershowmodalprompt', alertError);
   document.body.appendChild(testFrame);
 }
 
 addEventListener('testready', function() {
   SpecialPowers.pushPrefEnv({'set': [["b2g.system_startup_url", window.location.href]]},
                             function() {
     SimpleTest.executeSoon(setupTestFrame);
--- a/dom/browser-element/mochitest/browserElement_AudioChannelSeeking.js
+++ b/dom/browser-element/mochitest/browserElement_AudioChannelSeeking.js
@@ -27,21 +27,17 @@ function assert(aVal, aMessage) {
 }
 
 function error(aMessage) {
   ok(false, "Error : " + aMessage);
   finish();
 }
 
 function continueTest() {
-  try {
-    generator.next();
-  } catch (e if e instanceof StopIteration) {
-    error("Stop test because of exception!");
-  }
+  generator.next();
 }
 
 function finish() {
   testFrame.removeEventListener('mozbrowsershowmodalprompt', alertListener);
   ok(true, "Remove event-listener.");
   document.body.removeChild(testFrame);
   ok(true, "Remove test-frame from document.");
   SimpleTest.finish();
@@ -69,34 +65,33 @@ function setCommand(aArg) {
     case 'pause':
       ac.onactivestatechanged = null;
       break;
     default :
       error("Undefined command!");
   }
 }
 
-function runTests() {
+function* runTests() {
   setCommand('play');
   yield undefined;
 
   setCommand('seeking');
   yield undefined;
 
   setCommand('seeking');
   yield undefined;
 
   setCommand('seeking');
   yield undefined;
 
   setCommand('pause');
   yield undefined;
 
   finish();
-  yield undefined;
 }
 
 function setupTestFrame() {
   testFrame = document.createElement('iframe');
   testFrame.setAttribute('mozbrowser', 'true');
   testFrame.src = fileURL;
 
   function loadend() {
--- a/dom/browser-element/mochitest/browserElement_NoAudioTrack.js
+++ b/dom/browser-element/mochitest/browserElement_NoAudioTrack.js
@@ -20,46 +20,41 @@ function alertListener(e) {
 }
 
 function error(aMessage) {
   ok(false, "Error : " + aMessage);
   finish();
 }
 
 function continueTest() {
-  try {
-    generator.next();
-  } catch (e if e instanceof StopIteration) {
-    error("Stop test because of exception!");
-  }
+  generator.next();
 }
 
 function finish() {
   testFrame.removeEventListener('mozbrowsershowmodalprompt', alertListener);
   ok(true, "Remove event-listener.");
   document.body.removeChild(testFrame);
   ok(true, "Remove test-frame from document.");
   SimpleTest.finish();
 }
 
 function setCommand(aArg) {
   info("# Command = " + aArg);
   testFrame.src = fileURL + '#' + aArg;
 }
 
-function runTests() {
+function* runTests() {
   setCommand('play');
   yield undefined;
 
   // wait a second to make sure that onactivestatechanged isn't dispatched.
   setCommand('idle');
   yield undefined;
 
   finish();
-  yield undefined;
 }
 
 function setupTestFrame() {
   testFrame = document.createElement('iframe');
   testFrame.setAttribute('mozbrowser', 'true');
   testFrame.src = fileURL;
 
   function loadend() {
--- a/dom/devicestorage/test/test_app_permissions.html
+++ b/dom/devicestorage/test/test_app_permissions.html
@@ -427,17 +427,17 @@ function testComplete(iframe, data) {
 
   if (gData.length == 0) {
     SimpleTest.finish();
   } else {
     gTestRunner.next();
   }
 }
 
-function runTest() {
+function* runTest() {
   while (gData.length > 0) {
     var iframe = document.createElement('iframe');
     var data = gData.pop();
 
     iframe.setAttribute('mozbrowser', '');
 
     iframe.src = gTestUri;
 
--- a/dom/devicestorage/test/test_fs_app_permissions.html
+++ b/dom/devicestorage/test/test_fs_app_permissions.html
@@ -545,17 +545,17 @@ function testComplete(iframe, data) {
 
   if (gData.length == 0) {
     SimpleTest.finish();
   } else {
     gTestRunner.next();
   }
 }
 
-function runTest() {
+function* runTest() {
   while (gData.length > 0) {
     let iframe = document.createElement('iframe');
     let data = gData.shift();
 
     iframe.setAttribute('mozbrowser', '');
 
     iframe.src = gTestUri;
 
--- a/dom/events/test/bug426082.html
+++ b/dom/events/test/bug426082.html
@@ -56,29 +56,30 @@ function paintListener(e) {
     currentSnapshot = takeSnapshot();
   }
 }
 
 var gNeedsPaint = false;
 function executeTests() {
   var testYielder = tests();
   function execNext() {
-    try {
-      if (!gNeedsPaint) {
-        testYielder.next();
-        button.getBoundingClientRect(); // Flush.
-        gNeedsPaint = true;
+    if (!gNeedsPaint) {
+      let {done} = testYielder.next();
+      if (done) {
+        return;
       }
-      SimpleTest.executeSoon(execNext);
-    } catch (e) {}
+      button.getBoundingClientRect(); // Flush.
+      gNeedsPaint = true;
+    }
+    SimpleTest.executeSoon(execNext);
   }
   execNext();
 }
 
-function tests() {
+function* tests() {
   window.addEventListener("MozAfterPaint", paintListener, false);
   normalButtonCanvas = takeSnapshot();
   // Press the button.
   sendMouseEvent("mousemove", button);
   sendMouseEvent("mousedown", button);
   yield undefined;
   pressedFocusedButtonCanvas = takeSnapshot();
   compareSnapshots_(normalButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal buttons.");
--- a/dom/events/test/bug656379-1.html
+++ b/dom/events/test/bug656379-1.html
@@ -72,29 +72,30 @@ function paintListener(e) {
     currentSnapshot = takeSnapshot();
   }
 }
 
 var gNeedsPaint = false;
 function executeTests() {
   var testYielder = tests();
   function execNext() {
-    try {
-      if (!gNeedsPaint) {
-        testYielder.next();
-        button.getBoundingClientRect(); // Flush.
-        gNeedsPaint = true;
+    if (!gNeedsPaint) {
+      let {done} = testYielder.next();
+      if (done) {
+        return;
       }
-      SimpleTest.executeSoon(execNext);
-    } catch (e) {}
+      button.getBoundingClientRect(); // Flush.
+      gNeedsPaint = true;
+    }
+    SimpleTest.executeSoon(execNext);
   }
   execNext();
 }
 
-function tests() {
+function* tests() {
   window.addEventListener("MozAfterPaint", paintListener, false);
   normalButtonCanvas = takeSnapshot();
   // Press the button.
   sendMouseEvent("mousemove", button);
   sendMouseEvent("mousedown", button);
   yield undefined;
   pressedFocusedButtonCanvas = takeSnapshot();
   compareSnapshots_(normalButtonCanvas, pressedFocusedButtonCanvas, false, "Pressed focused buttons should look different from normal buttons.");
--- a/dom/events/test/test_bug415498.xul
+++ b/dom/events/test/test_bug415498.xul
@@ -47,30 +47,26 @@ https://bugzilla.mozilla.org/show_bug.cg
         }
       };
       gConsole.registerListener(gConsoleListener);
 
       nextTest();
     }
 
     function nextTest() {
-      try {
-        gTestsIterator.next();
-      } catch (err) {
-          ok(err instanceof StopIteration,
-             "Some other exception was thrown than what we expected!");
-
+      let {done} = gTestsIterator.next();
+      if (done) {
         if (gConsole && gConsoleListener) {
           gConsole.unregisterListener(gConsoleListener);
         }
         SimpleTest.finish();
       }
     }
 
-    function testsIterator() {
+    function* testsIterator() {
 
       var browser = $("browser");
       browser.addEventListener("load", function() {
         setTimeout(nextTest, 0)
       }, false);
 
       // 1) This document uses addEventListener to register a method throwing an exception
       var chromeDir = getRootDirectory(window.location.href);
--- a/dom/events/test/test_bug656379-2.html
+++ b/dom/events/test/test_bug656379-2.html
@@ -25,17 +25,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.8">
 
 /** Test for Bug 656379 **/
 SimpleTest.waitForExplicitFinish();
-function tests() {
+function* tests() {
   synthesizeMouseAtCenter($("label1"), { type: "mousemove" });
   yield undefined;
   is($("button1").matches(":hover"), true,
      "Button 1 should be hovered after mousemove over label1");
   is($("label1").matches(":hover"), true,
      "Label 1 should be hovered after mousemove over label1");
   is($("button2").matches(":hover"), false,
      "Button 2 should not be hovered after mousemove over label1");
@@ -62,20 +62,21 @@ function tests() {
   is($("label2").matches(":hover"), true,
      "Label 2 should be hovered after mousemove over label2");
   SimpleTest.finish();
 }
 
 function executeTests() {
   var testYielder = tests();
   function execNext() {
-    try {
-      testYielder.next();
-      SimpleTest.executeSoon(execNext);
-    } catch(e) {}
+    let {done} = testYielder.next();
+    if (done) {
+      return;
+    }
+    SimpleTest.executeSoon(execNext);
   }
   execNext();
 }
 
 SimpleTest.waitForFocus(executeTests);
 
 </script>
 </pre>
--- a/dom/file/tests/test_mozfiledataurl.html
+++ b/dom/file/tests/test_mozfiledataurl.html
@@ -5,31 +5,31 @@
   <title>Test for File urls</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body onload="start()">
 <p id="display">
 <iframe id=inner></iframe>
 <iframe id=iframe></iframe>
-<img id=img onload="gen.send(event);">
-<audio id=audio onloadeddata="gen.send(event);">
+<img id=img onload="gen.next(event);">
+<audio id=audio onloadeddata="gen.next(event);">
 </p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.8">
 
 try {
   URL.createObjectURL(undefined);
 } catch(e) { }
 
 window.addEventListener("message", function(e) {
-  gen.send(JSON.parse(e.data));
+  gen.next(JSON.parse(e.data));
 }, false);
 
 const innerSameSiteURI = "file_mozfiledataurl_inner.html";
 const innerCrossSiteURI = "http://example.com/tests/dom/base/test/file_mozfiledataurl_inner.html"
 
 var fileNames = ["file_mozfiledataurl_img.jpg",
                  "file_mozfiledataurl_audio.ogg",
                  "file_mozfiledataurl_doc.html",
@@ -54,22 +54,22 @@ function start() {
     gen.next();
   });
 
   script.sendAsyncMessage("create-file-objects", {fileNames: fullFileNames});
 };
 
 SimpleTest.waitForExplicitFinish();
 
-function runTest([imgFile, audioFile, docFile, xhrFile]) {
+function* runTest([imgFile, audioFile, docFile, xhrFile]) {
   inner = document.getElementById('inner');
   img = document.getElementById('img');
   audio = document.getElementById('audio');
   iframe = document.getElementById('iframe');
-  inner.onload = function() { gen.send("inner loaded"); };
+  inner.onload = function() { gen.next("inner loaded"); };
 
   // Attempt to load a image in this document
   var fileurl = URL.createObjectURL(imgFile);
   img.src = fileurl;
   var e = (yield);
   is(e.type, "load", "loaded successfully");
   is(img.width, 120, "correct width");
   is(img.height, 90, "correct height");
@@ -189,17 +189,17 @@ function runTest([imgFile, audioFile, do
   is((yield), "inner loaded", "correct gen.next()");
   inner.contentWindow.postMessage(JSON.stringify({iframe:fileurl}), "*");
   var res = (yield);
   is(res.type, "error", "load failed successfully");
 
   // Attempt to load file url using XHR
   fileurl = URL.createObjectURL(xhrFile);
   xhr = new XMLHttpRequest;
-  xhr.onload = function() { gen.send("XHR finished"); };
+  xhr.onload = function() { gen.next("XHR finished"); };
   xhr.open("GET", fileurl);
   xhr.send();
   is((yield), "XHR finished", "correct gen.next()");
   xhr.responseText == "Yarr, here be plaintext file, ya landlubber\n";
 
   // Attempt to load file url using XHR in inner document
   inner.src = innerSameSiteURI;
   is((yield), "inner loaded", "correct gen.next()");
@@ -211,15 +211,13 @@ function runTest([imgFile, audioFile, do
   // Attempt to load file url using XHR
   inner.src = innerCrossSiteURI;
   is((yield), "inner loaded", "correct gen.next()");
   inner.contentWindow.postMessage(JSON.stringify({xhr:fileurl}), "*");
   var res = (yield);
   is(res.didError, true, "load failed successfully");
 
   SimpleTest.finish();
-
-  yield undefined;
 }
 </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/forms/test_input_color_input_change_events.html
+++ b/dom/html/test/forms/test_input_color_input_change_events.html
@@ -20,17 +20,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   var MockColorPicker = SpecialPowers.MockColorPicker;
 
   var test = runTest();
 
   SimpleTest.waitForFocus(function() {
     test.next();
   });
 
-  function runTest() {
+  function* runTest() {
     MockColorPicker.init(window);
     var element = null;
 
     MockColorPicker.showCallback = function(picker, update) {
       is(picker.initialColor, element.value);
 
       var inputEvent = false;
       var changeEvent = false;
@@ -95,17 +95,16 @@ https://bugzilla.mozilla.org/show_bug.cg
       element = document.getElementsByTagName('input')[i];
       element.focus();
       synthesizeMouseAtCenter(element, {});
       yield undefined;
     };
 
     MockColorPicker.cleanup();
     SimpleTest.finish();
-    yield undefined;
   }
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=885996">Mozilla Bug 885996</a>
 <p id="display"></p>
 <div id="content">
--- a/dom/html/test/forms/test_input_color_picker_initial.html
+++ b/dom/html/test/forms/test_input_color_picker_initial.html
@@ -19,17 +19,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   var MockColorPicker = SpecialPowers.MockColorPicker;
 
   var test = runTest();
 
   SimpleTest.waitForFocus(function() {
     test.next();
   });
 
-  function runTest() {
+  function* runTest() {
     MockColorPicker.init(window);
     var element = null;
 
     MockColorPicker.showCallback = function(picker) {
       is(picker.initialColor, element.value);
       SimpleTest.executeSoon(function() {
         test.next();
       });
@@ -42,17 +42,16 @@ https://bugzilla.mozilla.org/show_bug.cg
         element.value = '#deadbe';
       }
       synthesizeMouseAtCenter(element, {});
       yield undefined;
     };
 
     MockColorPicker.cleanup();
     SimpleTest.finish();
-    yield undefined;
   }
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=885996">Mozilla Bug 885996</a>
 <p id="display"></p>
 <div id="content">
--- a/dom/html/test/forms/test_input_color_picker_popup.html
+++ b/dom/html/test/forms/test_input_color_picker_popup.html
@@ -40,17 +40,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     { id: 'div-click-on-demand', result: true },
   ];
   var currentTest = null;
 
   SimpleTest.waitForFocus(function() {
     test.next();
   });
 
-  function runTest() {
+  function* runTest() {
     MockColorPicker.init(window);
     var element = null;
 
     MockColorPicker.showCallback = function(picker) {
       ok(currentTest.result);
       SimpleTest.executeSoon(function() {
         test.next();
       });
@@ -107,17 +107,16 @@ https://bugzilla.mozilla.org/show_bug.cg
           });
         });
       }
       yield undefined;
     };
 
     MockColorPicker.cleanup();
     SimpleTest.finish();
-    yield undefined;
   }
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=885996">Mozilla Bug 885996</a>
 <p id="display"></p>
 <div id="content">
--- a/dom/html/test/forms/test_input_color_picker_update.html
+++ b/dom/html/test/forms/test_input_color_picker_update.html
@@ -21,17 +21,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   var MockColorPicker = SpecialPowers.MockColorPicker;
 
   var test = runTest();
 
   SimpleTest.waitForFocus(function() {
     test.next();
   });
 
-  function runTest() {
+  function* runTest() {
     MockColorPicker.init(window);
     var element = null;
 
     MockColorPicker.showCallback = function(picker, update) {
       is(picker.initialColor, element.value);
 
       if (element.dataset.type == 'update') {
         update('#f00ba4');
@@ -63,17 +63,16 @@ https://bugzilla.mozilla.org/show_bug.cg
     for (var i = 0; i < document.getElementsByTagName('input').length; ++i) {
       element = document.getElementsByTagName('input')[i];
       synthesizeMouseAtCenter(element, {});
       yield undefined;
     };
 
     MockColorPicker.cleanup();
     SimpleTest.finish();
-    yield undefined;
   }
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=885996">Mozilla Bug 885996</a>
 <p id="display"></p>
 <div id="content">
--- a/dom/html/test/forms/test_input_textarea_set_value_no_scroll.html
+++ b/dom/html/test/forms/test_input_textarea_set_value_no_scroll.html
@@ -84,26 +84,25 @@ https://bugzilla.mozilla.org/show_bug.cg
     results = compareSnapshots(baseSnapshot, tmpSnapshot, true);
     ok(results[0], "textarea view should look like the beginning");
 
     setTimeout(function() {
       gTestRunner.next();
     }, 0);
   }
 
-  function runTest()
+  function* runTest()
   {
     test('input');
     yield undefined;
     test('textarea');
     yield undefined;
     testCorrectUpdateOnScroll();
     yield undefined;
     SimpleTest.finish();
-    yield undefined;
   }
 
   gTestRunner = runTest();
 
   SimpleTest.waitForFocus(function() {
     gTestRunner.next();
   });;
 
--- a/dom/html/test/forms/test_input_typing_sanitization.html
+++ b/dom/html/test/forms/test_input_typing_sanitization.html
@@ -44,24 +44,19 @@ function sendKeyEventToSubmitForm() {
 }
 
 function urlify(aStr) {
   return aStr.replace(/:/g, '%3A');
 }
 
 function runTestsForNextInputType()
 {
-  try {
-    testRunner.next();
-  } catch (e) {
-    if (e.toString() == '[object StopIteration]') {
-      SimpleTest.finish();
-    } else {
-      throw StopIteration;
-    }
+  let {done} = testRunner.next();
+  if (done) {
+    SimpleTest.finish();
   }
 }
 
 function checkValueSubmittedIsValid()
 {
   is(frames['submit_frame'].location.href,
      'http://mochi.test:8888/tests/dom/html/test/forms/foo?i='
      + urlify(gValidData[valueIndex++]),
@@ -111,17 +106,17 @@ function testSubmissions() {
   submitMethod();
 }
 
 var valueIndex = 0;
 var submitMethod = submitForm;
 
 SimpleTest.waitForExplicitFinish();
 
-function runTest()
+function* runTest()
 {
   SimpleTest.requestLongerTimeout(4);
 
   var data = [
     {
       type: 'number',
       canHaveBadInputValidityState: true,
       validData: [
--- a/dom/html/test/test_anchor_ping.html
+++ b/dom/html/test/test_anchor_ping.html
@@ -18,21 +18,21 @@ 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() {
+  Task.spawn(function* run_tests() {
     while (tests.length) {
       let test = tests.shift();
       info("-- running " + test.name);
-      yield Task.spawn(test);
+      yield* test();
     }
 
     SimpleTest.finish();
   });
 });
 
 let tests = [
 
--- a/dom/html/test/test_bug209275.xhtml
+++ b/dom/html/test/test_bug209275.xhtml
@@ -95,17 +95,17 @@ function setXlinkHref(elem, href) {
 
 function continueTest() {
   gGen.next();
 }
 
 var iframe = document.getElementById("iframe");
 var iframeCw = iframe.contentWindow;
 
-function run() {
+function* run() {
   var iframe = document.getElementById("iframe");
   var iframeCw = iframe.contentWindow;
 
   // First, set the visited/unvisited link/ellipse colors.
   const unvisitedColor = "rgb(0, 0, 238)";
   const visitedColor = "rgb(85, 26, 139)";
   const unvisitedFill = "rgb(0, 0, 255)";
   const visitedFill = "rgb(128, 0, 128)";
@@ -240,17 +240,16 @@ function run() {
   // tags it has.
   iframeCw.location = "file_bug209275_3.html";
   yield undefined; // wait for callback from child
   is(iframeCw.document.getElementById("link").href,
      "http://mochi.test:8888/",
      "Wrong href after document.open().");
 
   SimpleTest.finish();
-  yield undefined;
 }
 
 window.addEventListener("load", function() {
   gGen = run();
   gGen.next();
 }, false);
 
 ]]>
--- a/dom/html/test/test_bug481335.xhtml
+++ b/dom/html/test/test_bug481335.xhtml
@@ -57,17 +57,17 @@ function checkLinkColor(aElmId, aExpecte
   while (getColor() != aExpectedColor) {
     setTimeout(continueTest, 0);
     return false;
   }
   is(getColor(), aExpectedColor, aMessage);
   return true;
 }
 
-function testIterator() {
+function* testIterator() {
   // After first load
   $("newparent").appendChild($("t"));
   is($("t").href, "http://www.example.com/" + rand,
      "Unexpected href after move");
   is($("t").href, "http://www.example.com/" + rand,
      "Unexpected cached href after move");
   while (!checkLinkColor("t", unvisitedColor, "Should be unvisited now"))
     yield undefined;
@@ -101,17 +101,16 @@ function testIterator() {
   yield undefined;
 
   // After third load
   while (!checkLinkColor("t", visitedColor,
                          "Should be visited now after third load")) {
     yield undefined;
   }
   SimpleTest.finish();
-  yield undefined;
 }
 
 addLoadEvent(function() {
   $("i").onload = continueTest;
   $("i").src = $("t").href;
 });
 ]]>
 </script>
--- a/dom/html/test/test_formSubmission.html
+++ b/dom/html/test/test_formSubmission.html
@@ -681,17 +681,17 @@ function setDisabled(list, state) {
 var gen;
 function onFilesSet() {
   gen = runTest();
   addLoadEvent(function() {
     gen.next();
   });
 }
 
-function runTest() {
+function* runTest() {
   // Set up the expectedSub array
   fileReader1 = new FileReader;
   fileReader1.readAsBinaryString(myFile1);
   fileReader2 = new FileReader;
   fileReader2.readAsBinaryString(myFile2);
   fileReader1.onload = fileReader2.onload = function() { gen.next(); };
   yield undefined; // Wait for both FileReaders. We don't care which order they finish.
   yield undefined;
@@ -811,15 +811,14 @@ function runTest() {
   addToFormData(fd);
   xhr.open("POST", "form_submit_server.sjs");
   xhr.send(fd);
   yield undefined;
   checkMPSubmission(JSON.parse(xhr.responseText),
                     expectedSub.concat(expectedAugment), "send augmented FormData");
 
   SimpleTest.finish();
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/html/test/test_formSubmission2.html
+++ b/dom/html/test/test_formSubmission2.html
@@ -157,17 +157,17 @@ function clickImage(aTarget, aX, aY)
   wu.sendMouseEvent('mousedown',  aX, aY, 0, 1, 0);
   wu.sendMouseEvent('mouseup',  aX, aY, 0, 0, 0);
 
   aTarget.style.position = "";
   aTarget.style.top = "";
   aTarget.style.left = "";
 }
 
-function runTest() {
+function* runTest() {
   // Make normal submission
   var form = $("form");
   var iframe = $("target_iframe");
   iframe.onload = function() { gen.next(); };
 
   var elements = form.querySelectorAll("input, button");
 
   is(elements.length, expectedSub.length,
@@ -207,15 +207,14 @@ function runTest() {
     elem.disabled = false;
     form.onsubmit = undefined;
 
     var submission = JSON.parse(iframe.contentDocument.documentElement.textContent);
     checkSubmission(submission, []);
   }
 
   SimpleTest.finish();
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/indexedDB/test/browserHelpers.js
+++ b/dom/indexedDB/test/browserHelpers.js
@@ -11,17 +11,17 @@ var testException;
 function runTest()
 {
   testGenerator.next();
 }
 
 function finishTestNow()
 {
   if (testGenerator) {
-    testGenerator.close();
+    testGenerator.return();
     testGenerator = undefined;
   }
 }
 
 function finishTest()
 {
   setTimeout(finishTestNow, 0);
   setTimeout(() => {
@@ -35,17 +35,17 @@ function finishTest()
         message = testException;
       window.parent.postMessage(message, "*");
     }
   }, 0);
 }
 
 function grabEventAndContinueHandler(event)
 {
-  testGenerator.send(event);
+  testGenerator.next(event);
 }
 
 function errorHandler(event)
 {
   throw new Error("indexedDB error, code " + event.target.error.name);
 }
 
 function continueToNextStep()
--- a/dom/indexedDB/test/browser_forgetThisSiteAdd.html
+++ b/dom/indexedDB/test/browser_forgetThisSiteAdd.html
@@ -2,17 +2,17 @@
   Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript;version=1.7">
-      function testSteps()
+      function* testSteps()
       {
         let request = indexedDB.open("browser_forgetThisSite.js", 11);
         request.onerror = grabEventAndContinueHandler;
         request.onupgradeneeded = grabEventAndContinueHandler;
         let event = yield undefined;
 
         if (event.type == "error") {
           testException = event.target.error.name;
--- a/dom/indexedDB/test/browser_forgetThisSiteGet.html
+++ b/dom/indexedDB/test/browser_forgetThisSiteGet.html
@@ -2,17 +2,17 @@
   Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript;version=1.7">
-      function testSteps()
+      function* testSteps()
       {
         let request = indexedDB.open("browser_forgetThisSite.js");
         request.onerror = grabEventAndContinueHandler;
         request.onsuccess = grabEventAndContinueHandler;
         let event = yield undefined;
 
         if (event.type == "error") {
           testException = event.target.error.name;
--- a/dom/indexedDB/test/browser_permissionsPrompt.html
+++ b/dom/indexedDB/test/browser_permissionsPrompt.html
@@ -3,17 +3,17 @@
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <meta charset=UTF-8>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript;version=1.7">
-      function testSteps()
+      function* testSteps()
       {
         const name = window.location.pathname;
 
         let request = indexedDB.open(name, { version: 1,
                                              storage: "persistent" });
         request.onerror = grabEventAndContinueHandler;
         request.onsuccess = grabEventAndContinueHandler;
         let event = yield undefined;
--- a/dom/indexedDB/test/browser_permissionsPromptDeny.js
+++ b/dom/indexedDB/test/browser_permissionsPromptDeny.js
@@ -17,17 +17,17 @@ function promiseMessage(aMessage, browse
           resolve();
         else
           reject();
       });
     });
   });
 }
 
-add_task(function test1() {
+add_task(function* test1() {
   removePermission(testPageURL, "indexedDB");
 
   info("creating tab");
   gBrowser.selectedTab = gBrowser.addTab();
 
   info("loading test page: " + testPageURL);
   gBrowser.selectedBrowser.loadURI(testPageURL);
   yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
@@ -46,17 +46,17 @@ add_task(function test1() {
   yield promiseMessage("InvalidStateError", gBrowser);
 
   is(getPermission(testPageURL, "indexedDB"),
      Components.interfaces.nsIPermissionManager.DENY_ACTION,
      "Correct permission set");
   gBrowser.removeCurrentTab();
 });
 
-add_task(function test2() {
+add_task(function* test2() {
   info("creating private window");
   let win = yield BrowserTestUtils.openNewBrowserWindow({ private : true });
   
   info("creating private tab");
   win.gBrowser.selectedTab = win.gBrowser.addTab();
 
   info("loading test page: " + testPageURL);
   win.gBrowser.selectedBrowser.loadURI(testPageURL);
@@ -76,17 +76,17 @@ add_task(function test2() {
   is(getPermission(testPageURL, "indexedDB"),
      Components.interfaces.nsIPermissionManager.DENY_ACTION,
      "Correct permission set");
   unregisterAllPopupEventHandlers();
   win.gBrowser.removeCurrentTab();
   win.close();
 });
 
-add_task(function test3() {
+add_task(function* test3() {
   info("creating tab");
   gBrowser.selectedTab = gBrowser.addTab();
 
   info("loading test page: " + testPageURL);
   gBrowser.selectedBrowser.loadURI(testPageURL);
   yield BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
 
   registerPopupEventHandler("popupshowing", function () {
--- a/dom/indexedDB/test/chromeHelpers.js
+++ b/dom/indexedDB/test/chromeHelpers.js
@@ -14,24 +14,24 @@ if (!window.runTest) {
 
     testGenerator.next();
   }
 }
 
 function finishTest()
 {
   SimpleTest.executeSoon(function() {
-    testGenerator.close();
+    testGenerator.return();
     SimpleTest.finish();
   });
 }
 
 function grabEventAndContinueHandler(event)
 {
-  testGenerator.send(event);
+  testGenerator.next(event);
 }
 
 function continueToNextStep()
 {
   SimpleTest.executeSoon(function() {
     testGenerator.next();
   });
 }
--- a/dom/indexedDB/test/error_events_abort_transactions_iframe.html
+++ b/dom/indexedDB/test/error_events_abort_transactions_iframe.html
@@ -16,44 +16,43 @@
                                 "');", "*");
     }
 
     function is(a, b, message) {
       ok(a == b, message);
     }
 
     function grabEventAndContinueHandler(event) {
-      testGenerator.send(event);
+      testGenerator.next(event);
     }
 
     function errorHandler(event) {
       ok(false, "indexedDB error, code " + event.target.errorCcode);
       finishTest();
     }
 
     function unexpectedSuccessHandler(event) {
       ok(false, "got success when it was not expected!");
       finishTest();
     }
 
     function finishTest() {
       // Let window.onerror have a chance to fire
       setTimeout(function() {
         setTimeout(function() {
-          testGenerator.close();
           window.parent.postMessage("SimpleTest.finish();", "*");
         }, 0);
       }, 0);
     }
 
     window.onerror = function(message, filename, lineno) {
       is(message, "ConstraintError", "Expect a constraint error");
     };
 
-    function testSteps() {
+    function* testSteps() {
       window.parent.SpecialPowers.addPermission("indexedDB", true, document);
 
       let request = indexedDB.open(window.location.pathname, 1);
       request.onsuccess = unexpectedSuccessHandler;
       request.onerror = grabEventAndContinueHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       let event = yield undefined;
 
@@ -225,17 +224,16 @@
 
       event = yield undefined;
       is(event.type, "error", "Got request error event");
       is(event.target.error.name, "AbortError", "Right error");
       // Skip the verification of ConstraintError in window.onerror.
       event.preventDefault();
 
       finishTest();
-      yield undefined;
     }
   </script>
 
 </head>
 
 <body onload="testGenerator.next();"></body>
 
 </html>
--- a/dom/indexedDB/test/event_propagation_iframe.html
+++ b/dom/indexedDB/test/event_propagation_iframe.html
@@ -12,29 +12,29 @@
 
     function ok(val, message) {
       val = val ? "true" : "false";
       window.parent.postMessage("SimpleTest.ok(" + val + ", '" + message +
                                 "');", "*");
     }
 
     function grabEventAndContinueHandler(event) {
-      testGenerator.send(event);
+      testGenerator.next(event);
     }
 
     function errorHandler(event) {
       ok(false, "indexedDB error, code " + event.target.error.name);
       finishTest();
     }
 
     function finishTest() {
       // Let window.onerror have a chance to fire
       setTimeout(function() {
         setTimeout(function() {
-          testGenerator.close();
+          testGenerator.return();
           ok(windowErrorCount == 1, "Good window.onerror count");
           window.parent.postMessage("SimpleTest.finish();", "*");
         }, 0);
       }, 0);
     }
 
     const eventChain = [
       "IDBRequest",
@@ -81,17 +81,17 @@
 
         captureCount = bubbleCount = atTargetCount = 0;
         if (windowErrorCount) {
           finishTest();
         }
       }
     }
 
-    function testSteps() {
+    function* testSteps() {
       window.parent.SpecialPowers.addPermission("indexedDB", true, document);
 
       let request = indexedDB.open(window.location.pathname, 1);
       request.onerror = errorHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       let event = yield undefined;
 
       let db = event.target.result;
--- a/dom/indexedDB/test/exceptions_in_events_iframe.html
+++ b/dom/indexedDB/test/exceptions_in_events_iframe.html
@@ -18,44 +18,44 @@
                                 "');", "*");
     }
 
     function is(a, b, message) {
       ok(a == b, message);
     }
 
     function grabEventAndContinueHandler(event) {
-      testGenerator.send(event);
+      testGenerator.next(event);
     }
 
     function errorHandler(event) {
       ok(false, "indexedDB error, code " + event.target.error.name);
       finishTest();
     }
 
     function unexpectedSuccessHandler(event) {
       ok(false, "got success when it was not expected!");
       finishTest();
     }
 
     function finishTest() {
       // Let window.onerror have a chance to fire
       setTimeout(function() {
         setTimeout(function() {
-          testGenerator.close();
+          testGenerator.return();
           window.parent.postMessage("SimpleTest.finish();", "*");
         }, 0);
       }, 0);
     }
 
     window.onerror = function() {
       return false;
     };
 
-    function testSteps() {
+    function* testSteps() {
       window.parent.SpecialPowers.addPermission("indexedDB", true, document);
 
       // Test 1: Throwing an exception in an upgradeneeded handler should
       // abort the versionchange transaction and fire an error at the request.
       let request = indexedDB.open(window.location.pathname, 1);
       request.onerror = errorHandler;
       request.onsuccess = unexpectedSuccessHandler;
       request.onupgradeneeded = function () {
--- a/dom/indexedDB/test/file.js
+++ b/dom/indexedDB/test/file.js
@@ -85,17 +85,17 @@ function getNullFile(name, size)
   return getFile(name, "binary/null", getView(size));
 }
 
 // This needs to be async to make it available on workers too.
 function getWasmBinary(text)
 {
   let binary = getWasmBinarySync(text);
   SimpleTest.executeSoon(function() {
-    testGenerator.send(binary);
+    testGenerator.next(binary);
   });
 }
 
 function getWasmModule(binary)
 {
   let module = new WebAssembly.Module(binary);
   return module;
 }
@@ -215,17 +215,17 @@ function verifyWasmModule(module1, modul
   ok(code2 instanceof getGlobalForObject(code1).Uint8Array, "Instance of Uint8Array");
   ok(code1.length == code2.length, "Correct length");
   verifyBuffers(code1, code2);
   continueToNextStep();
 }
 
 function grabFileUsageAndContinueHandler(request)
 {
-  testGenerator.send(request.fileUsage);
+  testGenerator.next(request.fileUsage);
 }
 
 function getUsage(usageHandler)
 {
   let qms = SpecialPowers.Services.qms;
   let principal = SpecialPowers.wrap(document).nodePrincipal;
   let cb = SpecialPowers.wrapCallback(usageHandler);
   qms.getUsageForPrincipal(principal, cb);
--- a/dom/indexedDB/test/helpers.js
+++ b/dom/indexedDB/test/helpers.js
@@ -41,17 +41,17 @@ function clearAllDatabases(callback) {
   request.callback = cb;
 }
 
 var testHarnessGenerator = testHarnessSteps();
 testHarnessGenerator.next();
 
 function testHarnessSteps() {
   function nextTestHarnessStep(val) {
-    testHarnessGenerator.send(val);
+    testHarnessGenerator.next(val);
   }
 
   let testScriptPath;
   let testScriptFilename;
 
   let scripts = document.getElementsByTagName("script");
   for (let i = 0; i < scripts.length; i++) {
     let src = scripts[i].src;
@@ -217,35 +217,32 @@ if (!window.runTest) {
 
 function finishTest()
 {
   SpecialPowers.notifyObserversInParentProcess(null,
                                                "disk-space-watcher",
                                                "free");
 
   SimpleTest.executeSoon(function() {
-    testGenerator.close();
-    testHarnessGenerator.close();
     clearAllDatabases(function() { SimpleTest.finish(); });
   });
 }
 
 function browserRunTest()
 {
   testGenerator.next();
 }
 
 function browserFinishTest()
 {
-  setTimeout(function() { testGenerator.close(); }, 0);
 }
 
 function grabEventAndContinueHandler(event)
 {
-  testGenerator.send(event);
+  testGenerator.next(event);
 }
 
 function continueToNextStep()
 {
   SimpleTest.executeSoon(function() {
     testGenerator.next();
   });
 }
@@ -437,17 +434,17 @@ function workerScript() {
     if (self._expectingUncaughtException) {
       self.ok(false, "expectUncaughtException was called but no uncaught "
                      + "exception was detected!");
     }
     self.postMessage({ op: "done" });
   };
 
   self.grabEventAndContinueHandler = function(_event_) {
-    testGenerator.send(_event_);
+    testGenerator.next(_event_);
   };
 
   self.continueToNextStep = function() {
     executeSoon(function() {
       testGenerator.next();
     });
   };
 
@@ -603,17 +600,17 @@ function workerScript() {
         info("Worker: all databases are cleared");
         if (self._clearAllDatabasesCallback) {
           self._clearAllDatabasesCallback();
         }
         break;
 
       case "getWasmBinaryDone":
         info("Worker: get wasm binary done");
-        testGenerator.send(message.wasmBinary);
+        testGenerator.next(message.wasmBinary);
         break;
 
       default:
         throw new Error("Received a bad message from parent: " +
                         JSON.stringify(message));
     }
   };
 
--- a/dom/indexedDB/test/test_bfcache.html
+++ b/dom/indexedDB/test/test_bfcache.html
@@ -28,17 +28,17 @@
                                  gOrigMaxTotalViewers);
         gOrigMaxTotalViewers = undefined;
         try {
           SpecialPowers.clearUserPref("browser.sessionhistory.cache_subframes");
         } catch (e) { /* Pref didn't exist, meh */ }
       }
     }
 
-    function testSteps()
+    function* testSteps()
     {
       var iframe = $("iframe");
       setCachePref(true);
       window.onmessage = grabEventAndContinueHandler;
 
       iframe.src = "bfcache_iframe1.html";
       var event = yield undefined;
       is(event.data, "go", "set up database successfully");
@@ -48,17 +48,16 @@
       is(res.version, 2, "version was set correctly");
       is(res.storeCount, 1, "correct set of stores");
       ok(!("blockedFired" in res), "blocked shouldn't fire");
       is(res.value, JSON.stringify({ hello: "world" }),
          "correct value found in store");
 
       setCachePref(false);
       finishTest();
-      yield undefined;
     }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();">
   <iframe id="iframe"></iframe>
--- a/dom/indexedDB/test/test_blob_archive.html
+++ b/dom/indexedDB/test/test_blob_archive.html
@@ -6,17 +6,17 @@
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
 
-  function testSteps()
+  function* testSteps()
   {
     const BLOB_DATA =
       "504B03040A00000000002E6BF14000000000000000000000000005001C00746573742F" +
       "555409000337CA055039CA055075780B000104E803000004E8030000504B0304140000" +
       "0008002D6BF1401780E15015000000580200000A001C00746573742F612E7478745554" +
       "09000336CA05503ACA055075780B000104E803000004E8030000CB48CDC9C95728CF2F" +
       "CA49E1CA18658FB2A9C40600504B03040A00000000002F88EC40662E84701000000010" +
       "0000000A001C00746573742F622E74787455540900035A65FF4F42C5055075780B0001" +
@@ -110,17 +110,16 @@
     fileReader.onload = grabEventAndContinueHandler;
     fileReader.onerror = errorHandler;
     event = yield undefined;
 
     // Don't use is() because it prints out a newline...
     ok(event.target.result == TEST_FILE_2_CONTENTS, "Correct text");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_blob_simple.html
+++ b/dom/indexedDB/test/test_blob_simple.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     info("Setting up test fixtures: create an IndexedDB database and object store.");
 
     let request = indexedDB.open(window.location.pathname, 1);
     request.onerror = errorHandler;
     request.onupgradeneeded = grabEventAndContinueHandler;
     request.onsuccess = unexpectedSuccessHandler;
     let event = yield undefined;
@@ -264,17 +264,16 @@
     yield undefined;
 
     URL.revokeObjectURL(blobURL);
 
     is(xhr.responseText, BLOB_DATA.join(""), "Correct responseText");
 
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_blob_worker_crash.html
+++ b/dom/indexedDB/test/test_blob_worker_crash.html
@@ -15,17 +15,17 @@
    * worker and the database has already been shutdown, that there is no crash
    * when the owning page gets cleaned up which causes the termination of the
    * worker which in turn garbage collects during its shutdown.
    *
    * We do the IndexedDB stuff in the iframe so we can kill it as part of our
    * test.  Doing it out here is no good.
    */
 
-  function testSteps()
+  function* testSteps()
   {
     info("Open iframe, wait for it to do its IndexedDB stuff.");
 
     let iframe = document.getElementById("iframe1");
     window.addEventListener("message", grabEventAndContinueHandler, false);
     // Put it in a different origin to be safe
     iframe.src = //"http://example.org" +
                  window.location.pathname.replace(
@@ -44,17 +44,16 @@
     iframe = null;
     scheduleGC();
     yield undefined;
 
     info("If we are still alive, then we win!");
     ok('Did not crash / trigger an assert!');
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
   <iframe id="iframe1"></iframe>
--- a/dom/indexedDB/test/test_blob_worker_xhr_post.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_post.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const BLOB_DATA = ["fun ", "times ", "all ", "around!"];
     const BLOB_TYPE = "text/plain";
     const BLOB_SIZE = BLOB_DATA.join("").length;
 
     info("Setting up");
 
     let request = indexedDB.open(window.location.pathname, 1);
@@ -96,17 +96,16 @@
     event = yield undefined;
 
     is(event.data.status, 404, "XHR generated the expected 404");
     xhrWorker.terminate();
 
     URL.revokeObjectURL(workerScriptUrl);
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_blob_worker_xhr_post_multifile.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_post_multifile.html
@@ -11,17 +11,17 @@
 
   <script type="text/javascript;version=1.7">
   /**
    * Create a composite/multi-file Blob on the worker, then post it as an XHR
    * payload and ensure that we don't hang/generate an assertion/etc. but
    * instead generate the expected 404.  This test is basically the same as
    * test_blob_worker_xhr_post.html except for the composite Blob.
    */
-  function testSteps()
+  function* testSteps()
   {
     const BLOB_DATA = ["fun ", "times ", "all ", "around!"];
     const BLOB_TYPE = "text/plain";
     const BLOB_SIZE = BLOB_DATA.join("").length;
 
     info("Setting up");
 
     let request = indexedDB.open(window.location.pathname, 1);
@@ -96,17 +96,16 @@
     event = yield undefined;
 
     is(event.data.status, 404, "XHR generated the expected 404");
     xhrWorker.terminate();
 
     URL.revokeObjectURL(workerScriptUrl);
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_blob_worker_xhr_read.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_read.html
@@ -10,17 +10,17 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
   /**
    * Create an IndexedDB-backed Blob, send it to the worker, try and read the
    * contents of the Blob from the worker using an XHR.  Ideally, we don't
    * deadlock the main thread.
    */
-  function testSteps()
+  function* testSteps()
   {
     const BLOB_DATA = ["Green"];
     const BLOB_TYPE = "text/plain";
     const BLOB_SIZE = BLOB_DATA.join("").length;
 
     info("Setting up");
 
     let request = indexedDB.open(window.location.pathname, 1);
@@ -97,17 +97,16 @@
     event = yield undefined;
 
     is(event.data.data, "Green", "XHR returned expected payload.");
     xhrWorker.terminate();
 
     URL.revokeObjectURL(workerScriptUrl);
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_blob_worker_xhr_read_slice.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_read_slice.html
@@ -11,17 +11,17 @@
 
   <script type="text/javascript;version=1.7">
   /**
    * Create an IndexedDB-backed Blob, send it to the worker, try and read the
    * *SLICED* contents of the Blob from the worker using an XHR.  This is
    * (as of the time of writing this) basically the same as
    * test_blob_worker_xhr_read.html but with slicing added.
    */
-  function testSteps()
+  function* testSteps()
   {
     const BLOB_DATA = ["Green"];
     const BLOB_TYPE = "text/plain";
     const BLOB_SIZE = BLOB_DATA.join("").length;
 
     info("Setting up");
 
     let request = indexedDB.open(window.location.pathname, 1);
@@ -99,17 +99,16 @@
     event = yield undefined;
 
     is(event.data.data, "Gre", "XHR returned expected sliced payload.");
     xhrWorker.terminate();
 
     URL.revokeObjectURL(workerScriptUrl);
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_file_array.html
+++ b/dom/indexedDB/test/test_file_array.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const b1 = getRandomBlob(10000);
 
     const b2 = [ getRandomBlob(5000), getRandomBlob(3000), getRandomBlob(12000),
@@ -69,17 +69,16 @@
 
       verifyBlobArray(event.target.result, data.blobs, data.expectedFileIds);
       yield undefined;
     }
 
     is(bufferCache.length, 11, "Correct length");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_cross_database_copying.html
+++ b/dom/indexedDB/test/test_file_cross_database_copying.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const databaseInfo = [
       { name: window.location.pathname + "1" },
       { name: window.location.pathname + "2" }
     ];
 
@@ -90,17 +90,16 @@
       yield undefined;
 
       isnot(getFilePath(result), getFilePath(refResult), "Different os files");
     }
 
     is(bufferCache.length, 2, "Correct length");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_delete.html
+++ b/dom/indexedDB/test/test_file_delete.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const fileData1 = { key: 1, file: getRandomFile("random1.bin", 110000) };
@@ -119,17 +119,16 @@
     scheduleGC();
     yield undefined;
 
     ok(!hasFileInfo(name, 1), "Correct ref count");
     ok(!hasFileInfo(name, 2), "Correct ref count");
     ok(!hasFileInfo(name, 3), "Correct ref count");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_os_delete.html
+++ b/dom/indexedDB/test/test_file_os_delete.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     getUsage(grabFileUsageAndContinueHandler);
@@ -91,17 +91,16 @@
     flushPendingFileDeletions();
 
     getUsage(grabFileUsageAndContinueHandler);
     let endUsage = yield undefined;
 
     is(endUsage, startUsage, "OS files deleted");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_put_get_object.html
+++ b/dom/indexedDB/test/test_file_put_get_object.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const blob = getRandomBlob(1000);
@@ -72,17 +72,16 @@
 
     verifyBlob(result.foo, file, 2);
     yield undefined;
 
     verifyBlob(result.bar, file, 2);
     yield undefined;
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_put_get_values.html
+++ b/dom/indexedDB/test/test_file_put_get_values.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const blobData = { key: 1, blob: getRandomBlob(10000) };
@@ -86,17 +86,16 @@
     event = yield undefined;
 
     verifyBlob(event.target.result, fileData.file, 2);
     yield undefined;
 
     is(bufferCache.length, 2, "Correct length");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_replace.html
+++ b/dom/indexedDB/test/test_file_replace.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const blobData = { key: 42, blobs: [] };
 
     for (let i = 0; i < 100; i++) {
@@ -52,17 +52,16 @@
       let dbRefs = {};
       let hasFileInfo = utils.getFileReferences(name, id, null, refs, dbRefs);
       ok(hasFileInfo, "Has file info");
       is(refs.value, 1, "Correct ref count");
       is(dbRefs.value, id / 100 >> 0, "Correct db ref count");
     }
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_resurrection_delete.html
+++ b/dom/indexedDB/test/test_file_resurrection_delete.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const fileData = { key: 1, file: getRandomFile("random.bin", 100000) };
@@ -115,17 +115,16 @@
     }
 
     scheduleGC();
     yield undefined;
 
     is(getFileRefCount(name, 1), 0, "Correct ref count");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_resurrection_transaction_abort.html
+++ b/dom/indexedDB/test/test_file_resurrection_transaction_abort.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const fileData = { key: 1, file: getRandomFile("random.bin", 100000) };
@@ -74,17 +74,16 @@
     }
 
     scheduleGC();
     yield undefined;
 
     is(getFileRefCount(name, 1), 0, "Correct ref count");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_sharing.html
+++ b/dom/indexedDB/test/test_file_sharing.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreInfo = [
       { name: "Blobs", options: { } },
       { name: "Other Blobs", options: { } }
@@ -85,17 +85,16 @@
       yield undefined;
 
       is(getFilePath(result), getFilePath(refResult), "The same os file");
     }
 
     is(bufferCache.length, 2, "Correct length");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_file_transaction_abort.html
+++ b/dom/indexedDB/test/test_file_transaction_abort.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const fileData = { key: 1, file: getRandomFile("random.bin", 100000) };
@@ -59,17 +59,16 @@
     }
 
     scheduleGC();
     yield undefined;
 
     ok(!hasFileInfo(name, 1), "Correct ref count");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_filehandle_compat.html
+++ b/dom/indexedDB/test/test_filehandle_compat.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -35,17 +35,16 @@
 
     request = lockedFile.getMetadata({ size: true });
     ok(request.lockedFile === lockedFile, "Correct property");
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_disabled_pref.html
+++ b/dom/indexedDB/test/test_filehandle_disabled_pref.html
@@ -8,17 +8,17 @@
 
     <script type="text/javascript"
             src="/tests/SimpleTest/SimpleTest.js">
     </script>
 
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
     <script type="text/javascript;version=1.7">
-      function testSteps()
+      function* testSteps()
       {
         const databaseName = window.location.pathname;
         const databaseVersion = 1;
         const objectStoreName = "foo";
         const mutableFileName = "bar";
         const mutableFileKey = 42;
 
         info("opening database");
@@ -185,17 +185,16 @@
         event = yield undefined;
 
         info("resetting file handle pref");
 
         SpecialPowers.popPrefEnv(continueToNextStep);
         yield undefined;
 
         finishTest();
-        yield undefined;
       }
     </script>
 
     <script type="text/javascript;version=1.7" src="helpers.js"></script>
     <script type="text/javascript;version=1.7" src="file.js"></script>
 
   </head>
 
--- a/dom/indexedDB/test/test_filehandle_getFile.html
+++ b/dom/indexedDB/test/test_filehandle_getFile.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -36,17 +36,16 @@
     ok(!('fileHandle' in request), "Property should not exist");
     ok(request.fileHandle === undefined, "Property should not exist");
     ok(!('lockedFile' in request), "Property should not exist");
     ok(request.lockedFile === undefined, "Property should not exist");
     ok(!('onprogress' in request), "Property should not exist");
     ok(request.onprogress === undefined, "Property should not exist");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_iteration.html
+++ b/dom/indexedDB/test/test_filehandle_iteration.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const dbName = window.location.pathname;
     const dbVersion = 1;
     const objectStoreName = "foo";
     const entryCount = 10;
 
     let request = indexedDB.open(dbName, dbVersion);
     request.onerror = errorHandler;
@@ -60,17 +60,16 @@
         continueToNextStep();
       }
     }
     yield undefined;
 
     is(seenEntryCount, entryCount, "Correct entry count");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_lifetimes.html
+++ b/dom/indexedDB/test/test_filehandle_lifetimes.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -40,17 +40,16 @@
     }
     catch (e) {
       ok(e instanceof DOMException, "Got exception.");
       is(e.name, "FileHandleInactiveError", "Good error.");
       is(e.code, 0, "Good error code.");
     }
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_lifetimes_nested.html
+++ b/dom/indexedDB/test/test_filehandle_lifetimes_nested.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -52,17 +52,16 @@
     }
 
     ok(fileHandle2, "Non-null fileHandle2");
 
     continueToNextStep();
     yield undefined;
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_location.html
+++ b/dom/indexedDB/test/test_filehandle_location.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -87,17 +87,16 @@
 
     request = fileHandle.truncate(0);
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
     is(fileHandle.location, 0, "Correct location");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_ordering.html
+++ b/dom/indexedDB/test/test_filehandle_ordering.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -45,17 +45,16 @@
     let fileHandle3 = mutableFile.open("readonly");
     let request3 = fileHandle3.readAsText(1);
     request3.onsuccess = grabEventAndContinueHandler;
 
     event = yield undefined;
     is(event.target.result, "2", "File handles were ordered properly.");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_overlapping.html
+++ b/dom/indexedDB/test/test_filehandle_overlapping.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -56,17 +56,16 @@
 
       stepNumber++;
       yield undefined; yield undefined; yield undefined;;
 
       is(stepNumber, 4, "All callbacks received");
     }
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_progress_events.html
+++ b/dom/indexedDB/test/test_filehandle_progress_events.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     var testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
@@ -61,17 +61,16 @@
       sum += event.loaded - sum;
     }
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
     is(sum, testBuffer.byteLength, "Correct loaded progress sum");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_filehandle_readonly_exceptions.html
+++ b/dom/indexedDB/test/test_filehandle_readonly_exceptions.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -64,17 +64,16 @@
       mutableFile.open().flush({});
       ok(false, "Flushing a readonly file handle should fail!");
     }
     catch (e) {
       ok(true, "Flushing a readonly file handle failed");
     }
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_request_readyState.html
+++ b/dom/indexedDB/test/test_filehandle_request_readyState.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     is(request.readyState, "pending", "Correct readyState");
 
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
@@ -52,17 +52,16 @@
     request.onsuccess = grabEventAndContinueHandler;
     is(request.readyState, "pending", "Correct readyState");
     event = yield undefined;
 
     ok(event.target.result, "Got something");
     is(request.readyState, "done", "Correct readyState");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_serialization.html
+++ b/dom/indexedDB/test/test_filehandle_serialization.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const databaseInfo = [
       { name: window.location.pathname + "1" },
       { name: window.location.pathname + "2" }
     ];
 
@@ -83,17 +83,16 @@
     }
     catch (e) {
       ok(e instanceof DOMException, "Got exception.");
       is(e.name, "DataCloneError", "Good error.");
       is(e.code, DOMException.DATA_CLONE_ERR, "Good error code.");
     }
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_filehandle_store_snapshot.html
+++ b/dom/indexedDB/test/test_filehandle_store_snapshot.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const testFile = getRandomFile("random.bin", 100000);
@@ -80,17 +80,16 @@
     request = objectStore.get(42);
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
     verifyBlob(event.target.result, testFile, 2);
     yield undefined;
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_filehandle_stream_tracking.html
+++ b/dom/indexedDB/test/test_filehandle_stream_tracking.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     var testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
@@ -94,17 +94,16 @@
     }
 
     yield undefined;
 
     ok(compareBuffers(resultBuffer1, testBuffer), "Correct data");
     ok(compareBuffers(resultBuffer2, testBuffer), "Correct data");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_filehandle_success_events_after_abort.html
+++ b/dom/indexedDB/test/test_filehandle_success_events_after_abort.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
@@ -57,17 +57,16 @@
     var thread = comp.classes["@mozilla.org/thread-manager;1"]
                      .getService(comp.interfaces.nsIThreadManager)
                      .currentThread;
     while (thread.hasPendingEvents()) {
       thread.processNextEvent(false);
     }
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_filehandle_truncate.html
+++ b/dom/indexedDB/test/test_filehandle_truncate.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     var testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
@@ -73,17 +73,16 @@
       request = fileHandle.getMetadata({ size: true });
       request.onsuccess = grabEventAndContinueHandler;
       event = yield undefined;
 
       is(event.target.result.size, location, "Correct size");
     }
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_filehandle_workers.html
+++ b/dom/indexedDB/test/test_filehandle_workers.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     let testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onupgradeneeded = grabEventAndContinueHandler;
@@ -131,17 +131,16 @@
     worker.postMessage(name);
     worker.onmessage = grabEventAndContinueHandler;
     event = yield undefined;
 
     is(event.data, "success", "Good response.");
     worker.terminate();
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_filehandle_write_read_data.html
+++ b/dom/indexedDB/test/test_filehandle_write_read_data.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     var testString = "Lorem ipsum his ponderum delicatissimi ne, at noster dolores urbanitas pro, cibo elaboraret no his. Ea dicunt maiorum usu. Ad appareat facilisis mediocritatem eos. Tale graeci mentitum in eos, hinc insolens at nam. Graecis nominavi aliquyam eu vix. Id solet assentior sadipscing pro. Et per atqui graecis, usu quot viris repudiandae ei, mollis evertitur an nam. At nam dolor ignota, liber labore omnesque ea mei, has movet voluptaria in. Vel an impetus omittantur. Vim movet option salutandi ex, ne mei ignota corrumpit. Mucius comprehensam id per. Est ea putant maiestatis.";
     for (let i = 0; i < 5; i++) {
       testString += testString;
     }
 
@@ -92,17 +92,16 @@
     request = fileHandle.getMetadata({ size: true });
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
     let result = event.target.result;
     is(result.size, location, "Correct size");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="file.js"></script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
--- a/dom/indexedDB/test/test_globalObjects_chrome.xul
+++ b/dom/indexedDB/test/test_globalObjects_chrome.xul
@@ -8,17 +8,17 @@
 <window title="Mozilla Bug 832883"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTest();">
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 
   <script type="application/javascript;version=1.7">
   <![CDATA[
-  function testSteps() {
+  function* testSteps() {
     const name = window.location.pathname;
 
     // Test for IDBKeyRange and indexedDB availability in chrome windows.
     var keyRange = IDBKeyRange.only(42);
     ok(keyRange, "Got keyRange");
 
     var request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
--- a/dom/indexedDB/test/test_globalObjects_content.html
+++ b/dom/indexedDB/test/test_globalObjects_content.html
@@ -5,34 +5,33 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     const name = window.location.pathname;
 
     // Test for IDBKeyRange and indexedDB availability in content windows.
     let keyRange = IDBKeyRange.only(42);
     ok(keyRange, "Got keyRange");
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
 
     let db = event.target.result;
     ok(db, "Got database");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 </head>
 
 <body onload="runTest();"></body>
 
 </html>
--- a/dom/indexedDB/test/test_globalObjects_other.xul
+++ b/dom/indexedDB/test/test_globalObjects_other.xul
@@ -8,17 +8,17 @@
 <window title="Mozilla Bug 832883"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="runTest();">
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
 
   <script type="application/javascript;version=1.7">
   <![CDATA[
-  function testSteps() {
+  function* testSteps() {
     // Test for IDBKeyRange and indexedDB availability in bootstrap files.
     let test = Cc["@mozilla.org/dom/indexeddb/GlobalObjectsComponent;1"].
                createInstance(Ci.nsISupports).wrappedJSObject;
     test.ok = ok;
     test.finishTest = continueToNextStep;
     test.runTest();
     yield undefined;
 
--- a/dom/indexedDB/test/test_leaving_page.html
+++ b/dom/indexedDB/test/test_leaving_page.html
@@ -14,17 +14,17 @@
   <iframe id="inner"></iframe>
   <a id="a" href="leaving_page_iframe.html"></a>
 
   <script type="text/javascript;version=1.7">
     onmessage = function(e) {
       ok(false, "gotmessage: " + e.data);
     }
 
-    function testSteps()
+    function* testSteps()
     {
       var iframe = $("inner");
       iframe.src = "leaving_page_iframe.html";
       iframe.onload = continueToNextStep;
       yield undefined;
       is(iframe.contentWindow.location.href, $("a").href,
          "should navigate to iframe page");
       yield undefined;
@@ -37,13 +37,12 @@
 
       let db = event.target.result;
       db.transaction(["mystore"]).objectStore("mystore").get(42).onsuccess =
         grabEventAndContinueHandler;
       event = yield undefined;
       is(event.target.result.hello, "world", "second modification rolled back");
 
       finishTest();
-      yield undefined;
     }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 </html>
--- a/dom/indexedDB/test/test_message_manager_ipc.html
+++ b/dom/indexedDB/test/test_message_manager_ipc.html
@@ -46,27 +46,27 @@ function childFrameScript() {
     ok(pass, name, diag);
   }
 
   function finish(result) {
     sendAsyncMessage(mmName, { op: "done", result: result });
   }
 
   function grabAndContinue(arg) {
-    testGenerator.send(arg);
+    testGenerator.next(arg);
   }
 
   function errorHandler(event) {
     ok(false,
        event.target + " received error event: '" + event.target.error.name +
        "'");
     finish();
   }
 
-  function testSteps() {
+  function* testSteps() {
     addMessageListener(mmName, grabAndContinue);
     let message = yield undefined;
 
     let blob = message.data;
 
     ok(blob instanceof Ci.nsIDOMBlob, "Message manager sent a blob");
     is(blob.size, blobText.length, "Blob has correct length");
     is(blob.type, blobType, "Blob has correct type");
@@ -190,36 +190,34 @@ function childFrameScript() {
     reader.readAsText(slice);
 
     yield undefined;
 
     is(reader.result, blobData[0], "Slice has correct data");
 
     info("Sending blob and slice from database to message manager");
     finish([blob, slice]);
-
-    yield undefined;
   }
 
   let testGenerator = testSteps();
   testGenerator.next();
 }
 
 function parentFrameScript(mm) {
   const messageName = "test:idb-and-mm";
   const blobData = ["So", " ", "many", " ", "blobs!"];
   const blobText = blobData.join("");
   const blobType = "text/plain";
   const blob = new Blob(blobData, { type: blobType });
 
   function grabAndContinue(arg) {
-    testGenerator.send(arg);
+    testGenerator.next(arg);
   }
 
-  function testSteps() {
+  function* testSteps() {
     let result = yield undefined;
 
     is(Array.isArray(result), true, "Child delivered an array of results");
     is(result.length, 2, "Child delivered two results");
 
     let blob = result[0];
     is(blob instanceof Blob, true, "Child delivered a blob");
     is(blob.size, blobText.length, "Blob has correct size");
@@ -259,17 +257,16 @@ function parentFrameScript(mm) {
     reader = new FileReader();
     reader.onload = grabAndContinue;
     reader.readAsText(slice);
     yield undefined;
 
     is(reader.result, blobData[0], "Second slice has correct data");
 
     SimpleTest.finish();
-    yield undefined;
   }
 
   let testGenerator = testSteps();
   testGenerator.next();
 
   mm.addMessageListener(messageName, function(message) {
     let data = message.data;
     switch (data.op) {
@@ -279,17 +276,17 @@ function parentFrameScript(mm) {
       }
 
       case "ok": {
         ok(data.condition, data.name, data.diag);
         break;
       }
 
       case "done": {
-        testGenerator.send(data.result);
+        testGenerator.next(data.result);
         break;
       }
 
       default: {
         ok(false, "Unknown op: " + data.op);
         SimpleTest.finish();
       }
     }
--- a/dom/indexedDB/test/test_open_for_principal.html
+++ b/dom/indexedDB/test/test_open_for_principal.html
@@ -5,26 +5,25 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-  function testSteps()
+  function* testSteps()
   {
     is("open" in indexedDB, true, "open() defined");
     is("openForPrincipal" in indexedDB, false, "openForPrincipal() not defined");
 
     is("deleteDatabase" in indexedDB, true, "deleteDatabase() defined");
     is("deleteForPrincipal" in indexedDB, false, "deleteForPrincipal() not defined");
 
     finishTest();
-    yield undefined;
   }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/test_persistenceType.html
+++ b/dom/indexedDB/test/test_persistenceType.html
@@ -5,17 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
-    function testSteps()
+    function* testSteps()
     {
       const name = window.location.pathname;
       const version = 1;
       const storages = ["persistent", "temporary", "default"];
 
       const objectStoreName = "Foo";
       const data = { key: 1, value: "bar" };
 
@@ -76,17 +76,16 @@
         request = objectStore.add(data.value, data.key);
         request.onsuccess = grabEventAndContinueHandler;
         event = yield undefined;
 
         is(event.target.result, data.key, "Got correct key");
       }
 
       finishTest();
-      yield undefined;
     }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>
 
 <body onload="runTest();"></body>
 
--- a/dom/indexedDB/test/unit/test_abort_deleted_index.js
+++ b/dom/indexedDB/test/unit/test_abort_deleted_index.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const storeName = "test store";
   const indexName_ToBeDeleted = "test index to be deleted";
 
   info("Create index in v1.");
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
@@ -69,10 +69,9 @@ function testSteps()
     index.get('foo');
     ok(false, "TransactionInactiveError shall be thrown after the transaction is inactive.");
   } catch (e) {
     ok(e instanceof DOMException, "got a database exception");
     is(e.name, "TransactionInactiveError", "TransactionInactiveError shall be thrown after the transaction is inactive.");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_abort_deleted_objectStore.js
+++ b/dom/indexedDB/test/unit/test_abort_deleted_objectStore.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const storeName_ToBeDeleted = "test store to be deleted";
 
   info("Create objectStore in v1.");
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
@@ -65,10 +65,9 @@ function testSteps()
     objectStore.get('foo');
     ok(false, "TransactionInactiveError shall be thrown if the transaction is inactive.");
   } catch (e) {
     ok(e instanceof DOMException, "got a database exception");
     is(e.name, "TransactionInactiveError", "correct error");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_add_put.js
+++ b/dom/indexedDB/test/unit/test_add_put.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   let openRequest = indexedDB.open(name, 1);
   openRequest.onerror = errorHandler;
   openRequest.onupgradeneeded = grabEventAndContinueHandler;
   openRequest.onsuccess = unexpectedSuccessHandler;
   let event = yield undefined;
   let db = event.target.result;
@@ -156,10 +156,9 @@ function testSteps()
 
     return "success";
   }
 
   openRequest.onsuccess = grabEventAndContinueHandler;
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_add_twice_failure.js
+++ b/dom/indexedDB/test/unit/test_add_twice_failure.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -33,11 +33,10 @@ function testSteps()
   request.addEventListener("error", new ExpectError("ConstraintError", true));
   request.onsuccess = unexpectedSuccessHandler;
   yield undefined;
 
   // Wait for success.
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_advance.js
+++ b/dom/indexedDB/test/unit/test_advance.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const dataCount = 30;
 
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
 
@@ -183,10 +183,9 @@ function testSteps()
       continueToNextStep();
     }
   };
   yield undefined;
 
   is(count, dataCount - 1, "Saw all data");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_autoIncrement.js
+++ b/dom/indexedDB/test/unit/test_autoIncrement.js
@@ -28,17 +28,17 @@ function genCheck(key, value, test, opti
     event.target.source.get(key).onsuccess = function(event) {
       is(JSON.stringify(event.target.result), JSON.stringify(value),
          "correct stored value in " + test);
       continueToNextStepSync();
     }
   }
 }
 
-function testSteps()
+function* testSteps()
 {
   const dbname = this.window ? window.location.pathname : "Splendid Test";
   const RW = "readwrite";
   let c1 = 1;
   let c2 = 1;
 
   let openRequest = indexedDB.open(dbname, 1);
   openRequest.onerror = errorHandler;
@@ -391,10 +391,9 @@ function testSteps()
     genCheck(c2, { reopen: 2, id: c2 }, "second" + test);
   c2++;
   yield undefined; yield undefined;
 
   openRequest.onsuccess = grabEventAndContinueHandler;
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_autoIncrement_indexes.js
+++ b/dom/indexedDB/test/unit/test_autoIncrement_indexes.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
 
   let db = request.result;
   db.onerror = errorHandler;
@@ -47,10 +47,9 @@ function testSteps()
   is (event.target.result.id, 1, "Entry in second");
 
   third.get("foo").onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   is (event.target.result.id, 1, "Entry in third");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_blob_file_backed.js
+++ b/dom/indexedDB/test/unit/test_blob_file_backed.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var disableWorkerTest = "This test uses SpecialPowers";
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const fileData = "abcdefghijklmnopqrstuvwxyz";
   const fileType = "text/plain";
 
   const databaseName =
     ("window" in this) ? window.location.pathname : "Test";
   const objectStoreName = "foo";
   const objectStoreKey = "10";
@@ -69,10 +69,9 @@ function testSteps()
   fileReader.onload = grabEventAndContinueHandler;
   fileReader.readAsText(file);
 
   event = yield undefined;
 
   is(fileReader.result, fileData, "Correct data");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_blocked_order.js
+++ b/dom/indexedDB/test/unit/test_blocked_order.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const databaseName =
     ("window" in this) ? window.location.pathname : "Test";
   const databaseCount = 10;
 
   // Test 1: Make sure basic versionchange events work and that they don't
   //         trigger blocked events.
   info("Opening " + databaseCount + " databases with version 1");
@@ -170,10 +170,9 @@ function testSteps()
 
   request.onblocked = grabEventAndContinueHandler;
 
   event = yield undefined;
   ok(true, "Got blocked");
   // Just allow this to remain blocked ...
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_cleanup_transaction.js
+++ b/dom/indexedDB/test/unit/test_cleanup_transaction.js
@@ -72,21 +72,21 @@ function testSteps()
       request.onerror = function(event)
       {
         event.stopPropagation();
       }
 
       trans.oncomplete = function(event) {
         i++;
         j++;
-        testGenerator.send(true);
+        testGenerator.next(true);
       }
       trans.onabort = function(event) {
         is(trans.error.name, "QuotaExceededError", "Reached quota limit");
-        testGenerator.send(false);
+        testGenerator.next(false);
       }
 
       let completeFired = yield undefined;
       if (completeFired) {
         ok(true, "Got complete event");
       } else {
         ok(true, "Got abort event");
 
--- a/dom/indexedDB/test/unit/test_clear.js
+++ b/dom/indexedDB/test/unit/test_clear.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const entryCount = 1000;
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -88,10 +88,9 @@ function testSteps()
               .add({});
   request.onerror = errorHandler;
   request.onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   isnot(event.target.result, firstKey, "Got a different key");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_complex_keyPaths.js
+++ b/dom/indexedDB/test/unit/test_complex_keyPaths.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   // Test object stores
 
   const name = "test_complex_keyPaths";
   const keyPaths = [
     { keyPath: "id",      value: { id: 5 },                      key: 5 },
     { keyPath: "id",      value: { id: "14", iid: 12 },          key: "14" },
     { keyPath: "id",      value: { iid: "14", id: 12 },          key: 12 },
@@ -257,10 +257,9 @@ function testSteps()
     is(JSON.stringify(e.target.result), JSON.stringify(info.res || info.v),
        "expected value stored" + test);
   }
 
   openRequest.onsuccess = grabEventAndContinueHandler;
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_count.js
+++ b/dom/indexedDB/test/unit/test_count.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
     { key: "237-23-7734", value: { name: "Ron", height: 73, weight: 180 } },
@@ -345,10 +345,9 @@ function testSteps()
                                true, true);
   index.count(keyRange).onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   is(event.target.result, weightSort.length - 2,
      "Correct number of index entries for bound keyRange");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_create_index.js
+++ b/dom/indexedDB/test/unit/test_create_index.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreInfo = [
     { name: "a", options: { keyPath: "id", autoIncrement: true } },
     { name: "b", options: { keyPath: "id", autoIncrement: false } },
   ];
   const indexInfo = [
     { name: "1", keyPath: "unique_value", options: { unique: true } },
@@ -112,10 +112,9 @@ function testSteps()
   }
 
   request.onsuccess = grabEventAndContinueHandler;
   request.onupgradeneeded = unexpectedSuccessHandler;
 
   event = yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_create_index_with_integer_keys.js
+++ b/dom/indexedDB/test/unit/test_create_index_with_integer_keys.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const data = { id: new Date().getTime(),
                  num: parseInt(Math.random() * 1000) };
 
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -57,10 +57,9 @@ function testSteps()
       continueToNextStep();
     }
   };
   yield undefined;
 
   is(seenCount, 1, "Saw our entry");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_create_locale_aware_index.js
+++ b/dom/indexedDB/test/unit/test_create_locale_aware_index.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreInfo = [
     { name: "a", options: { keyPath: "id", autoIncrement: true } },
     { name: "b", options: { keyPath: "id", autoIncrement: false } },
   ];
   const indexInfo = [
     { name: "1", keyPath: "unique_value", options: { unique: true, locale: "es-ES" } },
@@ -114,10 +114,9 @@ function testSteps()
   }
 
   request.onsuccess = grabEventAndContinueHandler;
   request.onupgradeneeded = unexpectedSuccessHandler;
 
   event = yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_create_objectStore.js
+++ b/dom/indexedDB/test/unit/test_create_objectStore.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreInfo = [
     { name: "1", options: { keyPath: null } },
     { name: "2", options: { keyPath: null, autoIncrement: true } },
     { name: "3", options: { keyPath: null, autoIncrement: false } },
     { name: "4", options: { keyPath: null } },
     { name: "5", options: { keyPath: "foo" } },
@@ -125,10 +125,9 @@ function testSteps()
   is(ex.code, DOMException.INVALID_ACCESS_ERR, "should throw right exception");
 
   request.onsuccess = grabEventAndContinueHandler;
   request.onupgradeneeded = unexpectedSuccessHandler;
 
   event = yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_cursor_mutation.js
+++ b/dom/indexedDB/test/unit/test_cursor_mutation.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const objectStoreData = [
     // This one will be removed.
     { ss: "237-23-7732", name: "Bob" },
 
     // These will always be included.
     { ss: "237-23-7733", name: "Ann" },
     { ss: "237-23-7734", name: "Ron" },
@@ -108,11 +108,9 @@ function testSteps()
 
   is(count, objectStoreData.length - 1, "Good final count");
   is(sawAdded, true, "Saw item that was added");
   is(sawRemoved, false, "Didn't see item that was removed");
 
   finishTest();
 
   objectStore = null; // Bug 943409 workaround.
-
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_cursor_update_updates_indexes.js
+++ b/dom/indexedDB/test/unit/test_cursor_update_updates_indexes.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const START_DATA = "hi";
   const END_DATA = "bye";
   const objectStoreInfo = [
     { name: "1", options: { keyPath: null }, key: 1,
       entry: { data: START_DATA } },
     { name: "2", options: { keyPath: "foo" },
@@ -89,11 +89,10 @@ function testSteps()
 
     // Wait for success
     yield undefined;
 
     db.close();
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_cursors.js
+++ b/dom/indexedDB/test/unit/test_cursors.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const keys = [1, -1, 0, 10, 2000, "q", "z", "two", "b", "a"];
   const sortedKeys = [-1, 0, 1, 10, 2000, "a", "b", "q", "two", "z"];
 
   is(keys.length, sortedKeys.length, "Good key setup");
 
   let request = indexedDB.open(name, 1);
@@ -374,10 +374,9 @@ function testSteps()
   is(keyIndex, -1, "Saw all added items");
 
   // Wait for success
   yield undefined;
 
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_database_onclose.js
+++ b/dom/indexedDB/test/unit/test_database_onclose.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   function testInvalidStateError(aDb, aTxn) {
     try {
       info("The db shall become invalid after closed.");
       aDb.transaction("store");
       ok(false, "InvalidStateError shall be thrown.");
     } catch (e) {
       ok(e instanceof DOMException, "got a database exception");
@@ -100,20 +100,20 @@ function testSteps()
   objectStore = txn.objectStore("store");
 
   let objectId = 0;
   while(true) {
     let addRequest = objectStore.add({foo: "foo"}, objectId);
     addRequest.onerror = function(event) {
       info("addRequest.onerror, objectId: " + objectId);
       txn.onerror = grabEventAndContinueHandler;
-      testGenerator.send(true);
+      testGenerator.next(true);
     }
     addRequest.onsuccess = function() {
-      testGenerator.send(false);
+      testGenerator.next(false);
     }
 
     if (objectId == 0) {
       clearAllDatabases(() => {
         info("clearAllDatabases is done.");
         continueToNextStep();
       });
     }
@@ -165,17 +165,17 @@ function testSteps()
   // The number of read records varies between 1~2000 before the db is cleared
   // during testing.
   let numberOfObjects = 3000;
   objectId = 0;
   while(true) {
     let addRequest = objectStore.add({foo: "foo"});
     addRequest.onsuccess = function() {
       objectId++;
-      testGenerator.send(objectId == numberOfObjects);
+      testGenerator.next(objectId == numberOfObjects);
     }
     addRequest.onerror = errorHandler;
 
     let done = yield undefined;
     if (done) {
       break;
     }
   }
@@ -191,27 +191,27 @@ function testSteps()
 
   txn = db.transaction("store");
   objectStore = txn.objectStore("store");
 
   let numberOfReadObjects = 0;
   let readRequest = objectStore.openCursor();
   readRequest.onerror = function(event) {
     info("readRequest.onerror, numberOfReadObjects: " + numberOfReadObjects);
-    testGenerator.send(true);
+    testGenerator.next(true);
   }
   readRequest.onsuccess = function(event) {
     let cursor = event.target.result;
     if (cursor) {
       numberOfReadObjects++;
       event.target.result.continue();
     } else {
       info("Cursor is invalid, numberOfReadObjects: " + numberOfReadObjects);
       todo(false, "All records are iterated before database is cleared!");
-      testGenerator.send(false);
+      testGenerator.next(false);
     }
   }
 
   clearAllDatabases(() => {
     info("clearAllDatabases is done.");
     continueToNextStep();
   });
 
@@ -236,10 +236,9 @@ function testSteps()
 
     testInvalidStateError(db, txn);
   }
 
   info("Wait for the callback of clearAllDatabases().");
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_deleteDatabase.js
+++ b/dom/indexedDB/test/unit/test_deleteDatabase.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   ok(indexedDB.deleteDatabase, "deleteDatabase function should exist!");
 
   let request = indexedDB.open(name, 10);
   request.onerror = errorHandler;
   request.onsuccess = unexpectedSuccessHandler;
@@ -97,10 +97,9 @@ function testSteps()
   request = indexedDB.open("thisDatabaseHadBetterNotExist");
   request.onerror = errorHandler;
   request.onsuccess = grabEventAndContinueHandler;
 
   event = yield undefined;
   ok(true, "after deleting a non-existent database, open should work");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js
+++ b/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 10);
   request.onerror = errorHandler;
   request.onsuccess = unexpectedSuccessHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
 
@@ -53,10 +53,9 @@ function testSteps()
 
   openRequest.onsuccess = grabEventAndContinueHandler;
 
   event = yield undefined;
   is(event.target.result.version, 1, "DB has proper version");
   is(event.target.result.objectStoreNames.length, 0, "DB should have no object stores");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_deleteDatabase_onblocked.js
+++ b/dom/indexedDB/test/unit/test_deleteDatabase_onblocked.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const dbVersion = 10;
 
   let openRequest = indexedDB.open(name, dbVersion);
   openRequest.onerror = errorHandler;
   openRequest.onblocked = errorHandler;
   openRequest.onsuccess = unexpectedSuccessHandler;
@@ -74,10 +74,9 @@ function testSteps()
   event = yield undefined;
   db = event.target.result;
   is(db.version, 1, "DB has proper version");
   is(db.objectStoreNames.length, 0, "DB should have no object stores");
 
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_deleteDatabase_onblocked_duringVersionChange.js
+++ b/dom/indexedDB/test/unit/test_deleteDatabase_onblocked_duringVersionChange.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const dbVersion = 10;
 
   let openRequest = indexedDB.open(name, dbVersion);
   openRequest.onerror = errorHandler;
   openRequest.onblocked = errorHandler;
   openRequest.onsuccess = unexpectedSuccessHandler;
@@ -75,10 +75,9 @@ function testSteps()
   event = yield undefined;
   db = event.target.result;
   is(db.version, 1, "DB has proper version");
   is(db.objectStoreNames.length, 0, "DB should have no object stores");
 
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_event_source.js
+++ b/dom/indexedDB/test/unit/test_event_source.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "Objects";
 
   var request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
@@ -27,10 +27,9 @@ function testSteps()
   event = yield undefined;
 
   ok(event.target.source === objectStore, "correct event.source");
 
   // Wait for success
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_filehandle_append_read_data.js
+++ b/dom/indexedDB/test/unit/test_filehandle_append_read_data.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var disableWorkerTest = "FileHandle doesn't work in workers yet";
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   var testString = "Lorem ipsum his ponderum delicatissimi ne, at noster dolores urbanitas pro, cibo elaboraret no his. Ea dicunt maiorum usu. Ad appareat facilisis mediocritatem eos. Tale graeci mentitum in eos, hinc insolens at nam. Graecis nominavi aliquyam eu vix. Id solet assentior sadipscing pro. Et per atqui graecis, usu quot viris repudiandae ei, mollis evertitur an nam. At nam dolor ignota, liber labore omnesque ea mei, has movet voluptaria in. Vel an impetus omittantur. Vim movet option salutandi ex, ne mei ignota corrumpit. Mucius comprehensam id per. Est ea putant maiestatis.";
   for (let i = 0; i < 5; i++) {
     testString += testString;
   }
 
@@ -89,10 +89,9 @@ function testSteps()
   request = fileHandle.getMetadata({ size: true });
   request.onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   let result = event.target.result;
   is(result.size, location, "Correct size");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_getAll.js
+++ b/dom/indexedDB/test/unit/test_getAll.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   const values = [ "a", "1", 1, "foo", 300, true, false, 4.5, null ];
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
@@ -186,10 +186,9 @@ function testSteps()
   is(event.target.result instanceof Array, true, "Got an array object");
   is(event.target.result.length, 2, "Correct length");
 
   for (let i in event.target.result) {
     is(event.target.result[i], values[parseInt(i) + 4], "Same value");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_global_data.js
+++ b/dom/indexedDB/test/unit/test_global_data.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStore =  { name: "Objects",
                          options: { keyPath: "id", autoIncrement: true } };
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
@@ -48,10 +48,9 @@ function testSteps()
   let objectStore2 = db2.transaction(objectStore.name)
                         .objectStore(objectStore.name);
 
   ok(objectStore1 !== objectStore2, "Different objectStores");
   is(objectStore1.name, objectStore2.name, "Same name");
   is(objectStore1.keyPath, objectStore2.keyPath, "Same keyPath");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_index_empty_keyPath.js
+++ b/dom/indexedDB/test/unit/test_index_empty_keyPath.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   const objectStoreData = [
     { key: "1", value: "foo" },
     { key: "2", value: "bar" },
     { key: "3", value: "baz" }
   ];
@@ -28,17 +28,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   event = yield undefined; // testGenerator.send
 
   // Now create the index.
   objectStore.createIndex("set", "", { unique: true });
   yield undefined; // success
@@ -74,10 +74,9 @@ function testSteps()
   request.onsuccess = unexpectedSuccessHandler;
 
   trans.oncomplete = grabEventAndContinueHandler;
 
   yield undefined;
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_index_getAll.js
+++ b/dom/indexedDB/test/unit/test_index_getAll.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
     { key: "237-23-7734", value: { name: "Ron", height: 73, weight: 180 } },
@@ -64,17 +64,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   yield undefined;
   ok(true, "1");
 
   // Now create the indexes.
   for (let i in indexData) {
@@ -182,10 +182,9 @@ function testSteps()
   is(event.target.result.length, 1, "Correct length");
 
   for (let i in event.target.result) {
     is(event.target.result[i], objectStoreDataHeightSort[parseInt(i) + 3].key,
        "Correct key");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_index_getAllObjects.js
+++ b/dom/indexedDB/test/unit/test_index_getAllObjects.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
     { key: "237-23-7734", value: { name: "Ron", height: 73, weight: 180 } },
@@ -64,17 +64,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   event = yield undefined;
 
   // Now create the indexes.
   for (let i in indexData) {
     objectStore.createIndex(indexData[i].name, indexData[i].keyPath,
@@ -224,10 +224,9 @@ function testSteps()
     is(result.height, testObj.height, "Correct height");
 
     if (testObj.hasOwnProperty("weight")) {
       is(result.weight, testObj.weight, "Correct weight");
     }
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_index_object_cursors.js
+++ b/dom/indexedDB/test/unit/test_index_object_cursors.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const objectStoreData = [
     { name: "", options: { keyPath: "id", autoIncrement: true } },
     { name: null, options: { keyPath: "ss" } },
     { name: undefined, options: { } },
     { name: "4", options: { autoIncrement: true } },
   ];
 
@@ -138,10 +138,9 @@ function testSteps()
         .onsuccess = continueToNextStep;
       yield undefined;
 
       objectStore = index = null; // Bug 943409 workaround.
     }
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_index_update_delete.js
+++ b/dom/indexedDB/test/unit/test_index_update_delete.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let name = this.window ? window.location.pathname : "Splendid Test";
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
 
   let event = yield undefined;
@@ -162,10 +162,9 @@ function testSteps()
 
       index = event = null; // Bug 943409 workaround.
     }
     objectStore = event = null; // Bug 943409 workaround.
   }
 
   finishTest();
   event = db = request = null; // Bug 943409 workaround.
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_indexes.js
+++ b/dom/indexedDB/test/unit/test_indexes.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
@@ -64,17 +64,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   event = yield undefined;
   // Now create the indexes.
   for (let i in indexData) {
     objectStore.createIndex(indexData[i].name, indexData[i].keyPath,
                             indexData[i].options);
@@ -1252,10 +1252,9 @@ function testSteps()
       testGenerator.next();
     }
   }
   yield undefined;
 
   is(keyIndex, objectStoreDataNameSort.length, "Saw all the expected keys");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_indexes_bad_values.js
+++ b/dom/indexedDB/test/unit/test_indexes_bad_values.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
@@ -50,17 +50,17 @@ function testSteps()
 
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   event = yield undefined;
 
   for (let i in indexData) {
     objectStore.createIndex(indexData[i].name, indexData[i].keyPath,
                             indexData[i].options);
@@ -121,10 +121,9 @@ function testSteps()
     }
   }
   yield undefined;
 
   is(keyIndex, objectStoreData.length + badObjectStoreData.length,
      "Saw all people");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_indexes_funny_things.js
+++ b/dom/indexedDB/test/unit/test_indexes_funny_things.js
@@ -1,21 +1,21 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   // Blob constructor is not implemented outside of windows yet (Bug 827723).
   if (!this.window) {
     finishTest();
-    yield undefined;
+    return;
   }
 
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   const objectStoreName = "Things";
 
   const blob1 = new Blob(["foo", "bar"], { type: "text/plain" });
   const blob2 = new Blob(["foobazybar"], { type: "text/plain" });
@@ -60,17 +60,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   event = yield undefined;
   // Now create the indexes.
   for (let i in indexData) {
     objectStore.createIndex(indexData[i].name, indexData[i].keyPath,
                             indexData[i].options);
@@ -159,10 +159,9 @@ function testSteps()
       testGenerator.next();
     }
   }
   yield undefined;
 
   is(keyIndex, objectStoreDataLengthSort.length, "Saw all the expected keys");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_invalid_cursor.js
+++ b/dom/indexedDB/test/unit/test_invalid_cursor.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var disableWorkerTest = "Need to implement a gc() function for worker tests";
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const dbName = ("window" in this) ? window.location.pathname : "test";
   const dbVersion = 1;
   const objectStoreName = "foo";
   const data = 0;
 
   let req = indexedDB.open(dbName, dbVersion);
   req.onerror = errorHandler;
@@ -55,10 +55,9 @@ function testSteps()
   info("Done collecting garbage");
 
   cursor.continue();
   event = yield undefined;
 
   is(event.target.result, null, "No more entries");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_invalid_version.js
+++ b/dom/indexedDB/test/unit/test_invalid_version.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   try {
     indexedDB.open(name, 0);
     ok(false, "Should have thrown!");
   }
   catch (e) {
@@ -41,10 +41,9 @@ function testSteps()
     ok(false, "Should have thrown!");
   }
   catch (e) {
     ok(e instanceof TypeError, "Got TypeError.");
     is(e.name, "TypeError", "Good error name.");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_key_requirements.js
+++ b/dom/indexedDB/test/unit/test_key_requirements.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps(); 
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -276,10 +276,9 @@ function testSteps()
   request.onerror = errorHandler;
   request.onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   // Wait for success
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_keys.js
+++ b/dom/indexedDB/test/unit/test_keys.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const dbname = this.window ? window.location.pathname : "Splendid Test";
   const RW = "readwrite"
   let c1 = 1;
   let c2 = 1;
 
   let openRequest = indexedDB.open(dbname, 1);
   openRequest.onerror = errorHandler;
@@ -260,10 +260,9 @@ function testSteps()
       is(ex.code, 0, "Threw with right code3");
     }
   }
 
   openRequest.onsuccess = grabEventAndContinueHandler;
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_locale_aware_index_getAll.js
+++ b/dom/indexedDB/test/unit/test_locale_aware_index_getAll.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "\u00E1na",   height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "ana",        height: 52, weight: 110 } },
     { key: "237-23-7734", value: { name: "fabio",      height: 73, weight: 180 } },
@@ -64,17 +64,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   yield undefined;
   ok(true, "1");
 
   // Now create the indexes.
   for (let i in indexData) {
@@ -182,10 +182,9 @@ function testSteps()
   is(event.target.result.length, 1, "Correct length");
 
   for (let i in event.target.result) {
     is(event.target.result[i], objectStoreDataHeightSort[parseInt(i) + 3].key,
        "Correct key");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_locale_aware_index_getAllObjects.js
+++ b/dom/indexedDB/test/unit/test_locale_aware_index_getAllObjects.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "\u00E1na",   height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "ana",        height: 52, weight: 110 } },
     { key: "237-23-7734", value: { name: "fabio",      height: 73, weight: 180 } },
@@ -64,17 +64,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   event = yield undefined;
 
   // Now create the indexes.
   for (let i in indexData) {
     objectStore.createIndex(indexData[i].name, indexData[i].keyPath,
@@ -224,10 +224,9 @@ function testSteps()
     is(result.height, testObj.height, "Correct height");
 
     if (testObj.hasOwnProperty("weight")) {
       is(result.weight, testObj.weight, "Correct weight");
     }
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_locale_aware_indexes.js
+++ b/dom/indexedDB/test/unit/test_locale_aware_indexes.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   const objectStoreName = "People";
 
   const objectStoreData = [
     { key: "237-23-7732", value: { name: "\u00E1na",   height: 60, weight: 120 } },
     { key: "237-23-7733", value: { name: "ana",        height: 52, weight: 110 } },
@@ -64,17 +64,17 @@ function testSteps()
   // First, add all our data to the object store.
   let addedData = 0;
   for (let i in objectStoreData) {
     request = objectStore.add(objectStoreData[i].value,
                               objectStoreData[i].key);
     request.onerror = errorHandler;
     request.onsuccess = function(event) {
       if (++addedData == objectStoreData.length) {
-        testGenerator.send(event);
+        testGenerator.next(event);
       }
     }
   }
   event = yield undefined;
   // Now create the indexes.
   for (let i in indexData) {
     objectStore.createIndex(indexData[i].name, indexData[i].keyPath,
                             indexData[i].options);
@@ -1259,10 +1259,9 @@ function testSteps()
       testGenerator.next();
     }
   }
   yield undefined;
 
   is(keyIndex, objectStoreDataNameSort.length, "Saw all the expected keys");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_lowDiskSpace.js
+++ b/dom/indexedDB/test/unit/test_lowDiskSpace.js
@@ -5,17 +5,17 @@
 "use strict";
 
 var disableWorkerTest = "This test uses SpecialPowers";
 
 var self = this;
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const dbName = self.window ? window.location.pathname : "test_lowDiskSpace";
   const dbVersion = 1;
 
   const objectStoreName = "foo";
   const objectStoreOptions = { keyPath: "foo" };
 
   const indexName = "bar";
@@ -710,17 +710,16 @@ function testSteps()
     event = yield undefined;
 
     is(event.type, "complete", "Transaction succeeded");
 
     db.close();
   }
 
   finishTest();
-  yield undefined;
 }
 
 function RequestCounter(expectedType) {
   this._counter = 0;
 }
 RequestCounter.prototype = {
   incr: function() {
     this._counter++;
--- a/dom/indexedDB/test/unit/test_maximal_serialized_object_size.js
+++ b/dom/indexedDB/test/unit/test_maximal_serialized_object_size.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var disableWorkerTest = "Need a way to set temporary prefs from a worker";
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ?
     window.location.pathname : "test_maximal_serialized_object_size.js";
   const megaBytes = 1024 * 1024;
   const kMessageOverhead = 1; // in MB
   const kMaxIpcMessageSize = 20; // in MB
   const kMaxIdbMessageSize = kMaxIpcMessageSize - kMessageOverhead;
 
@@ -86,10 +86,9 @@ function testSteps()
   testTooLargeError("add", { id: chunks, index: indexChunks });
 
   openRequest.onsuccess = continueToNextStep;
   yield undefined;
 
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_multientry.js
+++ b/dom/indexedDB/test/unit/test_multientry.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   // Test object stores
   
   let name = this.window ? window.location.pathname : "Splendid Test";
   let openRequest = indexedDB.open(name, 1);
   openRequest.onerror = errorHandler;
   openRequest.onupgradeneeded = grabEventAndContinueHandler;
   openRequest.onsuccess = unexpectedSuccessHandler;
@@ -209,10 +209,9 @@ function testSteps()
   let trans = db.transaction(["mystore"], "readwrite");
   store = trans.objectStore("mystore");
   index = store.index("myindex");
   is(index.multiEntry, true, "index still is multiEntry");
   trans.oncomplete = grabEventAndContinueHandler;
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_names_sorted.js
+++ b/dom/indexedDB/test/unit/test_names_sorted.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreInfo = [
     { name: "foo", options: { keyPath: "id" }, location: 1 },
     { name: "bar", options: { keyPath: "id" }, location: 0 },
   ];
   const indexInfo = [
     { name: "foo", keyPath: "value", location: 1 },
@@ -105,10 +105,9 @@ function testSteps()
   
     is(trans.objectStoreNames[info.location], info.name,
        "Got objectStore name in the right location");
   }
 
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_objectCursors.js
+++ b/dom/indexedDB/test/unit/test_objectCursors.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   const objectStores = [
     { name: "a", autoIncrement: false },
     { name: "b", autoIncrement: true }
   ];
 
@@ -75,11 +75,10 @@ function testSteps()
         is(event.target.result.value.name, "Ben", "Good object");
         executeSoon(function() { testGenerator.next(); });
       }
       yield undefined;
     }
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_objectStore_getAllKeys.js
+++ b/dom/indexedDB/test/unit/test_objectStore_getAllKeys.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps() {
+function* testSteps() {
   const dbName = this.window ?
                  window.location.pathname :
                  "test_objectStore_getAllKeys";
   const dbVersion = 1;
   const objectStoreName = "foo";
   const keyCount = 200;
 
   let request = indexedDB.open(dbName, dbVersion);
@@ -114,10 +114,9 @@ function testSteps() {
   keyRange = IDBKeyRange.bound(10000, 200000);
   objectStore.getAllKeys(keyRange, 5).onsuccess = grabEventAndContinueHandler;
   event = yield undefined;
 
   ok(Array.isArray(event.target.result), "Got an array result");
   is(event.target.result.length, 0, "Got correct array length");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_objectStore_inline_autoincrement_key_added_on_put.js
+++ b/dom/indexedDB/test/unit/test_objectStore_inline_autoincrement_key_added_on_put.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   var request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
   var event = yield undefined;
@@ -45,11 +45,10 @@ function testSteps()
 
   // Ensure that the id was also stored on the object.
   is(event.target.result.id, id, "The object had the id stored on it.");
 
   // Wait for success
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_objectStore_openKeyCursor.js
+++ b/dom/indexedDB/test/unit/test_objectStore_openKeyCursor.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps() {
+function* testSteps() {
   const dbName = this.window ?
                  window.location.pathname :
                  "test_objectStore_openKeyCursor";
   const dbVersion = 1;
   const objectStoreName = "foo";
   const keyCount = 100;
 
   let request = indexedDB.open(dbName, dbVersion);
@@ -391,10 +391,9 @@ function testSteps() {
     }
     if (i == 0) {
       j = 9;
     }
   }
   ok(match, "All keys matched");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_objectStore_remove_values.js
+++ b/dom/indexedDB/test/unit/test_objectStore_remove_values.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   var data = [
     { name: "inline key; key generator",
       autoIncrement: true,
       storedObject: {name: "Lincoln"},
       keyName: "id",
@@ -82,11 +82,10 @@ function testSteps()
 
     ok(event.target.result === undefined, "Object was deleted");
 
     // Wait for success
     yield undefined;
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_object_identity.js
+++ b/dom/indexedDB/test/unit/test_object_identity.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
 
   let db = event.target.result;
   let transaction = event.target.transaction;
@@ -38,11 +38,10 @@ function testSteps()
   let index3 = objectStore3.index("bar");
   let index4 = objectStore4.index("bar");
   ok(index3 === index4, "Got same indexes");
 
   ok(index3 !== index1, "Different indexes");
   ok(index4 !== index2, "Different indexes");
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_odd_result_order.js
+++ b/dom/indexedDB/test/unit/test_odd_result_order.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const data = { key: 5, index: 10 };
 
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
 
@@ -67,10 +67,9 @@ function testSteps()
     key = request.result;
     continueToNextStep();
   }, 0);
   yield undefined;
 
   ok(key === undefined, "Got the right value");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_open_empty_db.js
+++ b/dom/indexedDB/test/unit/test_open_empty_db.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const names = [
     //"",
     null,
     undefined,
     this.window ? window.location.pathname : "Splendid Test"
   ];
 
@@ -36,11 +36,10 @@ function testSteps()
 
     is(db.name, request.result.name, "Bad name");
     is(db.version, request.result.version, "Bad version");
     is(db.objectStoreNames.length, request.result.objectStoreNames.length,
        "Bad objectStores list");
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_open_objectStore.js
+++ b/dom/indexedDB/test/unit/test_open_objectStore.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "Objects";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
@@ -29,11 +29,10 @@ function testSteps()
 
   objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);
 
   is(objectStore.name, objectStoreName, "Bad name");
   is(objectStore.keyPath, "foo", "Bad keyPath");
   if(objectStore.indexNames.length, 0, "Bad indexNames");
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_optionalArguments.js
+++ b/dom/indexedDB/test/unit/test_optionalArguments.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const osName = "people";
   const indexName = "weight";
 
   const data = [
     { ssn: "237-23-7732", name: "Bob", height: 60, weight: 120 },
     { ssn: "237-23-7733", name: "Ann", height: 52, weight: 110 },
     { ssn: "237-23-7734", name: "Ron", height: 73, weight: 180 },
@@ -1701,11 +1701,10 @@ function testSteps()
   is(event.target.result instanceof Array, true, "Got an array");
   is(event.target.result.length, weightSort.length, "Got correct length");
   for (let i in event.target.result) {
     is(event.target.result[i], data[weightSort[i]].ssn,
        "Got correct value");
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_overlapping_transactions.js
+++ b/dom/indexedDB/test/unit/test_overlapping_transactions.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStores = [ "foo", "bar" ];
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -82,11 +82,10 @@ function testSteps()
 
     stepNumber++;
     yield undefined; yield undefined; yield undefined; yield undefined; yield undefined;
 
     is(stepNumber, 6, "All callbacks received");
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_put_get_values.js
+++ b/dom/indexedDB/test/unit/test_put_get_values.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "Objects";
 
   let testString = { key: 0, value: "testString" };
   let testInt = { key: 1, value: 1002 };
 
   let request = indexedDB.open(name, 1);
@@ -45,11 +45,10 @@ function testSteps()
       is(event.target.result, testInt.value, "Got the right value");
     };
   }
 
   // Wait for success
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_put_get_values_autoIncrement.js
+++ b/dom/indexedDB/test/unit/test_put_get_values_autoIncrement.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "Objects";
 
   let testString = { value: "testString" };
   let testInt = { value: 1002 };
 
   let request = indexedDB.open(name, 1);
@@ -45,10 +45,9 @@ function testSteps()
       is(event.target.result, testInt.value, "Got the right value");
     };
   }
 
   // Wait for success
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_quotaExceeded_recovery.js
+++ b/dom/indexedDB/test/unit/test_quotaExceeded_recovery.js
@@ -82,21 +82,21 @@ function testSteps()
         event.stopPropagation();
       }
 
       trans.oncomplete = function(event) {
         if (iter == 1) {
           i++;
         }
         j++;
-        testGenerator.send(true);
+        testGenerator.next(true);
       }
       trans.onabort = function(event) {
         is(trans.error.name, "QuotaExceededError", "Reached quota limit");
-        testGenerator.send(false);
+        testGenerator.next(false);
       }
 
       let completeFired = yield undefined;
       if (completeFired) {
         ok(true, "Got complete event");
         continue;
       }
 
--- a/dom/indexedDB/test/unit/test_readonly_transactions.js
+++ b/dom/indexedDB/test/unit/test_readonly_transactions.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const osName = "foo";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
@@ -165,10 +165,9 @@ function testSteps()
     request = db.transaction(osName).objectStore(osName).delete(key2);
     ok(false, "Removing from a readonly transaction should fail!");
   }
   catch (e) {
     ok(true, "Removing from a readonly transaction failed");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_readwriteflush_disabled.js
+++ b/dom/indexedDB/test/unit/test_readwriteflush_disabled.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var disableWorkerTest = "Need a way to set temporary prefs from a worker";
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name =
     this.window ? window.location.pathname : "test_readwriteflush_disabled.js";
 
   info("Resetting experimental pref");
 
   if (this.window) {
     SpecialPowers.pushPrefEnv(
@@ -63,10 +63,9 @@ function testSteps()
   ok(exception, "'readwriteflush' transaction threw");
   ok(exception instanceof Error, "exception is an Error object");
   is(exception.message,
      "Argument 2 of IDBDatabase.transaction 'readwriteflush' is not a valid " +
      "value for enumeration IDBTransactionMode.",
      "exception has the correct message");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_remove_index.js
+++ b/dom/indexedDB/test/unit/test_remove_index.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const indexName = "My Test Index";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -49,10 +49,9 @@ function testSteps()
   is(objectStore.indexNames.length, 1, "Correct recreacted indexNames list");
   is(objectStore.indexNames.item(0), indexName, "Correct recreacted name");
   is(objectStore.index(indexName), index2, "Correct instance");
 
   event.target.transaction.oncomplete = grabEventAndContinueHandler;
   event = yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_remove_objectStore.js
+++ b/dom/indexedDB/test/unit/test_remove_objectStore.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const objectStoreName = "Objects";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = unexpectedSuccessHandler;
@@ -80,17 +80,17 @@ function testSteps()
   is(db.objectStoreNames.item(0), objectStoreName, "Correct name");
   is(trans.objectStore(objectStoreName), objectStore, "Correct new objectStore");
   isnot(oldObjectStore, objectStore, "Old objectStore is not new objectStore");
 
   request = objectStore.openCursor();
   request.onerror = errorHandler;
   request.onsuccess = function(event) {
     is(event.target.result, null, "ObjectStore shouldn't have any items");
-    testGenerator.send(event);
+    testGenerator.next(event);
   }
   event = yield undefined;
 
   db.deleteObjectStore(objectStore.name);
   is(db.objectStoreNames.length, 0, "Correct objectStores list");
 
   continueToNextStep();
   yield undefined;
@@ -120,10 +120,9 @@ function testSteps()
   db.deleteObjectStore(objectStoreName);
 
   event = yield undefined;
 
   trans.oncomplete = grabEventAndContinueHandler;
   event = yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_rename_index.js
+++ b/dom/indexedDB/test/unit/test_rename_index.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const storeName = "test store";
   const indexName_ToBeDeleted = "test index to be deleted";
   const indexName_v0 = "test index v0";
   const indexName_v1 = "test index v1";
   const indexName_v2 = "test index v2";
   const indexName_v3 = indexName_ToBeDeleted;
@@ -184,10 +184,9 @@ function testSteps()
 
   objectStore = txn.objectStore(storeName);
   index = objectStore.index(indexName_v3);
   is(index.name, indexName_v3, "Correct index name");
 
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_rename_index_errors.js
+++ b/dom/indexedDB/test/unit/test_rename_index_errors.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const storeName = "test store";
   const indexName1 = "test index 1";
   const indexName2 = "test index 2";
 
   info("Setup test indexes.");
   let request = indexedDB.open(name, 1);
@@ -120,10 +120,9 @@ function testSteps()
     is(e.name, "InvalidStateError", "correct error");
   }
 
   txn.oncomplete = continueToNextStepSync;
   yield undefined;
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_rename_objectStore.js
+++ b/dom/indexedDB/test/unit/test_rename_objectStore.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const storeName_ToBeDeleted = "test store to be deleted";
   const storeName_v0 = "test store v0";
   const storeName_v1 = "test store v1";
   const storeName_v2 = "test store v2";
   const storeName_v3 = storeName_ToBeDeleted;
   const storeName_v4 = "test store v4";
@@ -162,10 +162,9 @@ function testSteps()
   db = event.target.result;
 
   is(db.objectStoreNames.length, 1, "Correct objectStoreNames list");
   ok(db.objectStoreNames.contains(storeName_v3), "Correct name");
 
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_rename_objectStore_errors.js
+++ b/dom/indexedDB/test/unit/test_rename_objectStore_errors.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
   const storeName1 = "test store 1";
   const storeName2 = "test store 2";
 
   info("Setup test object stores.");
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
@@ -118,10 +118,9 @@ function testSteps()
     is(e.name, "InvalidStateError", "correct error");
   }
 
   txn.oncomplete = continueToNextStepSync;
   yield undefined;
   db.close();
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_request_readyState.js
+++ b/dom/indexedDB/test/unit/test_request_readyState.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 1);
   is(request.readyState, "pending", "Correct readyState");
 
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
@@ -42,10 +42,9 @@ function testSteps()
 
   ok(event.target.result, "Got something");
   is(request.readyState, "done", "Correct readyState");
 
   // Wait for success
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_setVersion.js
+++ b/dom/indexedDB/test/unit/test_setVersion.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onsuccess = grabEventAndContinueHandler;
   let event = yield undefined;
 
@@ -41,11 +41,10 @@ function testSteps()
 
     // Wait for success
     yield undefined;
 
     db.close();
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_setVersion_abort.js
+++ b/dom/indexedDB/test/unit/test_setVersion_abort.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onsuccess = unexpectedSuccessHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -88,10 +88,9 @@ function testSteps()
   is(db2.version, 1, "Correct version");
   is(db2.objectStoreNames.length, 1, "Correct objectStoreNames length");
   is(objectStore2.indexNames.length, 1, "Correct indexNames length");
   is(db.version, 0, "Correct version still");
   is(db.objectStoreNames.length, 0, "Correct objectStoreNames length still");
   is(objectStore.indexNames.length, 0, "Correct indexNames length still");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_setVersion_events.js
+++ b/dom/indexedDB/test/unit/test_setVersion_events.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   // Open a datbase for the first time.
   let request = indexedDB.open(name, 1);
 
   // Sanity checks
   ok(request instanceof IDBRequest, "Request should be an IDBRequest");
@@ -155,11 +155,10 @@ function testSteps()
   is(event.oldVersion, 0, "Correct old version");
   is(event.newVersion, 1, "Correct new version");
   event = new IDBVersionChangeEvent("versionchange", {oldVersion: 1, newVersion: 2});
   ok(event, "Should be able to create an event with both versions");
   is(event.oldVersion, 1, "Correct old version");
   is(event.newVersion, 2, "Correct new version");
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_setVersion_exclusion.js
+++ b/dom/indexedDB/test/unit/test_setVersion_exclusion.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = unexpectedSuccessHandler;
 
@@ -86,10 +86,9 @@ function testSteps()
   request2.onsuccess = grabEventAndContinueHandler;
 
   event = yield undefined;
   is(event.type, "success", "Expect a success event");
   is(event.target.result, db, "Same database");
   is(db.version, 2, "Database has correct version");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_setVersion_throw.js
+++ b/dom/indexedDB/test/unit/test_setVersion_throw.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "test_setVersion_throw";
 
   // This test requires two databases. The first needs to be a low version
   // number that gets closed when a second higher version number database is
   // created. Then the upgradeneeded event for the second database throws an
   // exception and triggers an abort/close.
 
@@ -45,10 +45,9 @@ function testSteps()
 
   event.preventDefault();
 
   is(event.type, "error", "Got an error event for db 2");
   ok(event.target.error instanceof DOMError, "Request has a DOMError");
   is(event.target.error.name, "AbortError", "Request has AbortError");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_storage_manager_estimate.js
+++ b/dom/indexedDB/test/unit/test_storage_manager_estimate.js
@@ -1,24 +1,24 @@
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname :
 	       "test_storage_manager_estimate.js";
   const objectStoreName = "storagesManager";
   const arraySize = 1e6;
 
   ok('estimate' in navigator.storage, 'Has estimate function');
   is(typeof navigator.storage.estimate, 'function', 'estimate is function');
   ok(navigator.storage.estimate() instanceof Promise,
      'estimate() method exists and returns a Promise');
 
   navigator.storage.estimate().then(estimation => {
-    testGenerator.send(estimation.usage);
+    testGenerator.next(estimation.usage);
   });
 
   let before = yield undefined;
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = continueToNextStep;
@@ -26,38 +26,37 @@ function testSteps()
 
   let db = event.target.result;
   db.onerror = errorHandler;
 
   let objectStore = db.createObjectStore(objectStoreName, { });
   yield undefined;
 
   navigator.storage.estimate().then(estimation => {
-    testGenerator.send(estimation.usage);
+    testGenerator.next(estimation.usage);
   });
   let usageAfterCreate = yield undefined;
   ok(usageAfterCreate > before, 'estimated usage must increase after createObjectStore');
 
   let txn = db.transaction(objectStoreName, "readwrite");
   objectStore = txn.objectStore(objectStoreName);
   objectStore.put(new Uint8Array(arraySize), 'k');
   txn.oncomplete = continueToNextStep;
   txn.onabort = errorHandler;
   txn.onerror = errorHandler;
   event = yield undefined;
 
   navigator.storage.estimate().then(estimation => {
-    testGenerator.send(estimation.usage);
+    testGenerator.next(estimation.usage);
   });
   let usageAfterPut = yield undefined;
   ok(usageAfterPut > usageAfterCreate, 'estimated usage must increase after putting large object');
   db.close();
 
   finishTest();
-  yield undefined;
 }
 
 function setup()
 {
   SpecialPowers.pushPrefEnv({
     "set": [["dom.storageManager.enabled", true]]
   },  runTest);
 }
--- a/dom/indexedDB/test/unit/test_success_events_after_abort.js
+++ b/dom/indexedDB/test/unit/test_success_events_after_abort.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
 
   let db = event.target.result;
 
@@ -50,11 +50,10 @@ function testSteps()
                      .getService(comp.interfaces.nsIThreadManager)
                      .currentThread;
     while (thread.hasPendingEvents()) {
       thread.processNextEvent(false);
     }
   }
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_table_locks.js
+++ b/dom/indexedDB/test/unit/test_table_locks.js
@@ -12,17 +12,17 @@ const idxName2 = "i2";
 const idxKeyPathProp = "idx";
 const objDataProp = "data";
 const objData = "1234567890";
 const objDataCount = 5;
 const loopCount = 100;
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let req = indexedDB.open(dbName, dbVersion);
   req.onerror = errorHandler;
   req.onupgradeneeded = grabEventAndContinueHandler;
   req.onsuccess = grabEventAndContinueHandler;
 
   let event = yield undefined;
 
@@ -52,17 +52,16 @@ function testSteps()
   doReadOnlyTransaction(db, 0, loopCount);
   doReadWriteTransaction(db, 0, loopCount);
 
   // Wait for readonly and readwrite transaction loops to complete.
   yield undefined;
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
 
 function doReadOnlyTransaction(db, key, remaining)
 {
   if (!remaining) {
     info("Finished all readonly transactions");
     continueToNextStep();
     return;
--- a/dom/indexedDB/test/unit/test_table_rollback.js
+++ b/dom/indexedDB/test/unit/test_table_rollback.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const dbName = ("window" in this) ? window.location.pathname : "test";
   const objName1 = "foo";
   const objName2 = "bar";
   const data1 = "1234567890";
   const data2 = "0987654321";
   const dataCount = 500;
 
@@ -106,10 +106,9 @@ function testSteps()
     yield undefined;
   }
 
   ok(readResult, "Got result from readonly transaction");
   is(readError, null, "No read error");
   is(writeAborted, true, "Aborted readwrite transaction");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_temporary_storage.js
+++ b/dom/indexedDB/test/unit/test_temporary_storage.js
@@ -45,32 +45,32 @@ function testSteps()
 
       let request =
         indexedDB.openForPrincipal(getPrincipal(spec), name, options);
       request.onerror = function(event) {
         is(request.error.name,
            gotUpgradeIncomplete ? "AbortError" : "QuotaExceededError",
            "Reached quota limit");
         event.preventDefault();
-        testGenerator.send(false);
+        testGenerator.next(false);
       }
       request.onupgradeneeded = function(event) {
         event.target.transaction.onabort = function(e) {
           gotUpgradeIncomplete = true;
           is(e.target.error.name, "QuotaExceededError", "Reached quota limit");
         }
         event.target.transaction.oncomplete = function() {
           gotUpgradeComplete = true;
         }
       }
       request.onsuccess = function(event) {
         let db = event.target.result;
         is(db.version, finalVersion, "Correct version " + finalVersion);
         databases.push(db);
-        testGenerator.send(true);
+        testGenerator.next(true);
       }
 
       let shouldContinue = yield undefined;
       if (shouldContinue) {
         is(gotUpgradeComplete, true, "Got upgradeneeded event");
         ok(true, "Got success event");
       } else {
         break;
@@ -92,32 +92,32 @@ function testSteps()
 
       let request =
         indexedDB.openForPrincipal(getPrincipal(spec), name, options);
       request.onerror = function(event) {
         is(request.error.name,
            gotUpgradeIncomplete ? "AbortError" : "QuotaExceededError",
            "Reached quota limit");
         event.preventDefault();
-        testGenerator.send(false);
+        testGenerator.next(false);
       }
       request.onupgradeneeded = function(event) {
         event.target.transaction.onabort = function(e) {
           gotUpgradeIncomplete = true;
           is(e.target.error.name, "QuotaExceededError", "Reached quota limit");
         }
         event.target.transaction.oncomplete = function() {
           gotUpgradeComplete = true;
         }
       }
       request.onsuccess = function(event) {
         let db = event.target.result;
         is(db.version, finalVersion, "Correct version " + finalVersion);
         databases.push(db);
-        testGenerator.send(true);
+        testGenerator.next(true);
       }
 
       let shouldContinue = yield undefined;
       if (shouldContinue) {
         is(gotUpgradeComplete, true, "Got upgradeneeded event");
         ok(true, "Got success event");
       } else {
         break;
--- a/dom/indexedDB/test/unit/test_traffic_jam.js
+++ b/dom/indexedDB/test/unit/test_traffic_jam.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let requests = [];
   function doOpen(version, errorCallback, upgradeNeededCallback, successCallback) {
     let request = indexedDB.open(name, version);
     request.onerror = errorCallback;
     request.onupgradeneeded = upgradeNeededCallback;
@@ -77,11 +77,10 @@ function testSteps()
   requests[4].onsuccess = grabEventAndContinueHandler;
 
   event = yield undefined;
   is(event.type, "success", "expect a success event");
   is(event.target, requests[4], "fired at the right request");
   event.target.result.close();
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_transaction_abort.js
+++ b/dom/indexedDB/test/unit/test_transaction_abort.js
@@ -8,17 +8,17 @@ var testGenerator = testSteps();
 var abortFired = false;
 
 function abortListener(evt)
 {
   abortFired = true;
   is(evt.target.error, null, "Expect a null error for an aborted transaction");
 }
 
-function testSteps()
+function* testSteps()
 {
   const name = this.window ? window.location.pathname : "Splendid Test";
 
   let request = indexedDB.open(name, 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
   let event = yield undefined;
@@ -375,10 +375,9 @@ function testSteps()
 
   event = yield undefined;
   is(event.type, "abort", "transaction should fail");
   is(event.target, transaction, "transaction should fail");
 
   ok(abortFired, "Abort should have fired!");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_transaction_abort_hang.js
+++ b/dom/indexedDB/test/unit/test_transaction_abort_hang.js
@@ -3,17 +3,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 "use strict";
 
 var self = this;
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const dbName = self.window ?
                  window.location.pathname :
                  "test_transaction_abort_hang";
   const objStoreName = "foo";
   const transactionCount = 30;
 
   let completedTransactionCount = 0;
@@ -82,10 +82,9 @@ function testSteps()
   ok(true, "Created all transactions");
 
   event = yield undefined;
 
   ok(true, "Completed transaction " + ++completedTransactionCount);
   ok(caughtError, "Caught the error event when we aborted the transaction");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_transaction_duplicate_store_names.js
+++ b/dom/indexedDB/test/unit/test_transaction_duplicate_store_names.js
@@ -1,17 +1,17 @@
 
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps() {
+function* testSteps() {
   const dbName = this.window ?
                  window.location.pathname :
                  "test_transaction_duplicate_store_names";
   const dbVersion = 1;
   const objectStoreName = "foo";
   const data = { };
   const dataKey = 1;
 
@@ -34,10 +34,9 @@ function testSteps() {
   transaction.onerror = errorHandler;
   transaction.oncomplete = grabEventAndContinueHandler;
 
   event = yield undefined;
 
   ok(true, "Transaction created successfully");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_transaction_error.js
+++ b/dom/indexedDB/test/unit/test_transaction_error.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps() {
+function* testSteps() {
   const dbName = this.window ?
                  window.location.pathname :
                  "test_transaction_error";
   const dbVersion = 1;
   const objectStoreName = "foo";
   const data = { };
   const dataKey = 1;
   const expectedError = "ConstraintError";
@@ -127,10 +127,9 @@ function testSteps() {
   is(event.type, "abort", "Got an abort event");
   is(event.target, transaction, "Abort event targeted transaction");
   is(event.currentTarget, transaction,
      "Abort event only targeted transaction");
   is(event.currentTarget.error.name, expectedError,
      "Transaction has correct error");
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_transaction_lifetimes.js
+++ b/dom/indexedDB/test/unit/test_transaction_lifetimes.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = unexpectedSuccessHandler;
   let event = yield undefined;
 
   let db = event.target.result;
@@ -82,10 +82,9 @@ function testSteps()
   }
   catch (e) {
     ok(e instanceof DOMException, "Got database exception.");
     is(e.name, "InvalidStateError", "Good error.");
     is(e.code, DOMException.INVALID_STATE_ERR, "Good error code.");
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_transaction_lifetimes_nested.js
+++ b/dom/indexedDB/test/unit/test_transaction_lifetimes_nested.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var disableWorkerTest = "This test uses SpecialPowers";
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
 
   let db = event.target.result;
   db.onerror = errorHandler;
@@ -43,10 +43,9 @@ function testSteps()
   }
 
   ok(transaction2, "Non-null transaction2");
 
   continueToNextStep();
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_transaction_ordering.js
+++ b/dom/indexedDB/test/unit/test_transaction_ordering.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   let event = yield undefined;
 
   let db = event.target.result;
   db.onerror = errorHandler;
@@ -39,11 +39,10 @@ function testSteps()
   request = trans3.objectStore("foo").get(42);
   request.onsuccess = grabEventAndContinueHandler;
   request.onerror = errorHandler;
 
   event = yield undefined;
   is(event.target.result, "2", "Transactions were ordered properly.");
 
   finishTest();
-  yield undefined;
 }
 
--- a/dom/indexedDB/test/unit/test_unique_index_update.js
+++ b/dom/indexedDB/test/unit/test_unique_index_update.js
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   let request = indexedDB.open(this.window ? window.location.pathname : "Splendid Test", 1);
   request.onerror = errorHandler;
   request.onupgradeneeded = grabEventAndContinueHandler;
   request.onsuccess = grabEventAndContinueHandler;
 
   let event = yield undefined;
 
@@ -55,10 +55,9 @@ function testSteps()
       request.onsuccess = unexpectedSuccessHandler;
       request.addEventListener("error", new ExpectError("ConstraintError", true));
     };
 
     yield undefined;
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_view_put_get_values.js
+++ b/dom/indexedDB/test/unit/test_view_put_get_values.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var disableWorkerTest = "Need a way to set temporary prefs from a worker";
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name =
     this.window ? window.location.pathname : "test_view_put_get_values.js";
 
   const objectStoreName = "Views";
 
   const viewData = { key: 1, view: getRandomView(100000) };
 
@@ -93,10 +93,9 @@ function testSteps()
 
     request = indexedDB.deleteDatabase(name);
     request.onerror = errorHandler;
     request.onsuccess = continueToNextStepSync;
     yield undefined;
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_wasm_getAll.js
+++ b/dom/indexedDB/test/unit/test_wasm_getAll.js
@@ -1,27 +1,27 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name =
     this.window ? window.location.pathname : "test_wasm_getAll.js";
 
   const objectStoreInfo = { name: "Wasm", options: { autoIncrement: true } };
 
   const values = [ 42, [], [] ];
 
   if (!isWasmSupported()) {
     finishTest();
-    yield undefined;
+    return;
   }
 
   getWasmBinary('(module (func (result i32) (i32.const 1)))');
   let binary = yield undefined;
   values[1].push(getWasmModule(binary));
 
   getWasmBinary('(module (func (result i32) (i32.const 2)))');
   binary = yield undefined;
@@ -114,10 +114,9 @@ function testSteps()
   verifyResult(request.result, values);
 
   for (let resultToProcess of resultsToProcess) {
     verifyWasmModule(resultToProcess.result, resultToProcess.value);
     yield undefined;
   }
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/test_wasm_put_get_values.js
+++ b/dom/indexedDB/test/unit/test_wasm_put_get_values.js
@@ -1,27 +1,27 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var testGenerator = testSteps();
 
-function testSteps()
+function* testSteps()
 {
   const name =
     this.window ? window.location.pathname : "test_wasm_put_get_values.js";
 
   const objectStoreName = "Wasm";
 
   const wasmData = { key: 1, wasm: null };
 
   if (!isWasmSupported()) {
     finishTest();
-    yield undefined;
+    return;
   }
 
   getWasmBinary('(module (func (nop)))');
   let binary = yield undefined;
 
   wasmData.wasm = getWasmModule(binary);
 
   info("Opening database");
@@ -71,10 +71,9 @@ function testSteps()
               .objectStore(objectStoreName).get(wasmData.key);
   request.onsuccess = continueToNextStepSync;
   yield undefined;
 
   verifyWasmModule(request.result, wasmData.wasm);
   yield undefined;
 
   finishTest();
-  yield undefined;
 }
--- a/dom/indexedDB/test/unit/xpcshell-head-parent-process.js
+++ b/dom/indexedDB/test/unit/xpcshell-head-parent-process.js
@@ -69,24 +69,23 @@ function finishTest()
 
     SpecialPowers.notifyObserversInParentProcess(null, "disk-space-watcher",
                                                  "free");
   }
 
   SpecialPowers.removeFiles();
 
   do_execute_soon(function(){
-    testGenerator.close();
     do_test_finished();
   })
 }
 
 function grabEventAndContinueHandler(event)
 {
-  testGenerator.send(event);
+  testGenerator.next(event);
 }
 
 function continueToNextStep()
 {
   do_execute_soon(function() {
     testGenerator.next();
   });
 }
@@ -387,17 +386,17 @@ function getWasmBinarySync(text)
   let binary = testingFunctions.wasmTextToBinary(text);
   return binary;
 }
 
 function getWasmBinary(text)
 {
   let binary = getWasmBinarySync(text);
   executeSoon(function() {
-    testGenerator.send(binary);
+    testGenerator.next(binary);
   });
 }
 
 function getWasmModule(binary)
 {
   let module = new WebAssembly.Module(binary);
   return module;
 }
@@ -495,17 +494,17 @@ function verifyWasmModule(module1, modul
   ok(code1 instanceof Uint8Array, "Instance of Uint8Array");
   ok(code1.length == code2.length, "Correct length");
   verifyBuffers(code1, code2);
   continueToNextStep();
 }
 
 function grabFileUsageAndContinueHandler(request)
 {
-  testGenerator.send(request.fileUsage);
+  testGenerator.next(request.fileUsage);
 }
 
 function getUsage(usageHandler)
 {
   let qms = Cc["@mozilla.org/dom/quota-manager-service;1"]
               .getService(Ci.nsIQuotaManagerService);
   let principal = Cc["@mozilla.org/systemprincipal;1"]
                     .createInstance(Ci.nsIPrincipal);
--- a/dom/ipc/tests/test_blob_sliced_from_parent_process.html
+++ b/dom/ipc/tests/test_blob_sliced_from_parent_process.html
@@ -40,20 +40,20 @@ function childFrameScript() {
     ok(pass, name, diag);
   }
 
   function finish(result) {
     sendAsyncMessage(messageName, { op: "done", result: result });
   }
 
   function grabAndContinue(arg) {
-    testGenerator.send(arg);
+    testGenerator.next(arg);
   }
 
-  function testSteps() {
+  function* testSteps() {
     addMessageListener(messageName, grabAndContinue);
     let message = yield undefined;
 
     let blob = message.data;
 
     ok(blob instanceof Ci.nsIDOMBlob, "Received a Blob");
     is(blob.size, blobText.length, "Blob has correct length");
     is(blob.type, blobType, "Blob has correct type");
@@ -93,52 +93,48 @@ function childFrameScript() {
     slice = slice.slice(secondSliceStart, secondSliceEnd, blobType);
 
     ok(slice instanceof Ci.nsIDOMBlob, "Second slice returned a Blob");
     is(slice.size, sliceText.length, "Second slice has correct length");
     is(slice.type, blobType, "Second slice has correct type");
 
     info("Sending second slice");
     finish(slice);
-
-    yield undefined;
   }
 
   let testGenerator = testSteps();
   testGenerator.next();
 }
 
 function parentFrameScript(mm) {
   const messageName = "test:blob-slice-test";
   const blobData = ["So", " ", "many", " ", "blobs!"];
   const blobText = blobData.join("");
   const blobType = "text/plain";
 
   const sliceText = "an";
 
   function grabAndContinue(arg) {
-    testGenerator.send(arg);
+    testGenerator.next(arg);
   }
 
-  function testSteps() {
+  function* testSteps() {
     let slice = yield undefined;
 
     ok(slice instanceof Blob, "Received a Blob");
     is(slice.size, sliceText.length, "Slice has correct size");
     is(slice.type, blobType, "Slice has correct type");
 
     let reader = new FileReader();
     reader.onload = grabAndContinue;
     reader.readAsText(slice);
     yield undefined;
 
     is(reader.result, sliceText, "Slice has correct data");
     SimpleTest.finish();
-
-    yield undefined;
   }
 
   let testGenerator = testSteps();
   testGenerator.next();
 
   mm.addMessageListener(messageName, function(message) {
     let data = message.data;
     switch (data.op) {
@@ -148,17 +144,17 @@ function parentFrameScript(mm) {
       }
 
       case "ok": {
         ok(data.condition, data.name, data.diag);
         break;
       }
 
       case "done": {
-        testGenerator.send(data.result);
+        testGenerator.next(data.result);
         break;
       }
 
       default: {
         ok(false, "Unknown op: " + data.op);
         SimpleTest.finish();
       }
     }
--- a/dom/security/test/contentverifier/head.js
+++ b/dom/security/test/contentverifier/head.js
@@ -67,17 +67,17 @@ var aboutNewTabService = Cc["@mozilla.or
 
 function pushPrefs(...aPrefs) {
   return SpecialPowers.pushPrefEnv({"set": aPrefs});
 }
 
 /*
  * run tests with input from TESTS
  */
-function doTest(aExpectedStrings, reload, aUrl, aNewTabPref) {
+function* doTest(aExpectedStrings, reload, aUrl, aNewTabPref) {
   // set about:newtab location for this test if it's a newtab test
   if (aNewTabPref) {
     aboutNewTabService.newTabURL = aNewTabPref;
   }
 
   // set prefs
   yield pushPrefs(
       ["browser.newtabpage.remote.content-signing-test", true],
@@ -181,28 +181,28 @@ function doTest(aExpectedStrings, reload
               });
           }
         );
       }
     }
   );
 }
 
-function runTests() {
+function* runTests() {
   // run tests from TESTS
   for (let i = 0; i < TESTS.length; i++) {
     let testCase = TESTS[i];
     let url = "", aNewTabPref = "";
     let reload = false;
     var aExpectedStrings = testCase.testStrings;
     if (testCase.aboutURI) {
       url = ABOUT_NEWTAB_URI;
       aNewTabPref = testCase.aboutURI;
       if (aNewTabPref == URI_GOOD || aNewTabPref == URI_SRI) {
         reload = true;
       }
     } else {
       url = testCase.url;
     }
 
-    yield doTest(aExpectedStrings, reload, url, aNewTabPref);
+    yield* doTest(aExpectedStrings, reload, url, aNewTabPref);
   }
 }
--- a/dom/security/test/cors/test_CrossSiteXHR.html
+++ b/dom/security/test/cors/test_CrossSiteXHR.html
@@ -25,25 +25,25 @@ var gen;
 function initTest() {
   SimpleTest.waitForExplicitFinish();
   // Allow all cookies, then do the actual test initialization
   SpecialPowers.pushPrefEnv({"set": [["network.cookie.cookieBehavior", 0]]}, initTestCallback);
 }
 
 function initTestCallback() {
   window.addEventListener("message", function(e) {
-    gen.send(e.data);
+    gen.next(e.data);
   }, false);
 
   gen = runTest();
   
   gen.next()
 }
 
-function runTest() {
+function* runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
   // Test preflight-less requests
   basePath = "/tests/dom/security/test/cors/file_CrossSiteXHR_server.sjs?"
   baseURL = "http://mochi.test:8888" + basePath;
 
@@ -1446,16 +1446,14 @@ function runTest() {
          "wrong events in test for " + test.toSource());
       is(res.progressEvents, 0,
          "wrong progressevents in test for " + test.toSource());
     }
   }
 
 
   SimpleTest.finish();
-
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/security/test/cors/test_CrossSiteXHR_cache.html
+++ b/dom/security/test/cors/test_CrossSiteXHR_cache.html
@@ -15,22 +15,22 @@
 </div>
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("This test needs to generate artificial pauses, hence it uses timeouts.  There is no way around it, unfortunately. :(");
 
 window.addEventListener("message", function(e) {
-  gen.send(e.data);
+  gen.next(e.data);
 }, false);
 
 gen = runTest();
 
-function runTest() {
+function* runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
   loader.src = "http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner.html";
   origin = "http://example.org";
   yield undefined;
 
@@ -572,16 +572,14 @@ function runTest() {
          "opening,rs1,sending,loadstart,rs2,rs4,error,loadend",
          "wrong events in test for " + testName);
       is(res.progressEvents, 0,
          "wrong events in test for " + testName);
     }
   }
 
   SimpleTest.finish();
-
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/security/test/cors/test_CrossSiteXHR_origin.html
+++ b/dom/security/test/cors/test_CrossSiteXHR_origin.html
@@ -46,22 +46,22 @@ var origins =
      file: 'http://example.org/tests/dom/security/test/cors/file_CrossSiteXHR_inner_data.sjs'
    },
    ];
 
    //['https://example.com:443'],
    //['https://sub1.test1.example.com:443'],
 
 window.addEventListener("message", function(e) {
-  gen.send(e.data);
+  gen.next(e.data);
 }, false);
 
 gen = runTest();
 
-function runTest() {
+function* runTest() {
   var loader = document.getElementById('loader');
   var loaderWindow = loader.contentWindow;
   loader.onload = function () { gen.next() };
 
   // Test preflight-less requests
   basePath = "/tests/dom/security/test/cors/file_CrossSiteXHR_server.sjs?"
   baseURL = "http://mochi.test:8888" + basePath;
 
@@ -154,18 +154,16 @@ function runTest() {
          "opening,rs1,sending,loadstart,rs2,rs4,error,loadend",
          "wrong events in test for " + allowOrigin);
       is(res.progressEvents, 0,
          "wrong events in test for " + allowOrigin);
     }
   }
 
   SimpleTest.finish();
-
-  yield undefined;
 }
 
 addLoadEvent(function() {
   SpecialPowers.pushPrefEnv({"set": [["network.jar.block-remote-files", false]]}, function() {
     gen.next();
   });
 });
 </script>
--- a/dom/tests/browser/browser_bug1008941_dismissGeolocationHanger.js
+++ b/dom/tests/browser/browser_bug1008941_dismissGeolocationHanger.js
@@ -2,17 +2,17 @@
  * 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/.
  */
 "use strict";
 
 const TEST_URI = "http://example.com/" +
                  "browser/dom/tests/browser/position.html";
 
-add_task(function testDismissHanger() {
+add_task(function* testDismissHanger() {
   info("Check that location is not shared when dismissing the geolocation hanger");
 
   let promisePanelShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown", true);
   yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URI);
   yield promisePanelShown;
 
   // click outside the Geolocation hanger to dismiss it
   window.document.getElementById("nav-bar").click();
--- a/dom/tests/mochitest/general/test_bug504220.html
+++ b/dom/tests/mochitest/general/test_bug504220.html
@@ -35,30 +35,29 @@ function run_test() {
   // Likewise, document.body.hashchange should mirror window.onhashchange
   numEvents = 0;
   var func2 = function() { numEvents++; gGen.next() };
   window.onhashchange = func2;
   is(document.body.onhashchange, func2);
 
   SimpleTest.waitForExplicitFinish();
 
-  function waitForHashchange() {
+  function* waitForHashchange() {
     // Change the document's hash.  If we've been running this test manually,
     // the hash might already be "#foo", so we need to check in order to be
     // sure we trigger a hashchange.
     if (location.hash != "#foo")
       location.hash = "#foo";
     else
       location.hash = "#bar";
 
     yield undefined;
 
     is(numEvents, 1, "Exactly one hashchange should have been fired.");
     SimpleTest.finish();
-    yield undefined;
   }
 
   var gGen = waitForHashchange();
   gGen.next();
 }
 
 </script>
 </pre>
--- a/dom/tests/mochitest/general/test_domWindowUtils.html
+++ b/dom/tests/mochitest/general/test_domWindowUtils.html
@@ -32,17 +32,17 @@ var domWindowUtils = SpecialPowers.getDO
 
 var gTests = [
 /*
   nsIDOMElement elementFromPoint(in long aX,
                                  in long aY,
                                  in boolean aIgnoreRootScrollFrame,
                                  in boolean aFlushLayout);
 */
-function testElementFromPoint() {
+async function testElementFromPoint() {
   let onscreen = document.getElementById("onscreen");
   let offscreen = document.getElementById("offscreen");
   let htmldoc = document.documentElement;
   ok(onscreen, "on screen element exists");
   ok(offscreen, "off screen element exists");
   ok(htmldoc, "htmldoc element exists");
 
   let testData = [
@@ -84,114 +84,93 @@ function testElementFromPoint() {
 
       moveEl.style.left = moveX + "px";
       moveEl.style.top = moveY + "px";
     }
     let found = SpecialPowers.unwrap(domWindowUtils.elementFromPoint(
                                      x, y, ignoreScroll, flushLayout));
     is(found, expected, "at index " + i + " for data " + testData[i][0].toSource());
   }
-
-  SimpleTest.executeSoon(function() {
-    next();
-  });
 },
 
 /**
  * Test .isHandlingUserInput attribute.
  */
-function testHandlingUserInput() {
+async function testHandlingUserInput() {
   ok('isHandlingUserInput' in domWindowUtils,
      "isHandlingUserInput should be present");
 
   is(domWindowUtils.isHandlingUserInput, false,
      "isHandlingUserInput should return false if nothing is happening");
 
-  function testEvents() {
-    var data = [
-      {
-        eventName: "click",
-        result: true,
-      },
-      {
-        eventName: "mousemove",
-        result: false,
-      },
-      {
-        eventName: "mouseup",
-        result: true,
-      },
-      {
-        eventName: "mousedown",
-        result: true,
-      },
-      {
-        eventName: "keydown",
-        result: true,
-      },
-      {
-        eventName: "keyup",
-        result: true,
-      },
-    ];
+  var data = [
+    {
+      eventName: "click",
+      result: true,
+    },
+    {
+      eventName: "mousemove",
+      result: false,
+    },
+    {
+      eventName: "mouseup",
+      result: true,
+    },
+    {
+      eventName: "mousedown",
+      result: true,
+    },
+    {
+      eventName: "keydown",
+      result: true,
+    },
+    {
+      eventName: "keyup",
+      result: true,
+    },
+  ];
 
-    for (let i=0; i<data.length; ++i) {
+  for (let i=0; i<data.length; ++i) {
+    let eventPromise = new Promise(resolve => {
       document.addEventListener(data[i].eventName, function() {
-        document.removeEventListener(data[i].eventName, arguments.callee);
-
         is(domWindowUtils.isHandlingUserInput, data[i].result,
            "isHandlingUserInput should be " + data[i].result);
 
-        SimpleTest.executeSoon(function() {
-          try { testEventsRunner.next(); } catch (e) { }
-        });
-      });
-
-      SimpleTest.executeSoon(function() {
-        if (data[i].eventName == "click") {
-          synthesizeMouseAtCenter(document.body, {});
-        } else if (data[i].eventName.indexOf("key") == 0) {
-          synthesizeKey("VK_A", { type: data[i].eventName });
-        } else {
-          synthesizeMouseAtCenter(document.body, { type: data[i].eventName });
-        }
-      });
-
-      yield undefined;
-    }
+        SimpleTest.executeSoon(resolve);
+      }, {once: true});
+    });
 
     SimpleTest.executeSoon(function() {
-      next();
+      if (data[i].eventName == "click") {
+        synthesizeMouseAtCenter(document.body, {});
+      } else if (data[i].eventName.indexOf("key") == 0) {
+        synthesizeKey("VK_A", { type: data[i].eventName });
+      } else {
+        synthesizeMouseAtCenter(document.body, { type: data[i].eventName });
+      }
     });
+
+    await eventPromise;
   }
-
-  var testEventsRunner = testEvents();
-  testEventsRunner.next();
 },
 ];
 
-function runner() {
+async function runner() {
   for (let i=0; i<gTests.length; ++i) {
-    gTests[i]();
-    yield undefined;
+    if (i > 0) {
+      await new Promise(r => SimpleTest.executeSoon(r));
+    }
+    await gTests[i]();
   }
 
   SimpleTest.finish();
 };
 
-var gTestRunner = runner();
-
-function next() {
-  try { gTestRunner.next(); } catch (e) { if (e != StopIteration) { throw e; } }
-}
-
 // Run the test from onload, since the onscreen and offscreen divs should be in
 // the right places by then.
-addLoadEvent(function() {
-  gTestRunner.next();
-});
+addLoadEvent(runner);
 
 </script>
 
 <p id="display"></p>
 
 </body>
 </html>
--- a/dom/tests/mochitest/general/test_spacetopagedown.html
+++ b/dom/tests/mochitest/general/test_spacetopagedown.html
@@ -23,17 +23,17 @@ function pressKey(isShift)
 
 function initTest()
 {
   SpecialPowers.pushPrefEnv({"set":[["general.smoothScroll", false]]}, runTest);
 }
 
 function runTest()
 {
-  Task.async(function () {
+  Task.async(function* () {
     yield pressKey(false);
 
     ok(window.scrollY > 0, "Space with no focus" + window.scrollY);
     yield pressKey(true);
     is(window.scrollY, 0, "Shift+Space with no focus");
 
     let checkbox = document.getElementById("checkbox");
     checkbox.focus();
--- a/dom/tests/mochitest/storageevent/test_storageNotifications.html
+++ b/dom/tests/mochitest/storageevent/test_storageNotifications.html
@@ -29,17 +29,17 @@ var expectedTypes = [
 var tests = Tests();
 function setup() {
   sessionStorage.clear();
   SimpleTest.executeSoon(function() {
     tests.next();
   });
 }
 
-function Tests()
+function* Tests()
 {
   // Initially check the both storages are empty
   is(sessionStorage.length, 0, "Session storage is empty [1]");
   is(localStorage.length, 0, "Local storage is empty [1]");
 
   var onStorageChanged = {
     observe: function(subject, topic, type) {
       if (topic == "dom-storage2-changed") {
--- a/dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.html
+++ b/dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.html
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
   <title>postMessage structured clone page</title>
   <script type="application/javascript;version=1.7"
           src="postMessage_structured_clone_helper.js"></script>
   <script type="application/javascript;version=1.7">
-    var generator = new getTestContent()
+    var generator = getTestContent()
 
     function isClone(a, b) {
         window.dump("Object a: " + a + "\n");
         window.dump("Object b: " + b + "\n");
         var stack = [[a, b]];
         var memory = new WeakMap();
         var rmemory = new WeakMap();
 
@@ -88,17 +88,17 @@
                 rmemory.set(y, x);
             }
         }
         return true;
     }
 
     function receiveMessage(evt)
     {
-      if (isClone(evt.data, generator.next()))
+      if (isClone(evt.data, generator.next().value))
         window.parent.postMessage("TEST-PASS", "*");
       else
         window.parent.postMessage("TEST-FAIL", "*");
     }
     window.addEventListener("message", receiveMessage, false);
   </script>
 </head>
 <body>
--- a/dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js
+++ b/dom/tests/mochitest/whatwg/postMessage_structured_clone_helper.js
@@ -1,9 +1,9 @@
-function getTestContent()
+function* getTestContent()
 {
   yield "hello";
   yield 2+3;
   yield 12;
   yield null;
   yield "complex" + "string";
   yield new Object();
   yield new Date(1306113544);
--- a/dom/tests/mochitest/whatwg/test_postMessage_structured_clone.html
+++ b/dom/tests/mochitest/whatwg/test_postMessage_structured_clone.html
@@ -24,35 +24,37 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script class="testbody" type="application/javascript">
 /** Test for Bug 553125 **/
 
 SimpleTest.waitForExplicitFinish();
 
 var lastMessage = null;
 var crossOrigin = false;
-var generator = new getTestContent();
+var generator = getTestContent();
 
 function runNextSameOrigin() {
-  try {
-    lastMessage = generator.next();
-  } catch (e) {
-    generator = new getTestContent();
+  let {done, value} = generator.next();
+  if (done) {
+    generator = getTestContent();
     crossOrigin = true;
     runNextCrossOrigin();
-  } 
+    return;
+  }
+  lastMessage = value;
   window.frames.sameDomain.postMessage(lastMessage, "http://mochi.test:8888");
 }
 
 function runNextCrossOrigin() {
-  try {
-    lastMessage = generator.next();
-  } catch (e) {
+  let {done, value} = generator.next();
+  if (done) {
     SimpleTest.finish();
+    return;
   }
+  lastMessage = value;
   window.frames.crossDomain.postMessage(lastMessage, "http://example.org:8000");
 }
 
 function receiveMessage(evt) {
   if (evt.data == "TEST-PASS")
     SimpleTest.ok(true, "structured clone of | " + lastMessage + " | succeeded");
   else
     SimpleTest.ok(false, "structured clone of | " + lastMessage + " | failed");
--- a/dom/workers/test/referrer_worker.html
+++ b/dom/workers/test/referrer_worker.html
@@ -21,17 +21,17 @@ function info(val) {
 function is(a, b, message) {
   ok(a == b, message);
 }
 
 function finish() {
   // Let window.onerror have a chance to fire
   setTimeout(function() {
     setTimeout(function() {
-      tests.close();
+      tests.return();
       window.parent.postMessage("SimpleTest.finish();", "*");
     }, 0);
   }, 0);
 }
 
 var testCases = {
   'same-origin':  { 'Referrer-Policy' : { 'default' : 'full',
                                           'origin' : 'origin',
@@ -114,17 +114,17 @@ function checkIndividualResults(aType, a
   };
   var onerror = xhr => {
     ok(false, "Can't get results from the counter server.");
     finish();
   };
   doXHR(GET_RESULT, onload, onerror);
 }
 
-var tests = (function() {
+var tests = (function*() {
 
   for (var type in testCases) {
     for (var policy in testCases[type]['Referrer-Policy']) {
       yield resetState();
       var searchParams = new URLSearchParams();
       searchParams.append("TYPE", type);
       searchParams.append("ACTION", "test");
       searchParams.append("Referrer-Policy", policy);
@@ -132,14 +132,13 @@ var tests = (function() {
       worker.onmessage = function () {
         advance();
       };
       yield worker.postMessage(42);
       yield checkIndividualResults(type, policy, escape(testCases[type]['Referrer-Policy'][policy]));
     }
   }
 
-  // complete.  Be sure to yield so we don't call this twice.
-  yield finish();
+  finish();
 })();
 </script>
 </body>
 </html>
--- a/dom/workers/test/test_multi_sharedWorker.html
+++ b/dom/workers/test/test_multi_sharedWorker.html
@@ -20,17 +20,17 @@
         const frameAbsoluteURL = baseURL + frameRelativeURL;
         const workerAbsoluteURL =
           baseURL + "multi_sharedWorker_sharedWorker.js";
 
         const storedData = "0123456789abcdefghijklmnopqrstuvwxyz";
         const errorMessage = "Error: Expected";
         const errorLineno = 34;
 
-        let testGenerator = (function() {
+        let testGenerator = (function*() {
           SimpleTest.waitForExplicitFinish();
 
           window.addEventListener("message", function(event) {
             if (typeof(event.data) == "string") {
               info(event.data);
             } else {
               sendToGenerator(event);
             }
@@ -223,20 +223,19 @@
           ok(event instanceof MessageEvent, "Got a MessageEvent");
           is(event.source, frame2, "First window got the event");
           is(event.data.type, "result", "Got a result message");
           is(event.data.data, storedData, "Got stored data");
 
           window.removeEventListener("message", sendToGenerator);
 
           SimpleTest.finish();
-          yield undefined;
         })();
 
-        let sendToGenerator = testGenerator.send.bind(testGenerator);
+        let sendToGenerator = testGenerator.next.bind(testGenerator);
 
       </script>
   </head>
   <body onload="testGenerator.next();">
     <iframe id="frame1"></iframe>
     <iframe id="frame2"></iframe>
   </body>
 </html>
--- a/dom/workers/test/test_multi_sharedWorker_lifetimes.html
+++ b/dom/workers/test/test_multi_sharedWorker_lifetimes.html
@@ -14,17 +14,17 @@
         const scrollbarPref = "layout.testing.overlay-scrollbars.always-visible";
         const bfCacheEnabledPref = "browser.sessionhistory.cache_subframes";
         const bfCacheDepthPref = "browser.sessionhistory.max_total_viewers";
         const bfCacheDepth = 10;
 
         const frameRelativeURL = "multi_sharedWorker_frame.html";
         const storedData = "0123456789abcdefghijklmnopqrstuvwxyz";
 
-        let testGenerator = (function() {
+        let testGenerator = (function*() {
           SimpleTest.waitForExplicitFinish();
 
 	  // Force scrollbar to always be shown.  The scrollbar setting is
 	  // necessary to avoid the fade-in/fade-out from evicting our document
 	  // from the BF cache below.  If bug 1049277 is fixed, then we can
 	  // stop setting the scrollbar pref here.
           SpecialPowers.pushPrefEnv({ set: [[scrollbarPref, true]] },
                                     sendToGenerator);
@@ -138,19 +138,18 @@
 
           info("Resetting '" + bfCacheEnabledPref + "' pref");
           SpecialPowers.popPrefEnv(sendToGenerator);
           yield undefined;
 
           window.removeEventListener("message", sendToGenerator);
 
           SimpleTest.finish();
-          yield undefined;
         })();
 
-        let sendToGenerator = testGenerator.send.bind(testGenerator);
+        let sendToGenerator = testGenerator.next.bind(testGenerator);
 
       </script>
   </head>
   <body onload="testGenerator.next();">
     <iframe id="frame"></iframe>
   </body>
 </html>
--- a/dom/xbl/test/test_bug591198.html
+++ b/dom/xbl/test/test_bug591198.html
@@ -13,34 +13,33 @@ https://bugzilla.mozilla.org/show_bug.cg
 <iframe id=iframe></iframe>
 <pre id="test">
 <script class="testbody" type="text/javascript;version=1.8">
 
 SimpleTest.waitForExplicitFinish();
 
 gen = runTest();
 
-function runTest() {
+function* runTest() {
   let iframe = $('iframe');
   window.addEventListener("message", function(e) {
-    gen.send(JSON.parse(e.data));
+    gen.next(JSON.parse(e.data));
   }, false);
   
   iframe.src = "file_bug591198_inner.html";
   let res = (yield);
   is(res.widths[0], res.widths[2], "binding was rendered");
   isnot(res.widths[0], res.widths[1], "binding was rendered");
   is(res.anonChildCount, 2, "correct number of anon children");
 
   iframe.src = "http://noxul.example.com/tests/dom/xbl/test/file_bug591198_inner.html";
   res = (yield);
   is(res.widths[0], res.widths[1], "binding was not rendered");
   isnot(res.widths[0], res.widths[2], "binding was not rendered");
   is("anonChildCount" in res, false, "no anon children");
 
   SimpleTest.finish();
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/xhr/tests/test_XHR.html
+++ b/dom/xhr/tests/test_XHR.html
@@ -13,17 +13,17 @@
 <pre id="test">
 <script class="testbody" type="application/javascript;version=1.7">
 "use strict";
 SimpleTest.waitForExplicitFinish();
 
 var gen = runTests();
 function continueTest() { gen.next(); }
 
-function runTests() {
+function* runTests() {
 
 var path = "/tests/dom/xhr/tests/";
 
 var passFiles = [['file_XHR_pass1.xml', 'GET', 200, 'OK', 'text/xml'],
                  ['file_XHR_pass2.txt', 'GET', 200, 'OK', 'text/plain'],
                  ['file_XHR_pass3.txt', 'GET', 200, 'OK', 'text/plain'],
                  ['data:text/xml,%3Cres%3Ehello%3C/res%3E%0A', 'GET', 200, 'OK', 'text/xml'],
                  ['data:text/plain,hello%20pass%0A', 'GET', 200, 'OK', 'text/plain'],
@@ -379,15 +379,13 @@ client.onreadystatechange = function() {
     } catch(ex) {
       ok(false, "Shouldn't throw! [" + ex + "]");
     }
   }
 }
 client.abort();
 
 SimpleTest.finish();
-yield undefined;
-
 } /* runTests */
 </script>
 </pre>
 </body>
 </html>
--- a/dom/xhr/tests/test_XHRDocURI.html
+++ b/dom/xhr/tests/test_XHRDocURI.html
@@ -96,17 +96,17 @@ function testChromeHTMLDocURI(aDoc, aNon
 }
 
 function testCloneDocURI(aDoc) {
   var clone = aDoc.cloneNode(true);
   is(clone.documentURI, aDoc.documentURI, "wrong url (clone)");
   is(clone.baseURI, aDoc.baseURI, "wrong base (clone)");
 }
 
-function runTest() {
+function* runTest() {
   is(document.baseURI, "http://example.org/", "wrong doc baseURI");
 
   // use content XHR and access URI properties from content privileged script
   xhr = new XMLHttpRequest;
   xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.xml");
   xhr.onreadystatechange = function(e) {
     if (!xhr.responseXML) {
       return;
@@ -499,15 +499,14 @@ function runTest() {
 
   history.back();
   SimpleTest.executeSoon(function() { gen.next(); });
 
   yield undefined;
 
   SimpleTest.finish();
   SpecialPowers.removePermission("systemXHR", document);
-  yield undefined;
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/xhr/tests/test_XHRSendData.html
+++ b/dom/xhr/tests/test_XHRSendData.html
@@ -41,17 +41,17 @@ function createFiles() {
                               ok(false, "File creation error: " + msg);
                               gen.next();
                             });
 };
 
 
 function continueTest() { gen.next(); }
 
-function runTests() {
+function* runTests() {
 xhr = new XMLHttpRequest();
 xhr.open("GET", "file_XHRSendData_doc.xml", false);
 xhr.send();
 testDoc1 = xhr.responseXML;
 is(testDoc1.inputEncoding, "windows-1252", "wrong encoding");
 
 testDoc2 = document.implementation.createDocument("", "", null);
 testDoc2.appendChild(testDoc2.createComment(" doc 2 "));
@@ -253,15 +253,14 @@ function is_identical_arraybuffer(ab1, a
   is(ab1.byteLength, ab2.byteLength, "arraybuffer byteLengths not equal");
   u8v1 = new Uint8Array(ab1);
   u8v2 = new Uint8Array(ab2);
   is(String.fromCharCode.apply(String, u8v1),
      String.fromCharCode.apply(String, u8v2), "arraybuffer values not equal");
 }
 
 SimpleTest.finish();
-yield undefined;
 } /* runTests */
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/xhr/tests/test_xhr_progressevents.html
+++ b/dom/xhr/tests/test_xhr_progressevents.html
@@ -18,17 +18,17 @@ function log(s) {
   /*
   document.getElementById("l").textContent += s + "\n";
   dump(s + "\n");
   */
 }
 
 function getEvent(e) {
   log("got event: " + e.type + " (" + e.target.readyState + ")");
-  gen.send(e);
+  gen.next(e);
 }
 
 function startsWith(a, b) {
   return a.substr(0, b.length) === b;
 }
 
 function updateProgress(e, data, testName) {
   var test = " while running " + testName;
@@ -121,17 +121,17 @@ while(longString.length < 65536)
 function utf8encode(s) {
   return unescape(encodeURIComponent(s));
 }
 
 function bufferToString(buffer) {
   return String.fromCharCode.apply(String, new Uint8Array(buffer));
 }
 
-function runTests() {
+function* runTests() {
   var xhr = new XMLHttpRequest();
   xhr.onprogress = xhr.onload = xhr.onerror = xhr.onreadystatechange = xhr.onloadend = getEvent;
 
   var responseTypes = [{ type: "text", text: true },
                        { type: "arraybuffer", text: false, nodata: true },
                        { type: "blob", text: false, nodata: true, blob: true },
                        { type: "moz-blob", text: false, nodata: false, blob: true },
                        { type: "document", text: true, nodata: true },
@@ -319,15 +319,14 @@ function runTests() {
 
       log("done with this test");
     }
 
     is(testState.name, "", "forgot to close last test");
   }
 
   SimpleTest.finish();
-  yield undefined;
 }
 
 </script>
 
 </body>
 </html>