diff options
Diffstat (limited to 'LayoutTests/storage/indexeddb/index-cursor.html')
-rw-r--r-- | LayoutTests/storage/indexeddb/index-cursor.html | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/LayoutTests/storage/indexeddb/index-cursor.html b/LayoutTests/storage/indexeddb/index-cursor.html index 5aab4f8..6a9d1ac 100644 --- a/LayoutTests/storage/indexeddb/index-cursor.html +++ b/LayoutTests/storage/indexeddb/index-cursor.html @@ -107,7 +107,7 @@ function scheduleTests() function runNextTest() { if (!scheduledTests.length) { - done(); + testNullKeyRange(); return; } @@ -226,6 +226,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 = indexObject.openKeyCursor(null, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV); + request.onsuccess = cursorIteration; + request.onerror = unexpectedErrorCallback; +} + openDatabase(); // The first step. var successfullyParsed = true; |