From dd8bb3de4f353a81954234999f1fea748aee2ea9 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Wed, 11 Aug 2010 14:44:44 +0100 Subject: Merge WebKit at r65072 : Initial merge by git. Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585 --- .../storage/domstorage/complex-values-expected.txt | 36 ++++---- .../storage/indexeddb/open-cursor-expected.txt | 102 +++++++++++++++++++++ LayoutTests/storage/indexeddb/open-cursor.html | 13 +++ .../storage/indexeddb/script-tests/open-cursor.js | 79 ++++++++++++++++ 4 files changed, 212 insertions(+), 18 deletions(-) create mode 100644 LayoutTests/storage/indexeddb/open-cursor-expected.txt create mode 100644 LayoutTests/storage/indexeddb/open-cursor.html create mode 100644 LayoutTests/storage/indexeddb/script-tests/open-cursor.js (limited to 'LayoutTests/storage') diff --git a/LayoutTests/storage/domstorage/complex-values-expected.txt b/LayoutTests/storage/domstorage/complex-values-expected.txt index 9a75e42..e1665e6 100644 --- a/LayoutTests/storage/domstorage/complex-values-expected.txt +++ b/LayoutTests/storage/domstorage/complex-values-expected.txt @@ -82,25 +82,25 @@ PASS storage.getItem('foo9') is "2" storage.foo10 = k PASS typeof storage['foo10'] is "string" -PASS storage['foo10'] is "ÿ찡�hello" +PASS storage['foo10'] is "ÿ찡\0hello" PASS typeof storage.foo10 is "string" -PASS storage.foo10 is "ÿ찡�hello" +PASS storage.foo10 is "ÿ찡\0hello" PASS typeof storage.getItem('foo10') is "string" -PASS storage.getItem('foo10') is "ÿ찡�hello" +PASS storage.getItem('foo10') is "ÿ찡\0hello" storage['foo11'] = k PASS typeof storage['foo11'] is "string" -PASS storage['foo11'] is "ÿ찡�hello" +PASS storage['foo11'] is "ÿ찡\0hello" PASS typeof storage.foo11 is "string" -PASS storage.foo11 is "ÿ찡�hello" +PASS storage.foo11 is "ÿ찡\0hello" PASS typeof storage.getItem('foo11') is "string" -PASS storage.getItem('foo11') is "ÿ찡�hello" +PASS storage.getItem('foo11') is "ÿ찡\0hello" storage.setItem('foo12', k) PASS typeof storage['foo12'] is "string" -PASS storage['foo12'] is "ÿ찡�hello" +PASS storage['foo12'] is "ÿ찡\0hello" PASS typeof storage.foo12 is "string" -PASS storage.foo12 is "ÿ찡�hello" +PASS storage.foo12 is "ÿ찡\0hello" PASS typeof storage.getItem('foo12') is "string" -PASS storage.getItem('foo12') is "ÿ찡�hello" +PASS storage.getItem('foo12') is "ÿ찡\0hello" Testing localStorage @@ -182,25 +182,25 @@ PASS storage.getItem('foo9') is "2" storage.foo10 = k PASS typeof storage['foo10'] is "string" -PASS storage['foo10'] is "ÿ찡�hello" +PASS storage['foo10'] is "ÿ찡\0hello" PASS typeof storage.foo10 is "string" -PASS storage.foo10 is "ÿ찡�hello" +PASS storage.foo10 is "ÿ찡\0hello" PASS typeof storage.getItem('foo10') is "string" -PASS storage.getItem('foo10') is "ÿ찡�hello" +PASS storage.getItem('foo10') is "ÿ찡\0hello" storage['foo11'] = k PASS typeof storage['foo11'] is "string" -PASS storage['foo11'] is "ÿ찡�hello" +PASS storage['foo11'] is "ÿ찡\0hello" PASS typeof storage.foo11 is "string" -PASS storage.foo11 is "ÿ찡�hello" +PASS storage.foo11 is "ÿ찡\0hello" PASS typeof storage.getItem('foo11') is "string" -PASS storage.getItem('foo11') is "ÿ찡�hello" +PASS storage.getItem('foo11') is "ÿ찡\0hello" storage.setItem('foo12', k) PASS typeof storage['foo12'] is "string" -PASS storage['foo12'] is "ÿ찡�hello" +PASS storage['foo12'] is "ÿ찡\0hello" PASS typeof storage.foo12 is "string" -PASS storage.foo12 is "ÿ찡�hello" +PASS storage.foo12 is "ÿ찡\0hello" PASS typeof storage.getItem('foo12') is "string" -PASS storage.getItem('foo12') is "ÿ찡�hello" +PASS storage.getItem('foo12') is "ÿ찡\0hello" PASS successfullyParsed is true TEST COMPLETE diff --git a/LayoutTests/storage/indexeddb/open-cursor-expected.txt b/LayoutTests/storage/indexeddb/open-cursor-expected.txt new file mode 100644 index 0000000..ac58785 --- /dev/null +++ b/LayoutTests/storage/indexeddb/open-cursor-expected.txt @@ -0,0 +1,102 @@ +Test IndexedDB's openCursor. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +indexedDB.open('name', 'description') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'abort' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is true +PASS 'onsuccess' in event.target is true +PASS 'onerror' in event.target is true +PASS 'abort' in event.target is true +PASS 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +db = event.result +db.createObjectStore('test') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'abort' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is true +PASS 'onsuccess' in event.target is true +PASS 'onerror' in event.target is true +PASS 'abort' in event.target is true +PASS 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +objectStore = event.result +objectStore.add('myValue', 'myKey') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'abort' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +Opening cursor +objectStore.openCursor(keyRange) +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'abort' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +Cursor opened successfully. +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is true +PASS 'onsuccess' in event.target is true +PASS 'onerror' in event.target is true +PASS 'abort' in event.target is true +PASS 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS event.result.direction is 0 +PASS event.result.key is 'myKey' +PASS event.result.value is 'myValue' + +Opening an empty cursor. +objectStore.openCursor(keyRange) +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'abort' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +Empty cursor opened successfully. +Success event fired: +PASS 'result' in event is true +PASS 'code' in event is false +PASS 'message' in event is false +PASS 'source' in event is true +PASS event.source != null is true +PASS 'onsuccess' in event.target is true +PASS 'onerror' in event.target is true +PASS 'abort' in event.target is true +PASS 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS event.result is null +PASS successfullyParsed is true + +TEST COMPLETE diff --git a/LayoutTests/storage/indexeddb/open-cursor.html b/LayoutTests/storage/indexeddb/open-cursor.html new file mode 100644 index 0000000..f60365d --- /dev/null +++ b/LayoutTests/storage/indexeddb/open-cursor.html @@ -0,0 +1,13 @@ + + + + + + + + +

+
+ + + diff --git a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js new file mode 100644 index 0000000..e3c615c --- /dev/null +++ b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js @@ -0,0 +1,79 @@ +description("Test IndexedDB's openCursor."); +if (window.layoutTestController) + layoutTestController.waitUntilDone(); + +function emptyCursorSuccess() +{ + debug("Empty cursor opened successfully.") + verifySuccessEvent(event); + // FIXME: check that we can iterate the cursor. + shouldBe("event.result", "null"); + done(); +} + +function openEmptyCursor() +{ + debug("Opening an empty cursor."); + keyRange = IDBKeyRange.leftBound("InexistentKey"); + result = evalAndLog("objectStore.openCursor(keyRange)"); + verifyResult(result); + result.onsuccess = emptyCursorSuccess; +} + +function cursorSuccess() +{ + debug("Cursor opened successfully.") + verifySuccessEvent(event); + // FIXME: check that we can iterate the cursor. + shouldBe("event.result.direction", "0"); + shouldBe("event.result.key", "'myKey'"); + shouldBe("event.result.value", "'myValue'"); + debug(""); + openEmptyCursor(); +} + +function openCursor() +{ + debug("Opening cursor"); + keyRange = IDBKeyRange.leftBound("myKey"); + result = evalAndLog("objectStore.openCursor(keyRange)"); + verifyResult(result); + result.onsuccess = cursorSuccess; +} + +function populateObjectStore(objectStore) +{ + result = evalAndLog("objectStore.add('myValue', 'myKey')"); + verifyResult(result); + result.onsuccess = openCursor; + result.onerror = unexpectedErrorCallback; +} + +function createObjectStoreSuccess() +{ + verifySuccessEvent(event); + var objectStore = evalAndLog("objectStore = event.result"); + populateObjectStore(objectStore); +} + +function openSuccess() +{ + verifySuccessEvent(event); + var db = evalAndLog("db = event.result"); + result = evalAndLog("db.createObjectStore('test')"); + verifyResult(result); + result.onsuccess = createObjectStoreSuccess; + result.onerror = unexpectedErrorCallback; +} + +function test() +{ + result = evalAndLog("indexedDB.open('name', 'description')"); + verifyResult(result); + result.onsuccess = openSuccess; + result.onerror = unexpectedErrorCallback; +} + +test(); + +var successfullyParsed = true; -- cgit v1.1