Modern IDB: storage/indexeddb/cursor-index-delete.html fails.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Dec 2015 05:55:35 +0000 (05:55 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Dec 2015 05:55:35 +0000 (05:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151847

Reviewed by Andy Estes.

Source/WebCore:

No new tests (At least one failing test now passes).

* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
(WebCore::IDBServer::MemoryIndexCursor::currentData):

LayoutTests:

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193410 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/server/MemoryIndexCursor.cpp

index 2089baa..23acde6 100644 (file)
@@ -1,3 +1,12 @@
+2015-12-03  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: storage/indexeddb/cursor-index-delete.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=151847
+
+        Reviewed by Andy Estes.
+
+        * platform/mac-wk1/TestExpectations:
+
 2015-12-03  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] Update MediaStreamTrack.getCapabilities
index 40d3e26..b451d09 100644 (file)
@@ -79,6 +79,7 @@ storage/indexeddb/cursor-advance.html [ Pass ]
 storage/indexeddb/cursor-basics.html [ Pass ]
 storage/indexeddb/cursor-cast.html [ Pass ]
 storage/indexeddb/cursor-finished.html [ Pass ]
+storage/indexeddb/cursor-index-delete.html [ Pass ]
 storage/indexeddb/cursor-overloads.html [ Pass ]
 storage/indexeddb/cursor-skip-deleted.html [ Pass ]
 storage/indexeddb/modern [ Pass ]
index 52320e7..05b060e 100644 (file)
@@ -1,3 +1,16 @@
+2015-12-03  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: storage/indexeddb/cursor-index-delete.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=151847
+
+        Reviewed by Andy Estes.
+
+        No new tests (At least one failing test now passes).
+
+        * Modules/indexeddb/server/MemoryIndexCursor.cpp:
+        (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
+        (WebCore::IDBServer::MemoryIndexCursor::currentData):
+
 2015-12-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
         Reduce uses of PassRefPtr in DOM - 1
index 312c557..47d28c6 100644 (file)
@@ -46,15 +46,14 @@ MemoryIndexCursor::MemoryIndexCursor(MemoryIndex& index, const IDBCursorInfo& in
     if (!valueStore)
         return;
 
-    IndexValueStore::Iterator iterator;
     if (m_info.isDirectionForward())
-        iterator = valueStore->find(m_info.range().lowerKey, m_info.range().lowerOpen);
+        m_currentIterator = valueStore->find(m_info.range().lowerKey, m_info.range().lowerOpen);
     else
-        iterator = valueStore->reverseFind(m_info.range().upperKey, m_info.duplicity(), m_info.range().upperOpen);
+        m_currentIterator = valueStore->reverseFind(m_info.range().upperKey, m_info.duplicity(), m_info.range().upperOpen);
 
-    if (iterator.isValid()) {
-        m_currentKey = iterator.key();
-        m_currentPrimaryKey = iterator.primaryKey();
+    if (m_currentIterator.isValid()) {
+        m_currentKey = m_currentIterator.key();
+        m_currentPrimaryKey = m_currentIterator.primaryKey();
         m_index.cursorDidBecomeClean(*this);
     }
 }
@@ -65,6 +64,11 @@ MemoryIndexCursor::~MemoryIndexCursor()
 
 void MemoryIndexCursor::currentData(IDBGetResult& getResult)
 {
+    if (!m_currentIterator.isValid()) {
+        getResult = { };
+        return;
+    }
+
     if (m_info.cursorType() == IndexedDB::CursorType::KeyOnly)
         getResult = { m_currentKey, m_currentPrimaryKey };
     else