Bug 1239354: Replace old-style generator function with star functions. r?asuth draft
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 13 Jan 2016 08:58:15 -0800
changeset 321472 ea2a68bdaa890f3fcb0fe482bc0afc6f3440e893
parent 321454 92e6520552764d4fdd9e0b77d28ccef7179311be
child 512903 b0086aec580fe59da011c4d07059fa614b1e819c
push id9382
push userdtownsend@mozilla.com
push dateWed, 13 Jan 2016 16:58:20 +0000
reviewersasuth
bugs1239354
milestone46.0a1
Bug 1239354: Replace old-style generator function with star functions. r?asuth
storage/test/unit/test_connection_asyncClose.js
--- a/storage/test/unit/test_connection_asyncClose.js
+++ b/storage/test/unit/test_connection_asyncClose.js
@@ -48,17 +48,17 @@ add_task(function* test_asyncClose_does_
 /**
  * Open an async database (ensures the async thread is created) and then invoke
  * AsyncClose() twice without yielding control flow.  The first will initiate
  * the actual async close after calling setClosedState which synchronously
  * impacts what the second call will observe.  The second call will then see the
  * async thread is not available and fall back to invoking Close() which will
  * notice the mDBConn is already gone.
  */
-add_task(function test_double_asyncClose_throws() {
+add_task(function* test_double_asyncClose_throws() {
   let db = yield openAsyncDatabase(getTestDB());
 
   // (Don't yield control flow yet, save the promise for after we make the
   // second call.)
   // Branch coverage: (asyncThread && mDBConn)
   let realClosePromise = yield asyncClose(db);
   try {
     // Branch coverage: (!asyncThread && !mDBConn)
@@ -110,16 +110,16 @@ add_task(function* test_asyncClose_faile
 });
 
 // THE TEST BELOW WANTS TO BE THE LAST TEST WE RUN.  DO NOT MAKE IT SAD.
 /**
  * Verify that asyncClose without a callback does not explode.  Without a
  * callback the shutdown is not actually observable, so we run this test last
  * in order to avoid weird overlaps.
  */
-add_task(function test_asyncClose_does_not_throw_without_callback() {
+add_task(function* test_asyncClose_does_not_throw_without_callback() {
   let db = yield openAsyncDatabase(getTestDB());
   // Branch coverage: (asyncThread && mDBConn)
   db.asyncClose();
   ok(true, 'if we shutdown cleanly and do not crash, then we succeeded');
 });
 // OBEY SHOUTING UPPER-CASE COMMENTS.
 // ADD TESTS ABOVE THE FORMER TEST, NOT BELOW IT.