зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1125057 - Convert for-each-in loops to for-of in IndexedDB test suite; r=bent
This commit is contained in:
Родитель
1769f1b983
Коммит
5ca5673e08
|
@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
|
||||
function testForExpectedSymbols(stage, data) {
|
||||
const expectedSymbols = [ "IDBKeyRange", "indexedDB" ];
|
||||
for each (var symbol in expectedSymbols) {
|
||||
for (var symbol of expectedSymbols) {
|
||||
Services.prefs.setBoolPref("indexeddbtest.bootstrap." + stage + "." +
|
||||
symbol, symbol in this);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
let objectStore = db.createObjectStore(objectStoreName, { });
|
||||
|
||||
for each (let data in objectStoreData) {
|
||||
for (let data of objectStoreData) {
|
||||
objectStore.add(data.blobs, data.key);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
|||
|
||||
is(event.type, "success", "Got correct event type");
|
||||
|
||||
for each (let data in objectStoreData) {
|
||||
for (let data of objectStoreData) {
|
||||
objectStore = db.transaction([objectStoreName])
|
||||
.objectStore(objectStoreName);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
const fileData = { key: 1, file: getRandomFile("random.bin", 100000) };
|
||||
|
||||
let databases = [];
|
||||
for each (let info in databaseInfo) {
|
||||
for (let info of databaseInfo) {
|
||||
let request = indexedDB.open(info.name, 1);
|
||||
request.onerror = errorHandler;
|
||||
request.onupgradeneeded = grabEventAndContinueHandler;
|
||||
|
@ -47,7 +47,7 @@
|
|||
}
|
||||
|
||||
let refResult;
|
||||
for each (let db in databases) {
|
||||
for (let db of databases) {
|
||||
let request = db.transaction([objectStoreName])
|
||||
.objectStore(objectStoreName).get(fileData.key);
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
let db = event.target.result;
|
||||
db.onerror = errorHandler;
|
||||
|
||||
for each (let info in objectStoreInfo) {
|
||||
for (let info of objectStoreInfo) {
|
||||
let objectStore = db.createObjectStore(info.name, info.options);
|
||||
objectStore.add(fileData.file, fileData.key);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@
|
|||
is(event.type, "success", "Got correct event type");
|
||||
|
||||
let refResult;
|
||||
for each (let info in objectStoreInfo) {
|
||||
for (let info of objectStoreInfo) {
|
||||
let objectStore = db.transaction([info.name])
|
||||
.objectStore(info.name);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
const testFile = getRandomFile("random.bin", 100000);
|
||||
|
||||
let databases = [];
|
||||
for each (let info in databaseInfo) {
|
||||
for (let info of databaseInfo) {
|
||||
let request = indexedDB.open(info.name, 1);
|
||||
request.onerror = errorHandler;
|
||||
request.onupgradeneeded = grabEventAndContinueHandler;
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
addon.uninstall();
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
for each (var stage in [ "install", "startup", "shutdown", "uninstall" ]) {
|
||||
for each (var symbol in [ "IDBKeyRange", "indexedDB" ]) {
|
||||
for (var stage of [ "install", "startup", "shutdown", "uninstall" ]) {
|
||||
for (var symbol of [ "IDBKeyRange", "indexedDB" ]) {
|
||||
let pref;
|
||||
try {
|
||||
pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
|
||||
|
|
|
@ -16,11 +16,11 @@ function testSteps()
|
|||
let db = event.target.result;
|
||||
let trans = event.target.transaction;
|
||||
|
||||
for each (let autoincrement in [true, false]) {
|
||||
for each (let keypath in [false, true, "missing", "invalid"]) {
|
||||
for each (let method in ["put", "add"]) {
|
||||
for each (let explicit in [true, false, undefined, "invalid"]) {
|
||||
for each (let existing in [true, false]) {
|
||||
for (let autoincrement of [true, false]) {
|
||||
for (let keypath of [false, true, "missing", "invalid"]) {
|
||||
for (let method of ["put", "add"]) {
|
||||
for (let explicit of [true, false, undefined, "invalid"]) {
|
||||
for (let existing of [true, false]) {
|
||||
let speccedNoKey = (keypath == false || keypath == "missing") &&
|
||||
!explicit;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ function testSteps()
|
|||
objectStore.createIndex(indexData.name, indexData.keyPath,
|
||||
indexData.options);
|
||||
|
||||
for each (let data in objectStoreData) {
|
||||
for (let data of objectStoreData) {
|
||||
objectStore.add(data.value, data.key);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ function testSteps()
|
|||
let db = event.target.result;
|
||||
db.onerror = errorHandler;
|
||||
|
||||
for each (let autoIncrement in [false, true]) {
|
||||
for (let autoIncrement of [false, true]) {
|
||||
let objectStore =
|
||||
db.createObjectStore(autoIncrement, { keyPath: "id",
|
||||
autoIncrement: autoIncrement });
|
||||
|
@ -27,7 +27,7 @@ function testSteps()
|
|||
objectStore.add({ id: i, index: i });
|
||||
}
|
||||
|
||||
for each (let unique in [false, true]) {
|
||||
for (let unique of [false, true]) {
|
||||
objectStore.createIndex(unique, "index", { unique: unique });
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ function testSteps()
|
|||
event = yield undefined;
|
||||
is(event.type, "success", "expect a success event");
|
||||
|
||||
for each (let autoIncrement in [false, true]) {
|
||||
for (let autoIncrement of [false, true]) {
|
||||
let objectStore = db.transaction(autoIncrement)
|
||||
.objectStore(autoIncrement);
|
||||
|
||||
|
@ -51,7 +51,7 @@ function testSteps()
|
|||
let objectStoreCount = event.target.result;
|
||||
let indexCount = event.target.result;
|
||||
|
||||
for each (let unique in [false, true]) {
|
||||
for (let unique of [false, true]) {
|
||||
let index = db.transaction(autoIncrement, "readwrite")
|
||||
.objectStore(autoIncrement)
|
||||
.index(unique);
|
||||
|
|
|
@ -340,7 +340,7 @@ function testSteps()
|
|||
let objectStore = db.createObjectStore(objectStoreName, objectStoreOptions);
|
||||
let index = objectStore.createIndex(indexName, indexName, indexOptions);
|
||||
|
||||
for each (let data in dbData) {
|
||||
for (let data of dbData) {
|
||||
objectStore.add(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ function testSteps()
|
|||
|
||||
const version = 1;
|
||||
|
||||
for each (let name in names) {
|
||||
for (let name of names) {
|
||||
let request = indexedDB.open(name, version);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
|
|
|
@ -37,7 +37,7 @@ function testSteps()
|
|||
let objectStore = db.createObjectStore(osName, { keyPath: "ssn" });
|
||||
objectStore.createIndex(indexName, "weight", { unique: false });
|
||||
|
||||
for each (let i in data) {
|
||||
for (let i of data) {
|
||||
objectStore.add(i);
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ function testSteps()
|
|||
|
||||
event.target.transaction.oncomplete = grabEventAndContinueHandler;
|
||||
|
||||
for each (let i in data) {
|
||||
for (let i of data) {
|
||||
objectStore.add(i);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ function testSteps()
|
|||
|
||||
let db = event.target.result;
|
||||
|
||||
for each (let autoIncrement in [false, true]) {
|
||||
for (let autoIncrement of [false, true]) {
|
||||
let objectStore =
|
||||
db.createObjectStore(autoIncrement, { keyPath: "id",
|
||||
autoIncrement: autoIncrement });
|
||||
|
@ -30,7 +30,7 @@ function testSteps()
|
|||
event = yield undefined;
|
||||
is(event.type, "success", "expect a success event");
|
||||
|
||||
for each (let autoIncrement in [false, true]) {
|
||||
for (let autoIncrement of [false, true]) {
|
||||
objectStore = db.transaction(autoIncrement, "readwrite")
|
||||
.objectStore(autoIncrement);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче