diff options
author | Ben Murdoch <benm@google.com> | 2010-08-11 14:44:44 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-08-12 19:15:41 +0100 |
commit | dd8bb3de4f353a81954234999f1fea748aee2ea9 (patch) | |
tree | 729b52bf09294f0d6c67cd5ea80aee1b727b7bd8 /LayoutTests/storage | |
parent | f3d41ba51d86bf719c7a65ab5297aea3c17e2d98 (diff) | |
download | external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.zip external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.gz external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.bz2 |
Merge WebKit at r65072 : Initial merge by git.
Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585
Diffstat (limited to 'LayoutTests/storage')
4 files changed, 212 insertions, 18 deletions
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 @@ +<html> +<head> +<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> +<script src="../../fast/js/resources/js-test-pre.js"></script> +<script src="../../fast/js/resources/js-test-post-function.js"></script> +<script src="resources/shared.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/open-cursor.js"></script> +</body> +</html> 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; |