Bug 645049 - Update tests to no longer use a deprecated API
authorShawn Wilsher <me@shawnwilsher.com>
Thu, 31 Mar 2011 10:19:32 -0700
changeset 64481 046c166f999fee64d9de1546d12da3b0fb9dc7f2
parent 64480 e56cd5eff6b6e60bae42c005460e3130477266e2
child 64482 76fbb32b78af00f1a200957e8e5c4fbf83227efc
push idunknown
push userunknown
push dateunknown
bugs645049
milestone2.2a1pre
Bug 645049 - Update tests to no longer use a deprecated API r=Mossop
storage/test/test_binding_params.cpp
storage/test/test_true_async.cpp
storage/test/unit/test_connection_executeAsync.js
storage/test/unit/test_like.js
storage/test/unit/test_like_escape.js
storage/test/unit/test_statement_executeAsync.js
storage/test/unit/test_storage_aggregates.js
storage/test/unit/test_storage_function.js
storage/test/unit/test_storage_progresshandler.js
storage/test/unit/test_storage_value_array.js
storage/test/unit/test_unicode.js
toolkit/components/downloads/test/unit/test_bug_401582.js
toolkit/components/downloads/test/unit/test_bug_406857.js
toolkit/components/downloads/test/unit/test_history_expiration.js
toolkit/components/places/tests/bookmarks/test_448584.js
toolkit/components/places/tests/head_common.js
toolkit/components/places/tests/mochitest/bug_411966/redirect.js
toolkit/components/places/tests/unit/test_421180.js
toolkit/components/places/tests/unit/test_454977.js
--- a/storage/test/test_binding_params.cpp
+++ b/storage/test/test_binding_params.cpp
@@ -65,17 +65,17 @@ test_ASCIIString()
     "SELECT str FROM test"
   ), getter_AddRefs(select));
 
   // Roundtrip a string through the table, and ensure it comes out as expected.
   nsCAutoString inserted("I'm an ASCII string");
   {
     mozStorageStatementScoper scoper(insert);
     PRBool hasResult;
-    do_check_true(NS_SUCCEEDED(insert->BindUTF8StringParameter(0, inserted)));
+    do_check_true(NS_SUCCEEDED(insert->BindUTF8StringByIndex(0, inserted)));
     do_check_true(NS_SUCCEEDED(insert->ExecuteStep(&hasResult)));
     do_check_false(hasResult);
   }
 
   nsCAutoString result;
   {
     mozStorageStatementScoper scoper(select);
     PRBool hasResult;
@@ -111,17 +111,17 @@ test_CString()
   // Roundtrip a string through the table, and ensure it comes out as expected.
   static const char sCharArray[] =
     "I'm not a \xff\x00\xac\xde\xbb ASCII string!";
   nsCAutoString inserted(sCharArray, NS_ARRAY_LENGTH(sCharArray) - 1);
   do_check_true(inserted.Length() == NS_ARRAY_LENGTH(sCharArray) - 1);
   {
     mozStorageStatementScoper scoper(insert);
     PRBool hasResult;
-    do_check_true(NS_SUCCEEDED(insert->BindUTF8StringParameter(0, inserted)));
+    do_check_true(NS_SUCCEEDED(insert->BindUTF8StringByIndex(0, inserted)));
     do_check_true(NS_SUCCEEDED(insert->ExecuteStep(&hasResult)));
     do_check_false(hasResult);
   }
 
   {
     nsCAutoString result;
 
     mozStorageStatementScoper scoper(select);
@@ -160,17 +160,17 @@ test_UTFStrings()
     "I'm a \xc3\xbb\xc3\xbc\xc3\xa2\xc3\xa4\xc3\xa7 UTF8 string!";
   nsCAutoString insertedUTF8(sCharArray, NS_ARRAY_LENGTH(sCharArray) - 1);
   do_check_true(insertedUTF8.Length() == NS_ARRAY_LENGTH(sCharArray) - 1);
   NS_ConvertUTF8toUTF16 insertedUTF16(insertedUTF8);
   do_check_true(insertedUTF8 == NS_ConvertUTF16toUTF8(insertedUTF16));
   {
     mozStorageStatementScoper scoper(insert);
     PRBool hasResult;
-    do_check_true(NS_SUCCEEDED(insert->BindUTF8StringParameter(0, insertedUTF8)));
+    do_check_true(NS_SUCCEEDED(insert->BindUTF8StringByIndex(0, insertedUTF8)));
     do_check_true(NS_SUCCEEDED(insert->ExecuteStep(&hasResult)));
     do_check_false(hasResult);
   }
 
   {
     nsCAutoString result;
 
     mozStorageStatementScoper scoper(select);
@@ -196,17 +196,17 @@ test_UTFStrings()
   }
 
   (void)db->ExecuteSimpleSQL(NS_LITERAL_CSTRING("DELETE FROM test"));
 
   // Roundtrip the same string using UTF16 input and UTF8 output.
   {
     mozStorageStatementScoper scoper(insert);
     PRBool hasResult;
-    do_check_true(NS_SUCCEEDED(insert->BindStringParameter(0, insertedUTF16)));
+    do_check_true(NS_SUCCEEDED(insert->BindStringByIndex(0, insertedUTF16)));
     do_check_true(NS_SUCCEEDED(insert->ExecuteStep(&hasResult)));
     do_check_false(hasResult);
   }
 
   {
     nsCAutoString result;
 
     mozStorageStatementScoper scoper(select);
--- a/storage/test/test_true_async.cpp
+++ b/storage/test/test_true_async.cpp
@@ -258,17 +258,17 @@ test_TrueAsyncStatement()
   stmt->Finalize();
   do_check_false(mutex_used_on_watched_thread);
 
   // - statement with something to bind ordinally
   db->CreateAsyncStatement(
     NS_LITERAL_CSTRING("INSERT INTO test (id) VALUES (?)"),
     getter_AddRefs(stmt)
   );
-  stmt->BindInt32Parameter(0, 1);
+  stmt->BindInt32ByIndex(0, 1);
   blocking_async_execute(stmt);
   stmt->Finalize();
   do_check_false(mutex_used_on_watched_thread);
   
   // - statement with something to bind by name
   db->CreateAsyncStatement(
     NS_LITERAL_CSTRING("INSERT INTO test (id) VALUES (:id)"),
     getter_AddRefs(stmt)
--- a/storage/test/unit/test_connection_executeAsync.js
+++ b/storage/test/unit/test_connection_executeAsync.js
@@ -56,28 +56,28 @@ function test_create_and_add()
       "blober BLOB" +
     ")"
   );
 
   let stmts = [];
   stmts[0] = getOpenedDatabase().createStatement(
     "INSERT INTO test (id, string, number, nuller, blober) VALUES (?, ?, ?, ?, ?)"
   );
-  stmts[0].bindInt32Parameter(0, INTEGER);
-  stmts[0].bindStringParameter(1, TEXT);
-  stmts[0].bindDoubleParameter(2, REAL);
-  stmts[0].bindNullParameter(3);
-  stmts[0].bindBlobParameter(4, BLOB, BLOB.length);
+  stmts[0].bindByIndex(0, INTEGER);
+  stmts[0].bindByIndex(1, TEXT);
+  stmts[0].bindByIndex(2, REAL);
+  stmts[0].bindByIndex(3, null);
+  stmts[0].bindBlobByIndex(4, BLOB, BLOB.length);
   stmts[1] = getOpenedDatabase().createAsyncStatement(
     "INSERT INTO test (string, number, nuller, blober) VALUES (?, ?, ?, ?)"
   );
-  stmts[1].bindStringParameter(0, TEXT);
-  stmts[1].bindDoubleParameter(1, REAL);
-  stmts[1].bindNullParameter(2);
-  stmts[1].bindBlobParameter(3, BLOB, BLOB.length);
+  stmts[1].bindByIndex(0, TEXT);
+  stmts[1].bindByIndex(1, REAL);
+  stmts[1].bindByIndex(2, null);
+  stmts[1].bindBlobByIndex(3, BLOB, BLOB.length);
 
   getOpenedDatabase().executeAsync(stmts, stmts.length, {
     handleResult: function(aResultSet)
     {
       dump("handleResult("+aResultSet+")\n");
       do_throw("unexpected results obtained!");
     },
     handleError: function(aError)
@@ -89,17 +89,17 @@ function test_create_and_add()
     {
       dump("handleCompletion("+aReason+")\n");
       do_check_eq(Ci.mozIStorageStatementCallback.REASON_FINISHED, aReason);
 
       // Check that the result is in the table
       let stmt = getOpenedDatabase().createStatement(
         "SELECT string, number, nuller, blober FROM test WHERE id = ?"
       );
-      stmt.bindInt32Parameter(0, INTEGER);
+      stmt.bindByIndex(0, INTEGER);
       try {
         do_check_true(stmt.executeStep());
         do_check_eq(TEXT, stmt.getString(0));
         do_check_eq(REAL, stmt.getDouble(1));
         do_check_true(stmt.getIsNull(2));
         let count = { value: 0 };
         let blob = { value: null };
         stmt.getBlob(3, count, blob);
--- a/storage/test/unit/test_like.js
+++ b/storage/test/unit/test_like.js
@@ -100,59 +100,59 @@ function test_count()
   do_check_eq(stmt.getInt32(0), 12);
   stmt.reset();
   stmt.finalize();
 }
 
 function test_like_1()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, 'abc');
+  stmt.bindByIndex(0, 'abc');
   var solutions = ["abc", "ABC"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
 
 function test_like_2()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, 'ABC');
+  stmt.bindByIndex(0, 'ABC');
   var solutions = ["abc", "ABC"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
     
 function test_like_3()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, 'aBc');
+  stmt.bindByIndex(0, 'aBc');
   var solutions = ["abc", "ABC"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
    
 function test_like_4()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, 'abc%');
+  stmt.bindByIndex(0, 'abc%');
   var solutions = ["abc", "abcd", "ABC", "ABC abc xyz"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
@@ -160,45 +160,45 @@ function test_like_4()
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
 
 function test_like_5()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, 'a_c');
+  stmt.bindByIndex(0, 'a_c');
   var solutions = ["abc", "ABC"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
 
 function test_like_6()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, 'ab%d');
+  stmt.bindByIndex(0, 'ab%d');
   var solutions = ["abcd", "abd"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
     
 function test_like_7()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, 'a_c%');
+  stmt.bindByIndex(0, 'a_c%');
   var solutions = ["abc", "abcd", "ABC", "ABC abc xyz"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
@@ -206,17 +206,17 @@ function test_like_7()
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
 
 function test_like_8()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?;");
-  stmt.bindStringParameter(0, '%bcd');
+  stmt.bindByIndex(0, '%bcd');
   var solutions = ["abcd", "bcd"];
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_true(stmt.executeStep());
   do_check_true(solutions.indexOf(stmt.getString(0)) != -1);
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
--- a/storage/test/unit/test_like_escape.js
+++ b/storage/test/unit/test_like_escape.js
@@ -43,42 +43,42 @@ function setup()
   getOpenedDatabase().createTable("t1", "x TEXT");
 
   var stmt = createStatement("INSERT INTO t1 (x) VALUES ('foo/bar_baz%20cheese')");
   stmt.execute();
   stmt.finalize();
 
   stmt = createStatement("INSERT INTO t1 (x) VALUES (?1)");
   // insert LATIN_ae, but search on LATIN_AE
-  stmt.bindStringParameter(0, "foo%20" + LATIN1_ae + "/_bar");
+  stmt.bindByIndex(0, "foo%20" + LATIN1_ae + "/_bar");
   stmt.execute();
   stmt.finalize();
 }
     
 function test_escape_for_like_ascii()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?1 ESCAPE '/'");
   var paramForLike = stmt.escapeStringForLIKE("oo/bar_baz%20chees", '/');
   // verify that we escaped / _ and %
   do_check_eq(paramForLike, "oo//bar/_baz/%20chees");
   // prepend and append with % for "contains"
-  stmt.bindStringParameter(0, "%" + paramForLike + "%"); 
+  stmt.bindByIndex(0, "%" + paramForLike + "%"); 
   stmt.executeStep();
   do_check_eq("foo/bar_baz%20cheese", stmt.getString(0));
   stmt.finalize();
 }
 
 function test_escape_for_like_non_ascii()
 {
   var stmt = createStatement("SELECT x FROM t1 WHERE x LIKE ?1 ESCAPE '/'");
   var paramForLike = stmt.escapeStringForLIKE("oo%20" + LATIN1_AE + "/_ba", '/');
   // verify that we escaped / _ and %
   do_check_eq(paramForLike, "oo/%20" + LATIN1_AE + "///_ba");
   // prepend and append with % for "contains"
-  stmt.bindStringParameter(0, "%" + paramForLike + "%");
+  stmt.bindByIndex(0, "%" + paramForLike + "%");
   stmt.executeStep();
   do_check_eq("foo%20" + LATIN1_ae + "/_bar", stmt.getString(0));
   stmt.finalize();
 }
 
 var tests = [test_escape_for_like_ascii, test_escape_for_like_non_ascii];
 
 function run_test()
--- a/storage/test/unit/test_statement_executeAsync.js
+++ b/storage/test/unit/test_statement_executeAsync.js
@@ -232,38 +232,38 @@ function test_create_table()
 }
 
 function test_add_data()
 {
   var stmt = makeTestStatement(
     "INSERT INTO test (id, string, number, nuller, blober) " +
     "VALUES (?, ?, ?, ?, ?)"
   );
-  stmt.bindBlobParameter(4, BLOB, BLOB.length);
-  stmt.bindNullParameter(3);
-  stmt.bindDoubleParameter(2, REAL);
-  stmt.bindStringParameter(1, TEXT);
-  stmt.bindInt32Parameter(0, INTEGER);
+  stmt.bindBlobByIndex(4, BLOB, BLOB.length);
+  stmt.bindByIndex(3, null);
+  stmt.bindByIndex(2, REAL);
+  stmt.bindByIndex(1, TEXT);
+  stmt.bindByIndex(0, INTEGER);
 
   execAsync(stmt);
   stmt.finalize();
 
   // Check that the result is in the table
   verifyQuery("SELECT string, number, nuller, blober FROM test WHERE id = ?",
               INTEGER,
               [TEXT, REAL, null, BLOB]);
   run_next_test();
 }
 
 function test_get_data()
 {
   var stmt = makeTestStatement(
     "SELECT string, number, nuller, blober, id FROM test WHERE id = ?"
   );
-  stmt.bindInt32Parameter(0, INTEGER);
+  stmt.bindByIndex(0, INTEGER);
   execAsync(stmt, {}, [
     function(tuple)
     {
       do_check_neq(null, tuple);
 
       // Check that it's what we expect
       do_check_false(tuple.getIsNull(0));
       do_check_eq(tuple.getResultByName("string"), tuple.getResultByIndex(0));
@@ -355,30 +355,30 @@ function test_tuple_out_of_bounds()
   run_next_test();
 }
 
 function test_no_listener_works_on_success()
 {
   var stmt = makeTestStatement(
     "DELETE FROM test WHERE id = ?"
   );
-  stmt.bindInt32Parameter(0, 0);
+  stmt.bindByIndex(0, 0);
   stmt.executeAsync();
   stmt.finalize();
 
   // Run the next test.
   run_next_test();
 }
 
 function test_no_listener_works_on_results()
 {
   var stmt = makeTestStatement(
     "SELECT ?"
   );
-  stmt.bindInt32Parameter(0, 1);
+  stmt.bindByIndex(0, 1);
   stmt.executeAsync();
   stmt.finalize();
 
   // Run the next test.
   run_next_test();
 }
 
 function test_no_listener_works_on_error()
@@ -394,17 +394,17 @@ function test_no_listener_works_on_error
   run_next_test();
 }
 
 function test_partial_listener_works()
 {
   var stmt = makeTestStatement(
     "DELETE FROM test WHERE id = ?"
   );
-  stmt.bindInt32Parameter(0, 0);
+  stmt.bindByIndex(0, 0);
   stmt.executeAsync({
     handleResult: function(aResultSet)
     {
     }
   });
   stmt.executeAsync({
     handleError: function(aError)
     {
@@ -427,31 +427,31 @@ function test_partial_listener_works()
  * up.  test_AsyncCancellation in test_true_async.cpp is our test that canceling
  * actually works correctly.
  */
 function test_immediate_cancellation()
 {
   var stmt = makeTestStatement(
     "DELETE FROM test WHERE id = ?"
   );
-  stmt.bindInt32Parameter(0, 0);
+  stmt.bindByIndex(0, 0);
   execAsync(stmt, {cancel: true});
   stmt.finalize();
   run_next_test();
 }
 
 /**
  * Test that calling cancel twice throws the second time.
  */
 function test_double_cancellation()
 {
   var stmt = makeTestStatement(
     "DELETE FROM test WHERE id = ?"
   );
-  stmt.bindInt32Parameter(0, 0);
+  stmt.bindByIndex(0, 0);
   let pendingStatement = execAsync(stmt, {cancel: true});
   // And cancel again - expect an exception
   expectError(Cr.NS_ERROR_UNEXPECTED,
               function() pendingStatement.cancel());
 
   stmt.finalize();
   run_next_test();
 }
@@ -460,17 +460,17 @@ function test_double_cancellation()
  * Verify that nothing untoward happens if we try and cancel something after it
  * has fully run to completion.
  */
 function test_cancellation_after_execution()
 {
   var stmt = makeTestStatement(
     "DELETE FROM test WHERE id = ?"
   );
-  stmt.bindInt32Parameter(0, 0);
+  stmt.bindByIndex(0, 0);
   let pendingStatement = execAsync(stmt, {returnPending: true});
   // (the statement has fully executed at this point)
   // canceling after the statement has run to completion should not throw!
   pendingStatement.cancel();
 
   stmt.finalize();
   run_next_test();
 }
--- a/storage/test/unit/test_storage_aggregates.js
+++ b/storage/test/unit/test_storage_aggregates.js
@@ -39,17 +39,17 @@
 var testNums = [1, 2, 3, 4];
 
 function setup()
 {
   getOpenedDatabase().createTable("function_tests", "id INTEGER PRIMARY KEY");
 
   var stmt = createStatement("INSERT INTO function_tests (id) VALUES(?1)");
   for(var i = 0; i < testNums.length; ++i) {
-    stmt.bindInt32Parameter(0, testNums[i]);
+    stmt.bindByIndex(0, testNums[i]);
     stmt.execute();
   }
   stmt.reset();
   stmt.finalize();
 }
 
 var testSquareAndSumFunction = {
   calls: 0,
--- a/storage/test/unit/test_storage_function.js
+++ b/storage/test/unit/test_storage_function.js
@@ -39,17 +39,17 @@
 var testNums = [1, 2, 3, 4];
 
 function setup()
 {
   getOpenedDatabase().createTable("function_tests", "id INTEGER PRIMARY KEY");
 
   var stmt = createStatement("INSERT INTO function_tests (id) VALUES(?1)");
   for(var i = 0; i < testNums.length; ++i) {
-    stmt.bindInt32Parameter(0, testNums[i]);
+    stmt.bindByIndex(0, testNums[i]);
     stmt.execute();
   }
   stmt.reset();
   stmt.finalize();
 }
 
 var testSquareFunction = {
   calls: 0,
--- a/storage/test/unit/test_storage_progresshandler.js
+++ b/storage/test/unit/test_storage_progresshandler.js
@@ -39,18 +39,18 @@
 function setup()
 {
   var msc = getOpenedDatabase();
   msc.createTable("handler_tests", "id INTEGER PRIMARY KEY, num INTEGER");
   msc.beginTransaction();
 
   var stmt = createStatement("INSERT INTO handler_tests (id, num) VALUES(?1, ?2)");
   for(var i = 0; i < 100; ++i) {
-    stmt.bindInt32Parameter(0, i);
-    stmt.bindInt32Parameter(1, Math.floor(Math.random()*1000));
+    stmt.bindByIndex(0, i);
+    stmt.bindByIndex(1, Math.floor(Math.random()*1000));
     stmt.execute();
   }
   stmt.reset();
   msc.commitTransaction();
   stmt.finalize();
 }
 
 var testProgressHandler = {
--- a/storage/test/unit/test_storage_value_array.js
+++ b/storage/test/unit/test_storage_value_array.js
@@ -39,185 +39,185 @@
 
 function setup()
 {
   getOpenedDatabase().createTable("test", "id INTEGER PRIMARY KEY, name TEXT," +
                                           "number REAL, nuller NULL, blobber BLOB");
   
   var stmt = createStatement("INSERT INTO test (name, number, blobber) " +
                              "VALUES (?1, ?2, ?3)");
-  stmt.bindUTF8StringParameter(0, "foo");
-  stmt.bindDoubleParameter(1, 2.34);
-  stmt.bindBlobParameter(2, [], 0);
+  stmt.bindByIndex(0, "foo");
+  stmt.bindByIndex(1, 2.34);
+  stmt.bindBlobByIndex(2, [], 0);
   stmt.execute();
   
-  stmt.bindStringParameter(0, "");
-  stmt.bindDoubleParameter(1, 1.23);
-  stmt.bindBlobParameter(2, [1, 2], 2);
+  stmt.bindByIndex(0, "");
+  stmt.bindByIndex(1, 1.23);
+  stmt.bindBlobByIndex(2, [1, 2], 2);
   stmt.execute();
 
   stmt.reset();
   stmt.finalize();
 }
 
 function test_getIsNull_for_null()
 {
   var stmt = createStatement("SELECT nuller, blobber FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 1);
+  stmt.bindByIndex(0, 1);
   do_check_true(stmt.executeStep());
   
   do_check_true(stmt.getIsNull(0)); // null field
   do_check_true(stmt.getIsNull(1)); // data is null if size is 0
   stmt.reset();
   stmt.finalize();
 }
 
 function test_getIsNull_for_non_null()
 {
   var stmt = createStatement("SELECT name, blobber FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   do_check_false(stmt.getIsNull(0));
   do_check_false(stmt.getIsNull(1));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_value_type_null()
 {
   var stmt = createStatement("SELECT nuller FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 1);
+  stmt.bindByIndex(0, 1);
   do_check_true(stmt.executeStep());
 
   do_check_eq(Ci.mozIStorageValueArray.VALUE_TYPE_NULL,
               stmt.getTypeOfIndex(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_value_type_integer()
 {
   var stmt = createStatement("SELECT id FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 1);
+  stmt.bindByIndex(0, 1);
   do_check_true(stmt.executeStep());
 
   do_check_eq(Ci.mozIStorageValueArray.VALUE_TYPE_INTEGER,
               stmt.getTypeOfIndex(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_value_type_float()
 {
   var stmt = createStatement("SELECT number FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 1);
+  stmt.bindByIndex(0, 1);
   do_check_true(stmt.executeStep());
 
   do_check_eq(Ci.mozIStorageValueArray.VALUE_TYPE_FLOAT,
               stmt.getTypeOfIndex(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_value_type_text()
 {
   var stmt = createStatement("SELECT name FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 1);
+  stmt.bindByIndex(0, 1);
   do_check_true(stmt.executeStep());
 
   do_check_eq(Ci.mozIStorageValueArray.VALUE_TYPE_TEXT,
               stmt.getTypeOfIndex(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_value_type_blob()
 {
   var stmt = createStatement("SELECT blobber FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   do_check_eq(Ci.mozIStorageValueArray.VALUE_TYPE_BLOB,
               stmt.getTypeOfIndex(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_numEntries_one()
 {
   var stmt = createStatement("SELECT blobber FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   do_check_eq(1, stmt.numEntries);
   stmt.reset();
   stmt.finalize();
 }
 
 function test_numEntries_all()
 {
   var stmt = createStatement("SELECT * FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   do_check_eq(5, stmt.numEntries);
   stmt.reset();
   stmt.finalize();
 }
 
 function test_getInt()
 {
   var stmt = createStatement("SELECT id FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   do_check_eq(2, stmt.getInt32(0));
   do_check_eq(2, stmt.getInt64(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_getDouble()
 {
   var stmt = createStatement("SELECT number FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   do_check_eq(1.23, stmt.getDouble(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_getUTF8String()
 {
   var stmt = createStatement("SELECT name FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 1);
+  stmt.bindByIndex(0, 1);
   do_check_true(stmt.executeStep());
 
   do_check_eq("foo", stmt.getUTF8String(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_getString()
 {
   var stmt = createStatement("SELECT name FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   do_check_eq("", stmt.getString(0));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_getBlob()
 {
   var stmt = createStatement("SELECT blobber FROM test WHERE id = ?1");
-  stmt.bindInt32Parameter(0, 2);
+  stmt.bindByIndex(0, 2);
   do_check_true(stmt.executeStep());
 
   var count = { value: 0 };
   var arr = { value: null };
   stmt.getBlob(0, count, arr);
   do_check_eq(2, count.value);
   do_check_eq(1, arr.value[0]);
   do_check_eq(2, arr.value[1]);
--- a/storage/test/unit/test_unicode.js
+++ b/storage/test/unit/test_unicode.js
@@ -40,27 +40,27 @@
 const LATIN1_AE = "\xc6"; // "Æ"
 const LATIN1_ae = "\xe6";  // "æ"
 
 function setup()
 {
   getOpenedDatabase().createTable("test", "id INTEGER PRIMARY KEY, name TEXT");
 
   var stmt = createStatement("INSERT INTO test (name, id) VALUES (?1, ?2)");
-  stmt.bindStringParameter(0, LATIN1_AE);
-  stmt.bindInt32Parameter(1, 1);
+  stmt.bindByIndex(0, LATIN1_AE);
+  stmt.bindByIndex(1, 1);
   stmt.execute();
-  stmt.bindStringParameter(0, "A");
-  stmt.bindInt32Parameter(1, 2);
+  stmt.bindByIndex(0, "A");
+  stmt.bindByIndex(1, 2);
   stmt.execute();
-  stmt.bindStringParameter(0, "b");
-  stmt.bindInt32Parameter(1, 3);
+  stmt.bindByIndex(0, "b");
+  stmt.bindByIndex(1, 3);
   stmt.execute();
-  stmt.bindStringParameter(0, LATIN1_ae);
-  stmt.bindInt32Parameter(1, 4);
+  stmt.bindByIndex(0, LATIN1_ae);
+  stmt.bindByIndex(1, 4);
   stmt.execute();
   stmt.finalize();
 }
 
 function test_upper_ascii()
 {
   var stmt = createStatement("SELECT name, id FROM test WHERE name = upper('a')");
   do_check_true(stmt.executeStep());
@@ -68,17 +68,17 @@ function test_upper_ascii()
   do_check_eq(2, stmt.getInt32(1));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_upper_non_ascii()
 {
   var stmt = createStatement("SELECT name, id FROM test WHERE name = upper(?1)");
-  stmt.bindStringParameter(0, LATIN1_ae);
+  stmt.bindByIndex(0, LATIN1_ae);
   do_check_true(stmt.executeStep());
   do_check_eq(LATIN1_AE, stmt.getString(0));
   do_check_eq(1, stmt.getInt32(1));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_lower_ascii()
@@ -89,37 +89,37 @@ function test_lower_ascii()
   do_check_eq(3, stmt.getInt32(1));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_lower_non_ascii()
 {
   var stmt = createStatement("SELECT name, id FROM test WHERE name = lower(?1)");
-  stmt.bindStringParameter(0, LATIN1_AE);
+  stmt.bindByIndex(0, LATIN1_AE);
   do_check_true(stmt.executeStep());
   do_check_eq(LATIN1_ae, stmt.getString(0));
   do_check_eq(4, stmt.getInt32(1));
   stmt.reset();
   stmt.finalize();
 }
 
 function test_like_search_different()
 {
   var stmt = createStatement("SELECT COUNT(*) FROM test WHERE name LIKE ?1");
-  stmt.bindStringParameter(0, LATIN1_AE);
+  stmt.bindByIndex(0, LATIN1_AE);
   do_check_true(stmt.executeStep());
   do_check_eq(2, stmt.getInt32(0));
   stmt.finalize();
 }
 
 function test_like_search_same()
 {
   var stmt = createStatement("SELECT COUNT(*) FROM test WHERE name LIKE ?1");
-  stmt.bindStringParameter(0, LATIN1_ae);
+  stmt.bindByIndex(0, LATIN1_ae);
   do_check_true(stmt.executeStep());
   do_check_eq(2, stmt.getInt32(0));
   stmt.finalize();
 }
 
 var tests = [test_upper_ascii, test_upper_non_ascii, test_lower_ascii,
              test_lower_non_ascii, test_like_search_different,
              test_like_search_same];
--- a/toolkit/components/downloads/test/unit/test_bug_401582.js
+++ b/toolkit/components/downloads/test/unit/test_bug_401582.js
@@ -44,17 +44,17 @@ const nsIDownloadManager = Ci.nsIDownloa
 const dm = Cc["@mozilla.org/download-manager;1"].getService(nsIDownloadManager);
 
 function test_noScanningDownloads()
 {
   var stmt = dm.DBConnection.createStatement(
     "SELECT * " +
     "FROM moz_downloads " +
     "WHERE state = ?1");
-  stmt.bindInt32Parameter(0, nsIDownloadManager.DOWNLOAD_SCANNING);
+  stmt.bindByIndex(0, nsIDownloadManager.DOWNLOAD_SCANNING);
 
   do_check_false(stmt.executeStep());
   stmt.reset();
   stmt.finalize();
 }
 
 var tests = [test_noScanningDownloads];
 
--- a/toolkit/components/downloads/test/unit/test_bug_406857.js
+++ b/toolkit/components/downloads/test/unit/test_bug_406857.js
@@ -49,32 +49,32 @@ function run_test()
   var httpserv = new nsHttpServer();
   httpserv.start(HTTP_SERVER_PORT);
 
   let stmt = db.createStatement(
     "INSERT INTO moz_downloads (source, target, state, referrer) " +
     "VALUES (?1, ?2, ?3, ?4)");
 
   // Download from the test http server
-  stmt.bindStringParameter(0, "http://localhost:"+HTTP_SERVER_PORT+"/httpd.js");
+  stmt.bindByIndex(0, "http://localhost:"+HTTP_SERVER_PORT+"/httpd.js");
 
   // Download to a temp local file
   let file = Cc["@mozilla.org/file/directory_service;1"].
              getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
   file.append("retry");
   file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
-  stmt.bindStringParameter(1, Cc["@mozilla.org/network/io-service;1"].
+  stmt.bindByIndex(1, Cc["@mozilla.org/network/io-service;1"].
     getService(Ci.nsIIOService).newFileURI(file).spec);
 
   // Start it as canceled
-  stmt.bindInt32Parameter(2, dm.DOWNLOAD_CANCELED);
+  stmt.bindByIndex(2, dm.DOWNLOAD_CANCELED);
 
   // Add a referrer to make sure it doesn't disappear
   let referrer = "http://referrer.goes/here";
-  stmt.bindStringParameter(3, referrer);
+  stmt.bindByIndex(3, referrer);
 
   // Add it!
   stmt.execute();
   stmt.finalize();
 
   let listener = {
     onDownloadStateChange: function(aState, aDownload)
     {
--- a/toolkit/components/downloads/test/unit/test_history_expiration.js
+++ b/toolkit/components/downloads/test/unit/test_history_expiration.js
@@ -62,28 +62,28 @@ function run_test()
 
   let iosvc = Cc["@mozilla.org/network/io-service;1"].
               getService(Ci.nsIIOService);
   let theId = 1337;
   let theURI = iosvc.newURI("http://expireme/please", null, null);
 
   try {
     // Add a download from the URI
-    stmt.bindInt32Parameter(0, theId);
-    stmt.bindStringParameter(1, theURI.spec);
+    stmt.bindByIndex(0, theId);
+    stmt.bindByIndex(1, theURI.spec);
 
     // Give a dummy file name
     let file = Cc["@mozilla.org/file/directory_service;1"].
                getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
     file.append("expireTest");
-    stmt.bindStringParameter(2, Cc["@mozilla.org/network/io-service;1"].
+    stmt.bindByIndex(2, Cc["@mozilla.org/network/io-service;1"].
       getService(Ci.nsIIOService).newFileURI(file).spec);
 
     // Give it some state
-    stmt.bindInt32Parameter(3, dm.DOWNLOAD_FINISHED);
+    stmt.bindByIndex(3, dm.DOWNLOAD_FINISHED);
 
     // Add it!
     stmt.execute();
   }
   finally {
     stmt.reset();
     stmt.finalize();
   }
--- a/toolkit/components/places/tests/bookmarks/test_448584.js
+++ b/toolkit/components/places/tests/bookmarks/test_448584.js
@@ -114,17 +114,17 @@ function run_test() {
   tests.forEach(function(aTest) {
     aTest.populate();
     // sanity
     aTest.validate(2);
     // Something in the code went wrong and we finish up losing the place, so
     // the bookmark uri becomes null.
     var sql = "UPDATE moz_bookmarks SET fk = 1337 WHERE id = ?1";
     var stmt = mDBConn.createStatement(sql);
-    stmt.bindUTF8StringParameter(0, aTest._itemId);
+    stmt.bindByIndex(0, aTest._itemId);
     try {
       stmt.execute();
     } finally {
       stmt.finalize();
     }
   });
 
   // export json to file
--- a/toolkit/components/places/tests/head_common.js
+++ b/toolkit/components/places/tests/head_common.js
@@ -504,17 +504,17 @@ function waitForFrecency(aURI, aValidato
  * @return the frecency value.
  */
 function frecencyForUrl(aURI)
 {
   let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
   let stmt = DBConn().createStatement(
     "SELECT frecency FROM moz_places WHERE url = ?1"
   );
-  stmt.bindUTF8StringParameter(0, url);
+  stmt.bindByIndex(0, url);
   if (!stmt.executeStep())
     throw new Error("No result for frecency.");
   let frecency = stmt.getInt32(0);
   stmt.finalize();
 
   return frecency;
 }
 
@@ -526,17 +526,17 @@ function frecencyForUrl(aURI)
  * @return @return true if the url is hidden, false otherwise.
  */
 function isUrlHidden(aURI)
 {
   let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
   let stmt = DBConn().createStatement(
     "SELECT hidden FROM moz_places WHERE url = ?1"
   );
-  stmt.bindUTF8StringParameter(0, url);
+  stmt.bindByIndex(0, url);
   if (!stmt.executeStep())
     throw new Error("No result for hidden.");
   let hidden = stmt.getInt32(0);
   stmt.finalize();
 
   return !!hidden;
 }
 
--- a/toolkit/components/places/tests/mochitest/bug_411966/redirect.js
+++ b/toolkit/components/places/tests/mochitest/bug_411966/redirect.js
@@ -160,17 +160,17 @@ function checkDB(data){
   // Get all pages visited from the original typed one
   var sql = "SELECT url FROM moz_historyvisits " +
             "JOIN moz_places h ON h.id = place_id " +
             "WHERE from_visit IN " +
               "(SELECT v.id FROM moz_historyvisits v " +
               "JOIN moz_places p ON p.id = v.place_id " +
               "WHERE p.url = ?1)";
   var stmt = mDBConn.createStatement(sql);
-  stmt.bindUTF8StringParameter(0, typedURI.spec);
+  stmt.bindByIndex(0, typedURI.spec);
 
   var empty = true;
   while (stmt.executeStep()) {
     empty = false;
     var visitedURI = stmt.getUTF8String(0);
     // Check that redirect from_visit is not from the original typed one
     ok(visitedURI == clickedLinkURI.spec, "Got wrong referrer for " + visitedURI);
   }
--- a/toolkit/components/places/tests/unit/test_421180.js
+++ b/toolkit/components/places/tests/unit/test_421180.js
@@ -72,17 +72,17 @@ function run_test() {
                                         "A bookmark");
   bmsvc.setKeywordForBookmark(bookmarkId, keyword);
   // remove bookmark
   bmsvc.removeItem(bookmarkId);
 
   // check that keyword has been removed
   var sql = "SELECT id FROM moz_keywords WHERE keyword = ?1";
   var stmt = mDBConn.createStatement(sql);
-  stmt.bindUTF8StringParameter(0, keyword);
+  stmt.bindByIndex(0, keyword);
   do_check_false(stmt.executeStep());
   stmt.finalize();
 
   // TEST 2
   // 1. add 2 bookmarks
   // 2. add the same keyword to them
   // 3. remove first bookmark
   // 4. check that keyword is still there
@@ -99,12 +99,12 @@ function run_test() {
   bmsvc.setKeywordForBookmark(bookmarkId2, keyword);
 
   // remove first bookmark
   bmsvc.removeItem(bookmarkId1);
 
   // check that keyword is still there
   var sql = "SELECT id FROM moz_keywords WHERE keyword = ?1";
   var stmt = mDBConn.createStatement(sql);
-  stmt.bindUTF8StringParameter(0, keyword);
+  stmt.bindByIndex(0, keyword);
   do_check_true(stmt.executeStep());
   stmt.finalize();
 }
--- a/toolkit/components/places/tests/unit/test_454977.js
+++ b/toolkit/components/places/tests/unit/test_454977.js
@@ -52,17 +52,17 @@ function add_visit(aURI, aVisitDate, aVi
       aVisitType != TRANSITION_DOWNLOAD) {
     visit_count ++;
   }
 
   // Get the place id
   if (visitId > 0) {
     let sql = "SELECT place_id FROM moz_historyvisits WHERE id = ?1";
     let stmt = DBConn().createStatement(sql);
-    stmt.bindInt64Parameter(0, visitId);
+    stmt.bindByIndex(0, visitId);
     do_check_true(stmt.executeStep());
     let placeId = stmt.getInt64(0);
     stmt.finalize();
     do_check_true(placeId > 0);
     return placeId;
   }
   return 0;
 }