From 4e4d5d048926d81f3d2a65e0eecec6fc2939645d Mon Sep 17 00:00:00 2001 From: "dgrogan@chromium.org" Date: Thu, 29 Sep 2011 16:42:48 +0000 Subject: [PATCH] Layout test demonstrating IDBCursor inconsistency bug. https://bugs.webkit.org/show_bug.cgi?id=69012 Reviewed by Nate Chapin. * storage/indexeddb/cursor-inconsistency-expected.txt: Added. * storage/indexeddb/cursor-inconsistency.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96335 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 10 +++ .../indexeddb/cursor-inconsistency-expected.txt | 62 ++++++++++++++ .../storage/indexeddb/cursor-inconsistency.html | 99 ++++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt create mode 100644 LayoutTests/storage/indexeddb/cursor-inconsistency.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 2d44ab1..39b85c2 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2011-09-29 David Grogan + + Layout test demonstrating IDBCursor inconsistency bug. + https://bugs.webkit.org/show_bug.cgi?id=69012 + + Reviewed by Nate Chapin. + + * storage/indexeddb/cursor-inconsistency-expected.txt: Added. + * storage/indexeddb/cursor-inconsistency.html: Added. + 2011-09-29 Adam Barth Generalize expected result to all of MAC. diff --git a/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt b/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt new file mode 100644 index 0000000..48675dd --- /dev/null +++ b/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt @@ -0,0 +1,62 @@ +Test consistency of IndexedDB's cursor objects. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +webkitIndexedDB.open('cursor-inconsistency') +db = event.target.result +db.setVersion('new version') +setVersionSuccess(): +trans = event.target.result +PASS trans !== null is true +Deleted all object stores. +objectStore = db.createObjectStore('basicStore') +objectStore.add('someValue1', 'someKey1').onerror = unexpectedErrorCallback +objectStore.add('someValue2', 'someKey2').onerror = unexpectedErrorCallback +objectStore.add('someValue3', 'someKey3').onerror = unexpectedErrorCallback +objectStore.add('someValue4', 'someKey4').onerror = unexpectedErrorCallback +openBasicCursor() +trans = db.transaction([], webkitIDBTransaction.READ_WRITE) +trans.objectStore('basicStore') +objectStore.openCursor(keyRange) + +checkCursor() +storedCursor = event.target.result +PASS storedCursor === event.target.result is true +PASS storedCursor.key is "someKey1" +PASS event.target.result.key is "someKey1" +PASS storedCursor.value is "someValue1" +PASS event.target.result.value is "someValue1" +event.target.result.continue() + +checkCursor() +FAIL storedCursor === event.target.result should be true. Was false. +PASS storedCursor.key is "someKey2" +PASS event.target.result.key is "someKey2" +FAIL storedCursor.value should be someValue2. Was someValue1. +PASS event.target.result.value is "someValue2" +event.target.result.continue() + +checkCursor() +FAIL storedCursor === event.target.result should be true. Was false. +PASS storedCursor.key is "someKey3" +PASS event.target.result.key is "someKey3" +FAIL storedCursor.value should be someValue3. Was someValue1. +PASS event.target.result.value is "someValue3" +event.target.result.continue() + +checkCursor() +FAIL storedCursor === event.target.result should be true. Was false. +PASS storedCursor.key is "someKey4" +PASS event.target.result.key is "someKey4" +FAIL storedCursor.value should be someValue4. Was someValue1. +PASS event.target.result.value is "someValue4" +event.target.result.continue() + +checkCursor() +PASS counter is 5 +transactionComplete() +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/storage/indexeddb/cursor-inconsistency.html b/LayoutTests/storage/indexeddb/cursor-inconsistency.html new file mode 100644 index 0000000..b9ccb58 --- /dev/null +++ b/LayoutTests/storage/indexeddb/cursor-inconsistency.html @@ -0,0 +1,99 @@ + + + + + + + + +

+
+ + + -- 2.7.4