Skip to content
Permalink
Browse files
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:


Canonical link: https://commits.webkit.org/170294@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
beidson committed Dec 11, 2015
1 parent c69fcb6 commit 70191090cf655b8bd4ce18db627b32a026528b69
Showing 6 changed files with 41 additions and 9 deletions.
@@ -1,3 +1,13 @@
2015-12-10 Brady Eidson <beidson@apple.com>

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 <zalan@apple.com>

ASSERTION FAILED: !simpleLineLayout() in WebCore::RenderText::collectSelectionRectsForLineBoxes
@@ -109,7 +109,6 @@ storage/indexeddb/intversion-two-opens-no-versions.html [ Failure ]
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 ]
@@ -80,17 +80,17 @@ Expecting exception from store.count(NaN)
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)
@@ -1,3 +1,19 @@
2015-12-10 Brady Eidson <beidson@apple.com>

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 <youenn.fablet@crf.canon.fr>

Binding and builtin generators should lowercase RTCXX as rtcXX and not rTCXX
@@ -43,6 +43,15 @@ struct IDBKeyRangeData {
{
}

static IDBKeyRangeData allKeys()
{
IDBKeyRangeData result;
result.isNull = false;
result.lowerKey = IDBKeyData::minimum();
result.upperKey = IDBKeyData::maximum();
return result;
}

IDBKeyRangeData(IDBKey*);
IDBKeyRangeData(const IDBKeyData&);

@@ -539,9 +539,7 @@ RefPtr<WebCore::IDBRequest> IDBObjectStore::count(ScriptExecutionContext* contex
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 @@ RefPtr<WebCore::IDBRequest> IDBObjectStore::count(ScriptExecutionContext* contex
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 @@ RefPtr<WebCore::IDBRequest> IDBObjectStore::doCount(ScriptExecutionContext& cont
return nullptr;
}

if (range.isNull) {
if (!range.isValid()) {
ec.code = IDBDatabaseException::DataError;
return nullptr;
}

0 comments on commit 7019109

Please sign in to comment.