Title: [193949] trunk
Revision
193949
Author
[email protected]
Date
2015-12-10 23:59:41 -0800 (Thu, 10 Dec 2015)

Log Message

Modern IDB: storage/indexeddb/objectstore-count.html fails.
https://bugs.webkit.org/show_bug.cgi?id=152167

Reviewed by Alex Christensen.

Source/WebCore:

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

* Modules/indexeddb/IDBKeyRangeData.h:
(WebCore::IDBKeyRangeData::allKeys):

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::count): If the passed in IDBKeyRange* is nullptr, use IDBKeyRangeData::allKeys.
(WebCore::IDBClient::IDBObjectStore::doCount): Change an isNull check to a more correct !isValid() check.

LayoutTests:

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/objectstore-count-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (193948 => 193949)


--- trunk/LayoutTests/ChangeLog	2015-12-11 07:45:09 UTC (rev 193948)
+++ trunk/LayoutTests/ChangeLog	2015-12-11 07:59:41 UTC (rev 193949)
@@ -1,3 +1,13 @@
+2015-12-10  Brady Eidson  <[email protected]>
+
+        Modern IDB: storage/indexeddb/objectstore-count.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=152167
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+        * storage/indexeddb/objectstore-count-expected.txt:
+
 2015-12-10  Zalan Bujtas  <[email protected]>
 
         ASSERTION FAILED: !simpleLineLayout() in WebCore::RenderText::collectSelectionRectsForLineBoxes

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (193948 => 193949)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2015-12-11 07:45:09 UTC (rev 193948)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2015-12-11 07:59:41 UTC (rev 193949)
@@ -109,7 +109,6 @@
 storage/indexeddb/intversion-upgrades.html [ Failure ]
 storage/indexeddb/key-type-array.html [ Failure ]
 storage/indexeddb/objectstore-autoincrement.html [ Failure ]
-storage/indexeddb/objectstore-count.html [ Failure ]
 storage/indexeddb/open-cursor.html [ Failure ]
 storage/indexeddb/open-db-private-browsing.html [ Failure ]
 storage/indexeddb/open-ordering.html [ Failure ]

Modified: trunk/LayoutTests/storage/indexeddb/objectstore-count-expected.txt (193948 => 193949)


--- trunk/LayoutTests/storage/indexeddb/objectstore-count-expected.txt	2015-12-11 07:45:09 UTC (rev 193948)
+++ trunk/LayoutTests/storage/indexeddb/objectstore-count-expected.txt	2015-12-11 07:59:41 UTC (rev 193949)
@@ -80,17 +80,17 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: DataError: DOM IDBDatabase Exception 0
+Exception message: Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.
 Expecting exception from store.count({})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: DataError: DOM IDBDatabase Exception 0
+Exception message: Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.
 Expecting exception from store.count(/regex/)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: DataError: DOM IDBDatabase Exception 0
+Exception message: Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.
 
 test = {"key":0,"expected":1}
 request = store.count(test.key)

Modified: trunk/Source/WebCore/ChangeLog (193948 => 193949)


--- trunk/Source/WebCore/ChangeLog	2015-12-11 07:45:09 UTC (rev 193948)
+++ trunk/Source/WebCore/ChangeLog	2015-12-11 07:59:41 UTC (rev 193949)
@@ -1,3 +1,19 @@
+2015-12-10  Brady Eidson  <[email protected]>
+
+        Modern IDB: storage/indexeddb/objectstore-count.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=152167
+
+        Reviewed by Alex Christensen.
+
+        No new tests (At least one failing test now passes).
+
+        * Modules/indexeddb/IDBKeyRangeData.h:
+        (WebCore::IDBKeyRangeData::allKeys):
+        
+        * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
+        (WebCore::IDBClient::IDBObjectStore::count): If the passed in IDBKeyRange* is nullptr, use IDBKeyRangeData::allKeys.
+        (WebCore::IDBClient::IDBObjectStore::doCount): Change an isNull check to a more correct !isValid() check.
+
 2015-12-10  Youenn Fablet  <[email protected]>
 
         Binding and builtin generators should lowercase RTCXX as rtcXX and not rTCXX

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h (193948 => 193949)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h	2015-12-11 07:45:09 UTC (rev 193948)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h	2015-12-11 07:59:41 UTC (rev 193949)
@@ -43,6 +43,15 @@
     {
     }
 
+    static IDBKeyRangeData allKeys()
+    {
+        IDBKeyRangeData result;
+        result.isNull = false;
+        result.lowerKey = IDBKeyData::minimum();
+        result.upperKey = IDBKeyData::maximum();
+        return result;
+    }
+
     IDBKeyRangeData(IDBKey*);
     IDBKeyRangeData(const IDBKeyData&);
 

Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (193948 => 193949)


--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp	2015-12-11 07:45:09 UTC (rev 193948)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp	2015-12-11 07:59:41 UTC (rev 193949)
@@ -539,9 +539,7 @@
         return nullptr;
     }
 
-    IDBKeyRangeData range;
-    range.isNull = false;
-    return doCount(*context, range, ec);
+    return doCount(*context, IDBKeyRangeData::allKeys(), ec);
 }
 
 RefPtr<WebCore::IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
@@ -573,7 +571,7 @@
         return nullptr;
     }
 
-    return doCount(*context, IDBKeyRangeData(range), ec);
+    return doCount(*context, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys(), ec);
 }
 
 RefPtr<WebCore::IDBRequest> IDBObjectStore::doCount(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec)
@@ -589,7 +587,7 @@
         return nullptr;
     }
 
-    if (range.isNull) {
+    if (!range.isValid()) {
         ec.code = IDBDatabaseException::DataError;
         return nullptr;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to