Bug 1230549 - Make Storage pass basic eslint. r=yoric
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 04 Dec 2015 15:52:43 +0100
changeset 309778 0914d89dc7b94e42da4a75e7036032e0e4cbb791
parent 309777 b1821f8cf26114fe25d5da0c479377379ab53b7b
child 309779 dc9d0cfb61293c6e70c67a396e5528cdf8f4645d
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoric
bugs1230549
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1230549 - Make Storage pass basic eslint. r=yoric
storage/.eslintrc
storage/test/unit/test_chunk_growth.js
storage/test/unit/test_connection_executeAsync.js
storage/test/unit/test_connection_executeSimpleSQLAsync.js
storage/test/unit/test_storage_connection.js
copy from browser/.eslintrc
copy to storage/.eslintrc
--- a/storage/test/unit/test_chunk_growth.js
+++ b/storage/test/unit/test_chunk_growth.js
@@ -1,39 +1,36 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
 // This file tests SQLITE_FCNTL_CHUNK_SIZE behaves as expected
 
 function run_sql(d, sql) {
   var stmt = d.createStatement(sql)
   stmt.execute()
   stmt.finalize();
 }
 
-function new_file(name)
-{
+function new_file(name) {
   var file = dirSvc.get("ProfD", Ci.nsIFile);
   file.append(name);
   return file;
 }
 
 function get_size(name) {
   return new_file(name).fileSize
 }
 
-function run_test()
-{
+function run_test() {
   const filename = "chunked.sqlite";
   const CHUNK_SIZE = 512 * 1024;
   var d = getDatabase(new_file(filename));
   try {
     d.setGrowthIncrement(CHUNK_SIZE, "");
-  } catch (e if e.result == Cr.NS_ERROR_FILE_TOO_BIG) {
+  } catch (e) {
+    if (e.result != Cr.NS_ERROR_FILE_TOO_BIG) {
+      throw e;
+    }
     print("Too little free space to set CHUNK_SIZE!");
     return;
   }
   run_sql(d, "CREATE TABLE bloat(data varchar)");
 
   var orig_size = get_size(filename);
   /* Dump in at least 32K worth of data.
    * While writing ensure that the file size growth in chunksize set above.
--- a/storage/test/unit/test_connection_executeAsync.js
+++ b/storage/test/unit/test_connection_executeAsync.js
@@ -7,18 +7,17 @@
  * both mozIStorageStatement and mozIStorageAsyncStatement.
  */
 
 const INTEGER = 1;
 const TEXT = "this is test text";
 const REAL = 3.23;
 const BLOB = [1, 2];
 
-function test_create_and_add()
-{
+add_test(function test_create_and_add() {
   getOpenedDatabase().executeSimpleSQL(
     "CREATE TABLE test (" +
       "id INTEGER, " +
       "string TEXT, " +
       "number REAL, " +
       "nuller NULL, " +
       "blober BLOB" +
     ")"
@@ -91,20 +90,19 @@ function test_create_and_add()
       }
 
       // Run the next test.
       run_next_test();
     }
   });
   stmts[0].finalize();
   stmts[1].finalize();
-}
+});
 
-function test_multiple_bindings_on_statements()
-{
+add_test(function test_multiple_bindings_on_statements() {
   // This tests to make sure that we pass all the statements multiply bound
   // parameters when we call executeAsync.
   const AMOUNT_TO_ADD = 5;
   const ITERATIONS = 5;
 
   let stmts = [];
   let db = getOpenedDatabase();
   let sqlString = "INSERT INTO test (id, string, number, nuller, blober) " +
@@ -171,20 +169,19 @@ function test_multiple_bindings_on_state
         countStmt.finalize();
       }
 
       // Run the next test.
       run_next_test();
     }
   });
   stmts.forEach(stmt => stmt.finalize());
-}
+});
 
-function test_asyncClose_does_not_complete_before_statements()
-{
+add_test(function test_asyncClose_does_not_complete_before_statements() {
   let stmt = createStatement("SELECT * FROM sqlite_master");
   let executed = false;
   stmt.executeAsync({
     handleResult: function(aResultSet)
     {
     },
     handleError: function(aError)
     {
@@ -205,56 +202,44 @@ function test_asyncClose_does_not_comple
   getOpenedDatabase().asyncClose(function() {
     // Ensure that the statement executed to completion.
     do_check_true(executed);
 
     // Reset gDBConn so that later tests will get a new connection object.
     gDBConn = null;
     run_next_test();
   });
-}
+});
 
-function test_asyncClose_does_not_throw_no_callback()
-{
+add_test(function test_asyncClose_does_not_throw_no_callback() {
   getOpenedDatabase().asyncClose();
 
   // Reset gDBConn so that later tests will get a new connection object.
   gDBConn = null;
   run_next_test();
-}
+});
 
-function test_double_asyncClose_throws()
-{
+add_test(function test_double_asyncClose_throws() {
   let conn = getOpenedDatabase();
   conn.asyncClose();
   try {
     conn.asyncClose();
     do_throw("should have thrown");
     // There is a small race condition here, which can cause either of
     // Cr.NS_ERROR_NOT_INITIALIZED or Cr.NS_ERROR_UNEXPECTED to be thrown.
-  } catch (e if "result" in e && e.result == Cr.NS_ERROR_NOT_INITIALIZED) {
-    do_print("NS_ERROR_NOT_INITIALIZED");
-  } catch (e if "result" in e && e.result == Cr.NS_ERROR_UNEXPECTED) {
-    do_print("NS_ERROR_UNEXPECTED");
   } catch (e) {
+    if ("result" in e && e.result == Cr.NS_ERROR_NOT_INITIALIZED) {
+      do_print("NS_ERROR_NOT_INITIALIZED");
+    } else if ("result" in e && e.result == Cr.NS_ERROR_UNEXPECTED) {
+      do_print("NS_ERROR_UNEXPECTED");
+    }
   }
 
   // Reset gDBConn so that later tests will get a new connection object.
   gDBConn = null;
   run_next_test();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//// Test Runner
-
-[
-  test_create_and_add,
-  test_multiple_bindings_on_statements,
-  test_asyncClose_does_not_complete_before_statements,
-  test_asyncClose_does_not_throw_no_callback,
-  test_double_asyncClose_throws,
-].forEach(add_test);
+});
 
 function run_test()
 {
   cleanup();
   run_next_test();
 }
--- a/storage/test/unit/test_connection_executeSimpleSQLAsync.js
+++ b/storage/test/unit/test_connection_executeSimpleSQLAsync.js
@@ -50,17 +50,17 @@ function executeSimpleSQLAsync(db, query
     },
     handleCompletion: function(result) {
       deferred.resolve(result);
     }
   });
   return deferred.promise;
 }
 
-add_task(function test_create_and_add() {
+add_task(function* test_create_and_add() {
   let adb = yield openAsyncDatabase(getTestDB());
 
   let completion = yield executeSimpleSQLAsync(adb,
     "CREATE TABLE test (id INTEGER, string TEXT, number REAL)");
 
   do_check_eq(Ci.mozIStorageStatementCallback.REASON_FINISHED, completion);
 
   completion = yield executeSimpleSQLAsync(adb,
@@ -92,17 +92,17 @@ add_task(function test_create_and_add() 
     });
 
   do_check_neq(result, null);
 
   yield asyncClose(adb);
 });
 
 
-add_task(function test_asyncClose_does_not_complete_before_statement() {
+add_task(function* test_asyncClose_does_not_complete_before_statement() {
   let adb = yield openAsyncDatabase(getTestDB());
   let executed = false;
 
   let reason = yield executeSimpleSQLAsync(adb, "SELECT * FROM test",
     function(aResultSet) {
       let result = aResultSet.getNextRow();
 
       do_check_neq(result, null);
@@ -116,16 +116,8 @@ add_task(function test_asyncClose_does_n
 
   do_check_eq(Ci.mozIStorageStatementCallback.REASON_FINISHED, reason);
 
   // Ensure that the statement executed to completion.
   do_check_true(executed);
 
   yield asyncClose(adb);
 });
-
-////////////////////////////////////////////////////////////////////////////////
-//// Test Runner
-
-function run_test()
-{
-  run_next_test();
-}
--- a/storage/test/unit/test_storage_connection.js
+++ b/storage/test/unit/test_storage_connection.js
@@ -64,201 +64,185 @@ function executeAsync(statement, onResul
     },
     handleCompletion: function(result) {
       deferred.resolve(result);
     }
   });
   return deferred.promise;
 }
 
-add_task(function test_connectionReady_open()
-{
+add_task(function* test_connectionReady_open() {
   // there doesn't seem to be a way for the connection to not be ready (unless
   // we close it with mozIStorageConnection::Close(), but we don't for this).
   // It can only fail if GetPath fails on the database file, or if we run out
   // of memory trying to use an in-memory database
 
   var msc = getOpenedDatabase();
   do_check_true(msc.connectionReady);
 });
 
-add_task(function test_connectionReady_closed()
-{
+add_task(function* test_connectionReady_closed() {
   // This also tests mozIStorageConnection::Close()
 
   var msc = getOpenedDatabase();
   msc.close();
   do_check_false(msc.connectionReady);
   gDBConn = null; // this is so later tests don't start to fail.
 });
 
-add_task(function test_databaseFile()
-{
+add_task(function* test_databaseFile() {
   var msc = getOpenedDatabase();
   do_check_true(getTestDB().equals(msc.databaseFile));
 });
 
-add_task(function test_tableExists_not_created()
-{
+add_task(function* test_tableExists_not_created() {
   var msc = getOpenedDatabase();
   do_check_false(msc.tableExists("foo"));
 });
 
-add_task(function test_indexExists_not_created()
-{
+add_task(function* test_indexExists_not_created() {
   var msc = getOpenedDatabase();
   do_check_false(msc.indexExists("foo"));
 });
 
-add_task(function test_temp_tableExists_and_indexExists()
-{
+add_task(function* test_temp_tableExists_and_indexExists() {
   var msc = getOpenedDatabase();
   msc.executeSimpleSQL("CREATE TEMP TABLE test_temp(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)");
   do_check_true(msc.tableExists("test_temp"));
 
   msc.executeSimpleSQL("CREATE INDEX test_temp_ind ON test_temp (name)");
   do_check_true(msc.indexExists("test_temp_ind"));
 
   msc.executeSimpleSQL("DROP INDEX test_temp_ind");
   msc.executeSimpleSQL("DROP TABLE test_temp");
 });
 
-add_task(function test_createTable_not_created()
-{
+add_task(function* test_createTable_not_created() {
   var msc = getOpenedDatabase();
   msc.createTable("test", "id INTEGER PRIMARY KEY, name TEXT");
   do_check_true(msc.tableExists("test"));
 });
 
-add_task(function test_indexExists_created()
-{
+add_task(function* test_indexExists_created() {
   var msc = getOpenedDatabase();
   msc.executeSimpleSQL("CREATE INDEX name_ind ON test (name)");
   do_check_true(msc.indexExists("name_ind"));
 });
 
-add_task(function test_createTable_already_created()
-{
+add_task(function* test_createTable_already_created() {
   var msc = getOpenedDatabase();
   do_check_true(msc.tableExists("test"));
   try {
     msc.createTable("test", "id INTEGER PRIMARY KEY, name TEXT");
     do_throw("We shouldn't get here!");
   } catch (e) {
     do_check_eq(Cr.NS_ERROR_FAILURE, e.result);
   }
 });
 
-add_task(function test_attach_createTable_tableExists_indexExists()
-{
+add_task(function* test_attach_createTable_tableExists_indexExists() {
   var msc = getOpenedDatabase();
   var file = do_get_file("storage_attach.sqlite", true);
   var msc2 = getDatabase(file);
   msc.executeSimpleSQL("ATTACH DATABASE '" + file.path + "' AS sample");
 
   do_check_false(msc.tableExists("sample.test"));
   msc.createTable("sample.test", "id INTEGER PRIMARY KEY, name TEXT");
   do_check_true(msc.tableExists("sample.test"));
   try {
     msc.createTable("sample.test", "id INTEGER PRIMARY KEY, name TEXT");
     do_throw("We shouldn't get here!");
-  } catch (e if e.result == Components.results.NS_ERROR_FAILURE) {
+  } catch (e) {
+    if (e.result != Components.results.NS_ERROR_FAILURE) {
+      throw e;
+    }
     // we expect to fail because this table should exist already.
   }
 
   do_check_false(msc.indexExists("sample.test_ind"));
   msc.executeSimpleSQL("CREATE INDEX sample.test_ind ON test (name)");
   do_check_true(msc.indexExists("sample.test_ind"));
 
   msc.executeSimpleSQL("DETACH DATABASE sample");
   msc2.close();
   try { file.remove(false); } catch(e) { }
 });
 
-add_task(function test_lastInsertRowID()
-{
+add_task(function* test_lastInsertRowID() {
   var msc = getOpenedDatabase();
   msc.executeSimpleSQL("INSERT INTO test (name) VALUES ('foo')");
   do_check_eq(1, msc.lastInsertRowID);
 });
 
-add_task(function test_transactionInProgress_no()
-{
+add_task(function* test_transactionInProgress_no() {
   var msc = getOpenedDatabase();
   do_check_false(msc.transactionInProgress);
 });
 
-add_task(function test_transactionInProgress_yes()
-{
+add_task(function* test_transactionInProgress_yes() {
   var msc = getOpenedDatabase();
   msc.beginTransaction();
   do_check_true(msc.transactionInProgress);
   msc.commitTransaction();
   do_check_false(msc.transactionInProgress);
 
   msc.beginTransaction();
   do_check_true(msc.transactionInProgress);
   msc.rollbackTransaction();
   do_check_false(msc.transactionInProgress);
 });
 
-add_task(function test_commitTransaction_no_transaction()
-{
+add_task(function* test_commitTransaction_no_transaction() {
   var msc = getOpenedDatabase();
   do_check_false(msc.transactionInProgress);
   try {
     msc.commitTransaction();
     do_throw("We should not get here!");
   } catch (e) {
     do_check_eq(Cr.NS_ERROR_UNEXPECTED, e.result);
   }
 });
 
-add_task(function test_rollbackTransaction_no_transaction()
-{
+add_task(function* test_rollbackTransaction_no_transaction() {
   var msc = getOpenedDatabase();
   do_check_false(msc.transactionInProgress);
   try {
     msc.rollbackTransaction();
     do_throw("We should not get here!");
   } catch (e) {
     do_check_eq(Cr.NS_ERROR_UNEXPECTED, e.result);
   }
 });
 
-add_task(function test_get_schemaVersion_not_set()
-{
+add_task(function* test_get_schemaVersion_not_set() {
   do_check_eq(0, getOpenedDatabase().schemaVersion);
 });
 
-add_task(function test_set_schemaVersion()
-{
+add_task(function* test_set_schemaVersion() {
   var msc = getOpenedDatabase();
   const version = 1;
   msc.schemaVersion = version;
   do_check_eq(version, msc.schemaVersion);
 });
 
-add_task(function test_set_schemaVersion_same()
-{
+add_task(function* test_set_schemaVersion_same() {
   var msc = getOpenedDatabase();
   const version = 1;
   msc.schemaVersion = version; // should still work ok
   do_check_eq(version, msc.schemaVersion);
 });
 
-add_task(function test_set_schemaVersion_negative()
-{
+add_task(function* test_set_schemaVersion_negative() {
   var msc = getOpenedDatabase();
   const version = -1;
   msc.schemaVersion = version;
   do_check_eq(version, msc.schemaVersion);
 });
 
-add_task(function test_createTable(){
+add_task(function* test_createTable(){
   var temp = getTestDB().parent;
   temp.append("test_db_table");
   try {
     var con = getService().openDatabase(temp);
     con.createTable("a","");
   } catch (e) {
     if (temp.exists()) try {
       temp.remove(false);
@@ -267,33 +251,31 @@ add_task(function test_createTable(){
                   e.result==Cr.NS_ERROR_FAILURE);
   } finally {
     if (con) {
       con.close();
     }
   }
 });
 
-add_task(function test_defaultSynchronousAtNormal()
-{
+add_task(function* test_defaultSynchronousAtNormal() {
   var msc = getOpenedDatabase();
   var stmt = createStatement("PRAGMA synchronous;");
   try {
     stmt.executeStep();
     do_check_eq(1, stmt.getInt32(0));
   }
   finally {
     stmt.reset();
     stmt.finalize();
   }
 });
 
 // must be ran before executeAsync tests
-add_task(function test_close_does_not_spin_event_loop()
-{
+add_task(function* test_close_does_not_spin_event_loop() {
   // We want to make sure that the event loop on the calling thread does not
   // spin when close is called.
   let event = {
     ran: false,
     run: function()
     {
       this.ran = true;
     },
@@ -310,62 +292,60 @@ add_task(function test_close_does_not_sp
   do_check_false(event.ran);
   getOpenedDatabase().close();
   do_check_false(event.ran);
 
   // Reset gDBConn so that later tests will get a new connection object.
   gDBConn = null;
 });
 
-add_task(function test_asyncClose_succeeds_with_finalized_async_statement()
-{
+add_task(function* test_asyncClose_succeeds_with_finalized_async_statement() {
   // XXX this test isn't perfect since we can't totally control when events will
   //     run.  If this paticular function fails randomly, it means we have a
   //     real bug.
 
   // We want to make sure we create a cached async statement to make sure that
   // when we finalize our statement, we end up finalizing the async one too so
   // close will succeed.
   let stmt = createStatement("SELECT * FROM test");
   stmt.executeAsync();
   stmt.finalize();
 
   yield asyncClose(getOpenedDatabase());
   // Reset gDBConn so that later tests will get a new connection object.
   gDBConn = null;
 });
 
-add_task(function test_close_then_release_statement() {
+add_task(function* test_close_then_release_statement() {
   // Testing the behavior in presence of a bad client that finalizes
   // statements after the database has been closed (typically by
   // letting the gc finalize the statement).
   let db = getOpenedDatabase();
   let stmt = createStatement("SELECT * FROM test -- test_close_then_release_statement");
   db.close();
   stmt.finalize(); // Finalize too late - this should not crash
 
   // Reset gDBConn so that later tests will get a new connection object.
   gDBConn = null;
 });
 
-add_task(function test_asyncClose_then_release_statement() {
+add_task(function* test_asyncClose_then_release_statement() {
   // Testing the behavior in presence of a bad client that finalizes
   // statements after the database has been async closed (typically by
   // letting the gc finalize the statement).
   let db = getOpenedDatabase();
   let stmt = createStatement("SELECT * FROM test -- test_asyncClose_then_release_statement");
   yield asyncClose(db);
   stmt.finalize(); // Finalize too late - this should not crash
 
   // Reset gDBConn so that later tests will get a new connection object.
   gDBConn = null;
 });
 
-add_task(function test_close_fails_with_async_statement_ran()
-{
+add_task(function* test_close_fails_with_async_statement_ran() {
   let deferred = Promise.defer();
   let stmt = createStatement("SELECT * FROM test");
   stmt.executeAsync();
   stmt.finalize();
 
   let db = getOpenedDatabase();
   try {
     db.close();
@@ -380,18 +360,17 @@ add_task(function test_close_fails_with_
       // Reset gDBConn so that later tests will get a new connection object.
       gDBConn = null;
       deferred.resolve();
     });
   }
   yield deferred.promise;
 });
 
-add_task(function test_clone_optional_param()
-{
+add_task(function* test_clone_optional_param() {
   let db1 = getService().openUnsharedDatabase(getTestDB());
   let db2 = db1.clone();
   do_check_true(db2.connectionReady);
 
   // A write statement should not fail here.
   let stmt = db2.createStatement("INSERT INTO test (name) VALUES (:name)");
   stmt.params.name = "dwitte";
   stmt.execute();
@@ -404,17 +383,17 @@ add_task(function test_clone_optional_pa
 
   // Additionally check that it is a connection on the same database.
   do_check_true(db1.databaseFile.equals(db2.databaseFile));
 
   db1.close();
   db2.close();
 });
 
-function standardAsyncTest(promisedDB, name, shouldInit = false) {
+function* standardAsyncTest(promisedDB, name, shouldInit = false) {
   do_print("Performing standard async test " + name);
 
   let adb = yield promisedDB;
   do_check_true(adb instanceof Ci.mozIStorageAsyncConnection);
   do_check_false(adb instanceof Ci.mozIStorageConnection);
 
   if (shouldInit) {
     let stmt = adb.createAsyncStatement("CREATE TABLE test(name TEXT)");
@@ -446,17 +425,17 @@ function standardAsyncTest(promisedDB, n
   });
   do_check_true(found);
   stmt.finalize();
   yield asyncClose(adb);
 
   do_print("Standard async test " + name + " complete");
 }
 
-add_task(function test_open_async() {
+add_task(function* test_open_async() {
   yield standardAsyncTest(openAsyncDatabase(getTestDB(), null), "default");
   yield standardAsyncTest(openAsyncDatabase(getTestDB()), "no optional arg");
   yield standardAsyncTest(openAsyncDatabase(getTestDB(),
     {shared: false, growthIncrement: 54}), "non-default options");
   yield standardAsyncTest(openAsyncDatabase("memory"),
     "in-memory database", true);
   yield standardAsyncTest(openAsyncDatabase("memory",
     {shared: false, growthIncrement: 54}),
@@ -487,17 +466,17 @@ add_task(function test_open_async() {
     if (adb) {
       yield asyncClose(adb);
     }
   }
   do_check_true(raised);
 });
 
 
-add_task(function test_async_open_with_shared_cache() {
+add_task(function* test_async_open_with_shared_cache() {
   do_print("Testing that opening with a shared cache doesn't break stuff");
   let adb = yield openAsyncDatabase(getTestDB(), {shared: true});
 
   let stmt = adb.createAsyncStatement("INSERT INTO test (name) VALUES (:name)");
   stmt.params.name = "clockworker";
   let result = yield executeAsync(stmt);
   do_print("Request complete");
   stmt.finalize();
@@ -515,31 +494,29 @@ add_task(function test_async_open_with_s
       }
     }
   });
   do_check_true(found);
   stmt.finalize();
   yield asyncClose(adb);
 });
 
-add_task(function test_clone_trivial_async()
-{
+add_task(function* test_clone_trivial_async() {
   let db1 = getService().openDatabase(getTestDB());
   do_print("Opened adb1");
   do_check_true(db1 instanceof Ci.mozIStorageAsyncConnection);
   let adb2 = yield asyncClone(db1, true);
   do_check_true(adb2 instanceof Ci.mozIStorageAsyncConnection);
   do_print("Cloned to adb2");
   db1.close();
   do_print("Closed db1");
   yield asyncClose(adb2);
 });
 
-add_task(function test_clone_no_optional_param_async()
-{
+add_task(function* test_clone_no_optional_param_async() {
   "use strict";
   do_print("Testing async cloning");
   let adb1 = yield openAsyncDatabase(getTestDB(), null);
   do_check_true(adb1 instanceof Ci.mozIStorageAsyncConnection);
 
   do_print("Cloning database");
 
   let adb2 = yield asyncClone(adb1);
@@ -575,18 +552,17 @@ add_task(function test_clone_no_optional
   do_print("Closing databases");
   yield asyncClose(adb2);
   do_print("First db closed");
 
   yield asyncClose(adb1);
   do_print("Second db closed");
 });
 
-add_task(function test_clone_readonly()
-{
+add_task(function* test_clone_readonly() {
   let db1 = getService().openUnsharedDatabase(getTestDB());
   let db2 = db1.clone(true);
   do_check_true(db2.connectionReady);
 
   // A write statement should fail here.
   let stmt = db2.createStatement("INSERT INTO test (name) VALUES (:name)");
   stmt.params.name = "reed";
   expectError(Cr.NS_ERROR_FILE_READ_ONLY, () => stmt.execute());
@@ -596,18 +572,17 @@ add_task(function test_clone_readonly()
   stmt = db2.createStatement("SELECT * FROM test");
   do_check_true(stmt.executeStep());
   stmt.finalize();
 
   db1.close();
   db2.close();
 });
 
-add_task(function test_clone_shared_readonly()
-{
+add_task(function* test_clone_shared_readonly() {
   let db1 = getService().openDatabase(getTestDB());
   let db2 = db1.clone(true);
   do_check_true(db2.connectionReady);
 
   let stmt = db2.createStatement("INSERT INTO test (name) VALUES (:name)");
   stmt.params.name = "parker";
   // TODO currently SQLite does not actually work correctly here.  The behavior
   //      we want is commented out, and the current behavior is being tested
@@ -621,38 +596,35 @@ add_task(function test_clone_shared_read
   stmt = db2.createStatement("SELECT * FROM test");
   do_check_true(stmt.executeStep());
   stmt.finalize();
 
   db1.close();
   db2.close();
 });
 
-add_task(function test_close_clone_fails()
-{
+add_task(function* test_close_clone_fails() {
   let calls = [
     "openDatabase",
     "openUnsharedDatabase",
   ];
   calls.forEach(function(methodName) {
     let db = getService()[methodName](getTestDB());
     db.close();
     expectError(Cr.NS_ERROR_NOT_INITIALIZED, () => db.clone());
   });
 });
 
-add_task(function test_memory_clone_fails()
-{
+add_task(function* test_memory_clone_fails() {
   let db = getService().openSpecialDatabase("memory");
   db.close();
   expectError(Cr.NS_ERROR_NOT_INITIALIZED, () => db.clone());
 });
 
-add_task(function test_clone_copies_functions()
-{
+add_task(function* test_clone_copies_functions() {
   const FUNC_NAME = "test_func";
   let calls = [
     "openDatabase",
     "openUnsharedDatabase",
   ];
   let functionMethods = [
     "createFunction",
     "createAggregateFunction",
@@ -675,18 +647,17 @@ add_task(function test_clone_copies_func
         stmt.finalize();
         db1.close();
         db2.close();
       });
     });
   });
 });
 
-add_task(function test_clone_copies_overridden_functions()
-{
+add_task(function* test_clone_copies_overridden_functions() {
   const FUNC_NAME = "lower";
   function test_func() {
     this.called = false;
   }
   test_func.prototype = {
     onFunctionCall: function() {
       this.called = true;
     },
@@ -721,18 +692,17 @@ add_task(function test_clone_copies_over
         stmt.finalize();
         db1.close();
         db2.close();
       });
     });
   });
 });
 
-add_task(function test_clone_copies_pragmas()
-{
+add_task(function* test_clone_copies_pragmas() {
   const PRAGMAS = [
     { name: "cache_size", value: 500, copied: true },
     { name: "temp_store", value: 2, copied: true },
     { name: "foreign_keys", value: 1, copied: true },
     { name: "journal_size_limit", value: 524288, copied: true },
     { name: "synchronous", value: 2, copied: true },
     { name: "wal_autocheckpoint", value: 16, copied: true },
     { name: "busy_timeout", value: 50, copied: true },
@@ -764,18 +734,17 @@ add_task(function test_clone_copies_prag
     validate(pragma.value, stmt.getInt32(0));
     stmt.finalize();
   });
 
   db1.close();
   db2.close();
 });
 
-add_task(function test_readonly_clone_copies_pragmas()
-{
+add_task(function* test_readonly_clone_copies_pragmas() {
   const PRAGMAS = [
     { name: "cache_size", value: 500, copied: true },
     { name: "temp_store", value: 2, copied: true },
     { name: "foreign_keys", value: 1, copied: false },
     { name: "journal_size_limit", value: 524288, copied: false },
     { name: "synchronous", value: 2, copied: false },
     { name: "wal_autocheckpoint", value: 16, copied: false },
     { name: "busy_timeout", value: 50, copied: false },
@@ -807,26 +776,24 @@ add_task(function test_readonly_clone_co
     validate(pragma.value, stmt.getInt32(0));
     stmt.finalize();
   });
 
   db1.close();
   db2.close();
 });
 
-add_task(function test_getInterface()
-{
+add_task(function* test_getInterface() {
   let db = getOpenedDatabase();
   let target = db.QueryInterface(Ci.nsIInterfaceRequestor)
                  .getInterface(Ci.nsIEventTarget);
   // Just check that target is non-null.  Other tests will ensure that it has
   // the correct value.
   do_check_true(target != null);
 
   yield asyncClose(db);
   gDBConn = null;
 });
 
 
-function run_test()
-{
+function run_test() {
   run_next_test();
 }