diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 8662ffd02d1985d6a68d1c49b6030f37b59c3db6..45a944248a9bc5aae8e1296b0627aad9f631f295 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2011-05-02 Mark Pilgrim + + Reviewed by Tony Chang. + + Port Mozilla's IndexedDB tests: adding and removing values + https://bugs.webkit.org/show_bug.cgi?id=59953 + + * storage/indexeddb/mozilla/object-store-remove-values-expected.txt: Added. + * storage/indexeddb/mozilla/object-store-remove-values.html: Added. + 2011-05-02 Alpha Lam Not reviewed. Build fix. diff --git a/LayoutTests/storage/indexeddb/mozilla/object-store-remove-values-expected.txt b/LayoutTests/storage/indexeddb/mozilla/object-store-remove-values-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..f74352df085cdae3dc76df80a5da410375f39c18 --- /dev/null +++ b/LayoutTests/storage/indexeddb/mozilla/object-store-remove-values-expected.txt @@ -0,0 +1,80 @@ +Test IndexedDB: adds, gets, deletes, and re-gets a record in a variety of different object store configurations + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB; +PASS indexedDB == null is false +indexedDB.open(name, description) +db = event.target.result +data = [ + { name: 'inline key; key generator', + autoIncrement: true, + storedObject: {name: 'Lincoln'}, + keyName: 'id', + keyValue: undefined, + }, + { name: 'inline key; no key generator', + autoIncrement: false, + storedObject: {id: 1, name: 'Lincoln'}, + keyName: 'id', + keyValue: undefined, + }, + { name: 'out of line key; key generator', + autoIncrement: true, + storedObject: {name: 'Lincoln'}, + keyName: undefined, + keyValue: undefined, + }, + { name: 'out of line key; no key generator', + autoIncrement: false, + storedObject: {name: 'Lincoln'}, + keyName: undefined, + keyValue: 1, + } + ]; +i = 0; +request = db.setVersion('1') +Deleted all object stores. +objectStore = db.createObjectStore(test.name, { keyPath: test.keyName, autoIncrement: test.autoIncrement }); +request = objectStore.add(test.storedObject); +id = event.target.result; +request = objectStore.get(id); +PASS test.storedObject.name is event.target.result.name +request = objectStore.delete(id); +request = objectStore.get(id); +PASS event.target.result === undefined is true +request = db.setVersion('1') +Deleted all object stores. +objectStore = db.createObjectStore(test.name, { keyPath: test.keyName, autoIncrement: test.autoIncrement }); +request = objectStore.add(test.storedObject); +id = event.target.result; +request = objectStore.get(id); +PASS test.storedObject.name is event.target.result.name +request = objectStore.delete(id); +request = objectStore.get(id); +PASS event.target.result === undefined is true +request = db.setVersion('1') +Deleted all object stores. +objectStore = db.createObjectStore(test.name, { autoIncrement: test.autoIncrement }); +request = objectStore.add(test.storedObject); +id = event.target.result; +request = objectStore.get(id); +PASS test.storedObject.name is event.target.result.name +request = objectStore.delete(id); +request = objectStore.get(id); +PASS event.target.result === undefined is true +request = db.setVersion('1') +Deleted all object stores. +objectStore = db.createObjectStore(test.name, { autoIncrement: test.autoIncrement }); +request = objectStore.add(test.storedObject, test.keyValue); +id = event.target.result; +request = objectStore.get(id); +PASS test.storedObject.name is event.target.result.name +request = objectStore.delete(id); +request = objectStore.get(id); +PASS event.target.result === undefined is true +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/storage/indexeddb/mozilla/object-store-remove-values.html b/LayoutTests/storage/indexeddb/mozilla/object-store-remove-values.html new file mode 100644 index 0000000000000000000000000000000000000000..53385c7a647065e0cb36e3addcd27339b8dacc0d --- /dev/null +++ b/LayoutTests/storage/indexeddb/mozilla/object-store-remove-values.html @@ -0,0 +1,139 @@ + + + + + + + + + + +

+
+ + + +