diff options
author | John Reck <jreck@google.com> | 2010-11-04 12:00:17 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2010-11-09 11:35:04 -0800 |
commit | e14391e94c850b8bd03680c23b38978db68687a8 (patch) | |
tree | 3fed87e6620fecaf3edc7259ae58a11662bedcb2 /LayoutTests/storage/indexeddb/objectstore-cursor.html | |
parent | 1bd705833a68f07850cf7e204b26f8d328d16951 (diff) | |
download | external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2 |
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'LayoutTests/storage/indexeddb/objectstore-cursor.html')
-rw-r--r-- | LayoutTests/storage/indexeddb/objectstore-cursor.html | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/LayoutTests/storage/indexeddb/objectstore-cursor.html b/LayoutTests/storage/indexeddb/objectstore-cursor.html index d9ad805..d0d786b 100644 --- a/LayoutTests/storage/indexeddb/objectstore-cursor.html +++ b/LayoutTests/storage/indexeddb/objectstore-cursor.html @@ -105,7 +105,7 @@ function scheduleTests() function runNextTest() { if (!scheduledTests.length) { - done(); + testNullKeyRange(); return; } @@ -164,8 +164,7 @@ function runNextTest() else keyRange = webkitIDBKeyRange.rightBound(testData[upper], upperIsOpen); - // FIXME: Should be webkitIDBCursor.NEXT : webkitIDBCursor.PREV, but we can't do that yet. - var request = objectStore.openCursor(keyRange, ascending ? 0 : 2); + var request = objectStore.openCursor(keyRange, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV); request.onsuccess = cursorIteration; request.onerror = unexpectedErrorCallback; } @@ -204,6 +203,38 @@ function cursorIteration() event.result.continue(); } +window.nullKeyRangeStep = 0; +function testNullKeyRange() +{ + window.lower = 0; + window.lowerIsOpen = false; + window.upper = testData.length-1; + window.upperIsOpen = false; + + str = "Next test: null key path "; + if (window.nullKeyRangeStep == 0) { + str += "sorted ascending."; + window.ascending = true; + window.expectedIndex = lower; + window.nullKeyRangeStep = 1; + } else if (window.nullKeyRangeStep == 1) { + str += "sorted descending."; + window.ascending = false; + window.expectedIndex = upper; + window.nullKeyRangeStep = 2; + } else { + done(); + return; + } + + debug(""); + debug(str); + + var request = objectStore.openCursor(null, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV); + request.onsuccess = cursorIteration; + request.onerror = unexpectedErrorCallback; +} + openDatabase(); // The first step. var successfullyParsed = true; |