From e14391e94c850b8bd03680c23b38978db68687a8 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 4 Nov 2010 12:00:17 -0700 Subject: Merge Webkit at r70949: Initial merge by git. Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e --- .../storage/indexeddb/objectstore-cursor.html | 37 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'LayoutTests/storage/indexeddb/objectstore-cursor.html') 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; -- cgit v1.1