Title: [208349] trunk
Revision
208349
Author
beid...@apple.com
Date
2016-11-03 14:47:21 -0700 (Thu, 03 Nov 2016)

Log Message

IndexedDB 2.0: Support binary keys.
<rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idb_binary_key_conversion-expected.txt:
* web-platform-tests/IndexedDB/idbfactory_cmp3-expected.txt:
* web-platform-tests/IndexedDB/idbfactory_cmp4-expected.txt:

Source/WebCore:

Tests: storage/indexeddb/modern/binary-keys-1-private.html
       storage/indexeddb/modern/binary-keys-1.html
       Changes to other existing tests.

* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::createBinary):
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::compare):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::binary):
(WebCore::compareBinaryKeyData):

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare):
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::operator==):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::hash):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):

* Modules/indexeddb/IndexedDB.h: Add new enum for the new key type.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
(WebCore::createIDBKeyFromValue):

* platform/ThreadSafeDataBuffer.h:
(WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
(WebCore::ThreadSafeDataBuffer::copyData):
(WebCore::ThreadSafeDataBuffer::size):
(WebCore::ThreadSafeDataBuffer::operator==):
(WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):

Source/WTF:

* wtf/Hasher.h:
(WTF::StringHasher::hashMemory): Teach hashMemory() to handle buffers with odd lengths.

LayoutTests:

* storage/indexeddb/factory-cmp-expected.txt:
* storage/indexeddb/factory-cmp-private-expected.txt:
* storage/indexeddb/key-type-binary-expected.txt:
* storage/indexeddb/key-type-binary-private-expected.txt:
* storage/indexeddb/modern/binary-keys-1-expected.txt: Added.
* storage/indexeddb/modern/binary-keys-1-private-expected.txt: Added.
* storage/indexeddb/modern/binary-keys-1-private.html: Added.
* storage/indexeddb/modern/binary-keys-1.html: Added.
* storage/indexeddb/modern/resources/binary-keys-1.js: Added.
* storage/indexeddb/resources/factory-cmp.js:
* storage/indexeddb/resources/key-type-binary.js:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (208348 => 208349)


--- trunk/LayoutTests/ChangeLog	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/ChangeLog	2016-11-03 21:47:21 UTC (rev 208349)
@@ -1,3 +1,22 @@
+2016-11-03  Brady Eidson  <beid...@apple.com>
+
+        IndexedDB 2.0: Support binary keys.
+        <rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/factory-cmp-expected.txt:
+        * storage/indexeddb/factory-cmp-private-expected.txt:
+        * storage/indexeddb/key-type-binary-expected.txt:
+        * storage/indexeddb/key-type-binary-private-expected.txt:
+        * storage/indexeddb/modern/binary-keys-1-expected.txt: Added.
+        * storage/indexeddb/modern/binary-keys-1-private-expected.txt: Added.
+        * storage/indexeddb/modern/binary-keys-1-private.html: Added.
+        * storage/indexeddb/modern/binary-keys-1.html: Added.
+        * storage/indexeddb/modern/resources/binary-keys-1.js: Added.
+        * storage/indexeddb/resources/factory-cmp.js:
+        * storage/indexeddb/resources/key-type-binary.js:
+
 2016-11-02  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         CSS.supports("font-variation-settings", "'wght' 500") erroneously returns false

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (208348 => 208349)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-11-03 21:47:21 UTC (rev 208349)
@@ -1,3 +1,14 @@
+2016-11-03  Brady Eidson  <beid...@apple.com>
+
+        IndexedDB 2.0: Support binary keys.
+        <rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
+
+        Reviewed by Alex Christensen.
+
+        * web-platform-tests/IndexedDB/idb_binary_key_conversion-expected.txt:
+        * web-platform-tests/IndexedDB/idbfactory_cmp3-expected.txt:
+        * web-platform-tests/IndexedDB/idbfactory_cmp4-expected.txt:
+
 2016-11-01  Brady Eidson  <beid...@apple.com>
 
         IndexedDB 2.0: Support IDBIndex getAll/getAllKeys.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb_binary_key_conversion-expected.txt (208348 => 208349)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb_binary_key_conversion-expected.txt	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb_binary_key_conversion-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -1,7 +1,7 @@
 
-FAIL Empty ArrayBuffer The data provided does not meet requirements.
-FAIL ArrayBuffer The data provided does not meet requirements.
-FAIL DataView The data provided does not meet requirements.
-FAIL TypedArray(Int8Array) The data provided does not meet requirements.
-FAIL Array of TypedArray(Int8Array) The data provided does not meet requirements.
+PASS Empty ArrayBuffer 
+PASS ArrayBuffer 
+PASS DataView 
+PASS TypedArray(Int8Array) 
+PASS Array of TypedArray(Int8Array) 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp3-expected.txt (208348 => 208349)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp3-expected.txt	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp3-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -1,6 +1,6 @@
 
-FAIL Array v.s. Binary Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-FAIL Binary v.s. String Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
+PASS Array v.s. Binary 
+PASS Binary v.s. String 
 PASS String v.s. Date 
 PASS Date v.s. Number 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp4-expected.txt (208348 => 208349)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp4-expected.txt	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp4-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -1,6 +1,6 @@
 
-FAIL Compare in unsigned octet values (in the range [0, 255]) Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-FAIL Compare values in then same length Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-FAIL Compare values in different lengths Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-FAIL Compare when the values in the range of their minimal length are the same Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
+PASS Compare in unsigned octet values (in the range [0, 255]) 
+PASS Compare values in then same length 
+PASS Compare values in different lengths 
+PASS Compare when the values in the range of their minimal length are the same 
 

Modified: trunk/LayoutTests/storage/indexeddb/factory-cmp-expected.txt (208348 => 208349)


--- trunk/LayoutTests/storage/indexeddb/factory-cmp-expected.txt	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/storage/indexeddb/factory-cmp-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -92,9 +92,41 @@
 PASS indexedDB.cmp('�','𝄞') is 1
 PASS indexedDB.cmp('𝄞','𝄞') is 0
 PASS indexedDB.cmp('�','�') is 0
-PASS indexedDB.cmp('�',[]) is -1
-PASS indexedDB.cmp([],'�') is 1
+PASS indexedDB.cmp('�',new Uint8Array()) is -1
+PASS indexedDB.cmp(new Uint8Array(),'�') is 1
 PASS indexedDB.cmp('�','�') is 0
+PASS indexedDB.cmp(new Uint8Array(),new Uint8Array()) is 0
+PASS indexedDB.cmp(new Uint8Array(),new Uint8Array([0])) is -1
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array()) is 1
+PASS indexedDB.cmp(new Uint8Array(),new Uint8Array()) is 0
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array([0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array([0, 0])) is -1
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0])) is 1
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array([0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0, 1])) is -1
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([0, 0])) is 1
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([0, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([1])) is -1
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([0, 1])) is 1
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([0, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([1, 0])) is -1
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1])) is 1
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1, 1])) is -1
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([1, 0])) is 1
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([1, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([255])) is -1
+PASS indexedDB.cmp(new Uint8Array([255]),new Uint8Array([1, 1])) is 1
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([1, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([255]),new Uint8Array([255])) is 0
+PASS indexedDB.cmp(new Uint8Array([255]),[]) is -1
+PASS indexedDB.cmp([],new Uint8Array([255])) is 1
+PASS indexedDB.cmp(new Uint8Array([255]),new Uint8Array([255])) is 0
 PASS indexedDB.cmp([],[]) is 0
 PASS indexedDB.cmp([],[-Infinity]) is -1
 PASS indexedDB.cmp([-Infinity],[]) is 1
@@ -184,9 +216,41 @@
 PASS indexedDB.cmp(['�'],['𝄞']) is 1
 PASS indexedDB.cmp(['𝄞'],['𝄞']) is 0
 PASS indexedDB.cmp(['�'],['�']) is 0
-PASS indexedDB.cmp(['�'],[[]]) is -1
-PASS indexedDB.cmp([[]],['�']) is 1
+PASS indexedDB.cmp(['�'],[new Uint8Array()]) is -1
+PASS indexedDB.cmp([new Uint8Array()],['�']) is 1
 PASS indexedDB.cmp(['�'],['�']) is 0
+PASS indexedDB.cmp([new Uint8Array()],[new Uint8Array()]) is 0
+PASS indexedDB.cmp([new Uint8Array()],[new Uint8Array([0])]) is -1
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array()]) is 1
+PASS indexedDB.cmp([new Uint8Array()],[new Uint8Array()]) is 0
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array([0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array([0, 0])]) is -1
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0])]) is 1
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array([0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0, 1])]) is -1
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([0, 0])]) is 1
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([0, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([1])]) is -1
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([0, 1])]) is 1
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([0, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([1, 0])]) is -1
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1])]) is 1
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1, 1])]) is -1
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([1, 0])]) is 1
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([1, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([255])]) is -1
+PASS indexedDB.cmp([new Uint8Array([255])],[new Uint8Array([1, 1])]) is 1
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([1, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([255])],[new Uint8Array([255])]) is 0
+PASS indexedDB.cmp([new Uint8Array([255])],[[]]) is -1
+PASS indexedDB.cmp([[]],[new Uint8Array([255])]) is 1
+PASS indexedDB.cmp([new Uint8Array([255])],[new Uint8Array([255])]) is 0
 PASS indexedDB.cmp([[]],[[]]) is 0
 PASS indexedDB.cmp([[]],[[], []]) is -1
 PASS indexedDB.cmp([[], []],[[]]) is 1
@@ -536,486 +600,6 @@
 PASS code is 0
 PASS ename is 'DataError'
 Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(self.document.body, new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), self.document.body)
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(self.document.body, 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', self.document.body)
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], [new Uint8Array([255])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([255])], [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([255])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([255])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
 
 compare identical keys
 PASS indexedDB.cmp(0, -0) is 0

Modified: trunk/LayoutTests/storage/indexeddb/factory-cmp-private-expected.txt (208348 => 208349)


--- trunk/LayoutTests/storage/indexeddb/factory-cmp-private-expected.txt	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/storage/indexeddb/factory-cmp-private-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -92,9 +92,41 @@
 PASS indexedDB.cmp('�','𝄞') is 1
 PASS indexedDB.cmp('𝄞','𝄞') is 0
 PASS indexedDB.cmp('�','�') is 0
-PASS indexedDB.cmp('�',[]) is -1
-PASS indexedDB.cmp([],'�') is 1
+PASS indexedDB.cmp('�',new Uint8Array()) is -1
+PASS indexedDB.cmp(new Uint8Array(),'�') is 1
 PASS indexedDB.cmp('�','�') is 0
+PASS indexedDB.cmp(new Uint8Array(),new Uint8Array()) is 0
+PASS indexedDB.cmp(new Uint8Array(),new Uint8Array([0])) is -1
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array()) is 1
+PASS indexedDB.cmp(new Uint8Array(),new Uint8Array()) is 0
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array([0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array([0, 0])) is -1
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0])) is 1
+PASS indexedDB.cmp(new Uint8Array([0]),new Uint8Array([0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0, 1])) is -1
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([0, 0])) is 1
+PASS indexedDB.cmp(new Uint8Array([0, 0]),new Uint8Array([0, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([0, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([1])) is -1
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([0, 1])) is 1
+PASS indexedDB.cmp(new Uint8Array([0, 1]),new Uint8Array([0, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([1, 0])) is -1
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1])) is 1
+PASS indexedDB.cmp(new Uint8Array([1]),new Uint8Array([1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1, 1])) is -1
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([1, 0])) is 1
+PASS indexedDB.cmp(new Uint8Array([1, 0]),new Uint8Array([1, 0])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([1, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([255])) is -1
+PASS indexedDB.cmp(new Uint8Array([255]),new Uint8Array([1, 1])) is 1
+PASS indexedDB.cmp(new Uint8Array([1, 1]),new Uint8Array([1, 1])) is 0
+PASS indexedDB.cmp(new Uint8Array([255]),new Uint8Array([255])) is 0
+PASS indexedDB.cmp(new Uint8Array([255]),[]) is -1
+PASS indexedDB.cmp([],new Uint8Array([255])) is 1
+PASS indexedDB.cmp(new Uint8Array([255]),new Uint8Array([255])) is 0
 PASS indexedDB.cmp([],[]) is 0
 PASS indexedDB.cmp([],[-Infinity]) is -1
 PASS indexedDB.cmp([-Infinity],[]) is 1
@@ -184,9 +216,41 @@
 PASS indexedDB.cmp(['�'],['𝄞']) is 1
 PASS indexedDB.cmp(['𝄞'],['𝄞']) is 0
 PASS indexedDB.cmp(['�'],['�']) is 0
-PASS indexedDB.cmp(['�'],[[]]) is -1
-PASS indexedDB.cmp([[]],['�']) is 1
+PASS indexedDB.cmp(['�'],[new Uint8Array()]) is -1
+PASS indexedDB.cmp([new Uint8Array()],['�']) is 1
 PASS indexedDB.cmp(['�'],['�']) is 0
+PASS indexedDB.cmp([new Uint8Array()],[new Uint8Array()]) is 0
+PASS indexedDB.cmp([new Uint8Array()],[new Uint8Array([0])]) is -1
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array()]) is 1
+PASS indexedDB.cmp([new Uint8Array()],[new Uint8Array()]) is 0
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array([0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array([0, 0])]) is -1
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0])]) is 1
+PASS indexedDB.cmp([new Uint8Array([0])],[new Uint8Array([0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0, 1])]) is -1
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([0, 0])]) is 1
+PASS indexedDB.cmp([new Uint8Array([0, 0])],[new Uint8Array([0, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([0, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([1])]) is -1
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([0, 1])]) is 1
+PASS indexedDB.cmp([new Uint8Array([0, 1])],[new Uint8Array([0, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([1, 0])]) is -1
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1])]) is 1
+PASS indexedDB.cmp([new Uint8Array([1])],[new Uint8Array([1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1, 1])]) is -1
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([1, 0])]) is 1
+PASS indexedDB.cmp([new Uint8Array([1, 0])],[new Uint8Array([1, 0])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([1, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([255])]) is -1
+PASS indexedDB.cmp([new Uint8Array([255])],[new Uint8Array([1, 1])]) is 1
+PASS indexedDB.cmp([new Uint8Array([1, 1])],[new Uint8Array([1, 1])]) is 0
+PASS indexedDB.cmp([new Uint8Array([255])],[new Uint8Array([255])]) is 0
+PASS indexedDB.cmp([new Uint8Array([255])],[[]]) is -1
+PASS indexedDB.cmp([[]],[new Uint8Array([255])]) is 1
+PASS indexedDB.cmp([new Uint8Array([255])],[new Uint8Array([255])]) is 0
 PASS indexedDB.cmp([[]],[[]]) is 0
 PASS indexedDB.cmp([[]],[[], []]) is -1
 PASS indexedDB.cmp([[], []],[[]]) is 1
@@ -536,486 +600,6 @@
 PASS code is 0
 PASS ename is 'DataError'
 Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(self.document.body, new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), self.document.body)
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(self.document.body, 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', self.document.body)
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array(), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array())
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([0, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([0, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 0]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 0]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([1, 1]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([1, 1]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp(new Uint8Array([255]), 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', new Uint8Array([255]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array()], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array()])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([0, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([0, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 0])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 0])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], [new Uint8Array([255])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([255])], [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([1, 1])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([1, 1])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp([new Uint8Array([255])], 'valid')
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
-Expecting exception from indexedDB.cmp('valid', [new Uint8Array([255])])
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
 
 compare identical keys
 PASS indexedDB.cmp(0, -0) is 0

Modified: trunk/LayoutTests/storage/indexeddb/key-type-binary-expected.txt (208348 => 208349)


--- trunk/LayoutTests/storage/indexeddb/key-type-binary-expected.txt	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/storage/indexeddb/key-type-binary-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -10,121 +10,49 @@
 db.createObjectStore('store');
 
 
-testInvalidBinaryKeys1():
+testBinaryKeys1():
 trans = db.transaction('store', 'readwrite')
 store = trans.objectStore('store')
 
-Expecting exception from store.put(0, new Uint8Array([]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(0, new Uint8Array([]));
 
-Expecting exception from store.put(1, new Uint8Array([0]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(1, new Uint8Array([0]));
 
-Expecting exception from store.put(2, new Uint8Array([0, 0]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(2, new Uint8Array([0, 0]));
 
-Expecting exception from store.put(3, new Uint8Array([0, 1]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(3, new Uint8Array([0, 1]));
 
-Expecting exception from store.put(4, new Uint8Array([1]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(4, new Uint8Array([1]));
 
-Expecting exception from store.put(5, new Uint8Array([1, 0]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(5, new Uint8Array([1, 0]));
 
-Expecting exception from store.put(6, new Uint8Array([1, 1]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(6, new Uint8Array([1, 1]));
 
-Expecting exception from store.put(7, new Uint8Array([255]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(7, new Uint8Array([255]));
 
-testInvalidBinaryKeys2():
+testBinaryKeys2():
 trans = db.transaction('store', 'readwrite')
 store = trans.objectStore('store')
 
-Expecting exception from store.put('value', new Uint8ClampedArray([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint8ClampedArray([1,2,3]))
 
-Expecting exception from store.put('value', new Uint16Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint16Array([1,2,3]))
 
-Expecting exception from store.put('value', new Uint32Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint32Array([1,2,3]))
 
-Expecting exception from store.put('value', new Int8Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Int8Array([1,2,3]))
 
-Expecting exception from store.put('value', new Int16Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Int16Array([1,2,3]))
 
-Expecting exception from store.put('value', new Int32Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Int32Array([1,2,3]))
 
-Expecting exception from store.put('value', new Float32Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Float32Array([1,2,3]))
 
-Expecting exception from store.put('value', new Float64Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Float64Array([1,2,3]))
 
-Expecting exception from store.put('value', new Uint8Array([1,2,3]).buffer)
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint8Array([1,2,3]).buffer)
 
-Expecting exception from store.put('value', new DataView(new Uint8Array([1,2,3]).buffer))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new DataView(new Uint8Array([1,2,3]).buffer))
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/key-type-binary-private-expected.txt (208348 => 208349)


--- trunk/LayoutTests/storage/indexeddb/key-type-binary-private-expected.txt	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/storage/indexeddb/key-type-binary-private-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -10,121 +10,49 @@
 db.createObjectStore('store');
 
 
-testInvalidBinaryKeys1():
+testBinaryKeys1():
 trans = db.transaction('store', 'readwrite')
 store = trans.objectStore('store')
 
-Expecting exception from store.put(0, new Uint8Array([]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(0, new Uint8Array([]));
 
-Expecting exception from store.put(1, new Uint8Array([0]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(1, new Uint8Array([0]));
 
-Expecting exception from store.put(2, new Uint8Array([0, 0]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(2, new Uint8Array([0, 0]));
 
-Expecting exception from store.put(3, new Uint8Array([0, 1]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(3, new Uint8Array([0, 1]));
 
-Expecting exception from store.put(4, new Uint8Array([1]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(4, new Uint8Array([1]));
 
-Expecting exception from store.put(5, new Uint8Array([1, 0]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(5, new Uint8Array([1, 0]));
 
-Expecting exception from store.put(6, new Uint8Array([1, 1]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(6, new Uint8Array([1, 1]));
 
-Expecting exception from store.put(7, new Uint8Array([255]));
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put(7, new Uint8Array([255]));
 
-testInvalidBinaryKeys2():
+testBinaryKeys2():
 trans = db.transaction('store', 'readwrite')
 store = trans.objectStore('store')
 
-Expecting exception from store.put('value', new Uint8ClampedArray([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint8ClampedArray([1,2,3]))
 
-Expecting exception from store.put('value', new Uint16Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint16Array([1,2,3]))
 
-Expecting exception from store.put('value', new Uint32Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint32Array([1,2,3]))
 
-Expecting exception from store.put('value', new Int8Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Int8Array([1,2,3]))
 
-Expecting exception from store.put('value', new Int16Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Int16Array([1,2,3]))
 
-Expecting exception from store.put('value', new Int32Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Int32Array([1,2,3]))
 
-Expecting exception from store.put('value', new Float32Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Float32Array([1,2,3]))
 
-Expecting exception from store.put('value', new Float64Array([1,2,3]))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Float64Array([1,2,3]))
 
-Expecting exception from store.put('value', new Uint8Array([1,2,3]).buffer)
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new Uint8Array([1,2,3]).buffer)
 
-Expecting exception from store.put('value', new DataView(new Uint8Array([1,2,3]).buffer))
-PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'DataError'
-Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
+store.put('value', new DataView(new Uint8Array([1,2,3]).buffer))
 PASS successfullyParsed is true
 
 TEST COMPLETE

Added: trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-expected.txt (0 => 208349)


--- trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -0,0 +1,41 @@
+This test verifies the basic use of binary keys.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 0
+PASS key.byteLength is binary.byteLength
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS dataView.getUint32(0) is new DataView(key).getUint32(0)
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS dataView.getUint32(0) is new DataView(key).getUint32(0)
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+Got the key and value with a cursor
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS retrievedValue is expectedValue
+Got the value with a DataView key: Value
+Got the value with an ArrayBuffer key: Value
+Got the value with a Typed Array key: Value
+Got the value with a Typed Array key, but changed from the original put: undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-private-expected.txt (0 => 208349)


--- trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-private-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-private-expected.txt	2016-11-03 21:47:21 UTC (rev 208349)
@@ -0,0 +1,41 @@
+This test verifies the basic use of binary keys.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 0
+PASS key.byteLength is binary.byteLength
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS dataView.getUint32(0) is new DataView(key).getUint32(0)
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS dataView.getUint32(0) is new DataView(key).getUint32(0)
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+Got the key and value with a cursor
+PASS key instanceof ArrayBuffer is true
+PASS key.byteLength is 4
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS keyInInt8Array[i] is int8Array[i]
+PASS retrievedValue is expectedValue
+Got the value with a DataView key: Value
+Got the value with an ArrayBuffer key: Value
+Got the value with a Typed Array key: Value
+Got the value with a Typed Array key, but changed from the original put: undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-private.html (0 => 208349)


--- trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-private.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1-private.html	2016-11-03 21:47:21 UTC (rev 208349)
@@ -0,0 +1,12 @@
+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1.html (0 => 208349)


--- trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/binary-keys-1.html	2016-11-03 21:47:21 UTC (rev 208349)
@@ -0,0 +1,9 @@
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/storage/indexeddb/modern/resources/binary-keys-1.js (0 => 208349)


--- trunk/LayoutTests/storage/indexeddb/modern/resources/binary-keys-1.js	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/binary-keys-1.js	2016-11-03 21:47:21 UTC (rev 208349)
@@ -0,0 +1,137 @@
+description("This test verifies the basic use of binary keys.");
+
+indexedDBTest(prepareDatabase);
+
+function log(message)
+{
+    debug(message);
+}
+
+var testGenerator;
+function next()
+{
+    testGenerator.next();
+}
+
+function asyncNext()
+{
+    setTimeout("testGenerator.next();", 0);
+}
+
+var db;
+var dbName;
+var dbVersion;
+
+function prepareDatabase(event)
+{
+    log("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+    db = event.target.result;
+    dbName = db.name;
+    dbVersion = db.version;
+
+    db.createObjectStore("TestObjectStore");
+    
+    event.target._onsuccess_ = function() {
+        testGenerator = testSteps();
+        testGenerator.next();
+    };
+}
+
+// Some testing values borrowed from <root>/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb_binary_key_conversion.htm
+function* testSteps()
+{
+    binary = new ArrayBuffer(0);
+    key = IDBKeyRange.lowerBound(binary).lower;
+
+    shouldBeTrue("key instanceof ArrayBuffer");
+    shouldBe("key.byteLength", "0");
+    shouldBe("key.byteLength", "binary.byteLength");
+
+    // Key based on ArrayBuffer
+    binary = new ArrayBuffer(4);
+    dataView = new DataView(binary);
+    dataView.setUint32(0, 1234567890);
+    key = IDBKeyRange.lowerBound(binary).lower;
+
+    shouldBeTrue("key instanceof ArrayBuffer");
+    shouldBe("key.byteLength", "4");
+    shouldBe("dataView.getUint32(0)", "new DataView(key).getUint32(0)");
+
+    // Key based on DataView
+    binary = new ArrayBuffer(4);
+    dataView = new DataView(binary);
+    dataView.setUint32(0, 1234567890);
+    key = IDBKeyRange.lowerBound(dataView).lower;
+
+    shouldBeTrue("key instanceof ArrayBuffer");
+    shouldBe("key.byteLength", "4");
+    shouldBe("dataView.getUint32(0)", "new DataView(key).getUint32(0)");
+
+    // Typed array
+    binary = new ArrayBuffer(4);
+    dataView = new DataView(binary);
+    int8Array = new Int8Array(binary);
+    int8Array.set([16, -32, 64, -128]);
+
+    key = IDBKeyRange.lowerBound(int8Array).lower;
+    keyInInt8Array = new Int8Array(key);
+
+    shouldBeTrue("key instanceof ArrayBuffer");
+    shouldBe("key.byteLength", "4");
+    for (i = 0; i < int8Array.length; ++i) {
+        shouldBe("keyInInt8Array[i]", "int8Array[i]");
+    }
+
+    transaction = db.transaction("TestObjectStore", "readwrite");
+    objectStore = transaction.objectStore("TestObjectStore");
+    objectStore.put("Value", dataView)._onsuccess_ = next;
+    yield;
+
+	objectStore.openCursor()._onsuccess_ = function(event) {
+		debug("Got the key and value with a cursor");
+		key = event.target.result.key;
+	    keyInInt8Array = new Int8Array(key);
+
+    	shouldBeTrue("key instanceof ArrayBuffer");
+    	shouldBe("key.byteLength", "4");
+    	for (i = 0; i < int8Array.length; ++i) {
+        	shouldBe("keyInInt8Array[i]", "int8Array[i]");
+    	}
+
+		retrievedValue = event.target.result.value;
+		expectedValue = "Value"
+		shouldBe("retrievedValue", "expectedValue");
+		
+		next();
+	}
+	yield;
+
+    objectStore.get(dataView)._onsuccess_ = function(event) {
+        debug("Got the value with a DataView key: " + event.target.result);
+        next();
+    }
+    yield;
+
+    objectStore.get(binary)._onsuccess_ = function(event) {
+        debug("Got the value with an ArrayBuffer key: " + event.target.result);
+        next();
+    }
+    yield;
+
+    objectStore.get(int8Array)._onsuccess_ = function(event) {
+        debug("Got the value with a Typed Array key: " + event.target.result);
+        next();
+    }
+    yield;
+    
+    int8Array.set([10, 10, 10, 10]);
+    objectStore.get(int8Array)._onsuccess_ = function(event) {
+        debug("Got the value with a Typed Array key, but changed from the original put: " + event.target.result);
+        next();
+    }
+    yield;
+
+    finishJSTest();
+}
+

Modified: trunk/LayoutTests/storage/indexeddb/resources/factory-cmp.js (208348 => 208349)


--- trunk/LayoutTests/storage/indexeddb/resources/factory-cmp.js	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/storage/indexeddb/resources/factory-cmp.js	2016-11-03 21:47:21 UTC (rev 208349)
@@ -49,6 +49,15 @@
         "'\uD834\uDD1E'", // U+1D11E MUSICAL SYMBOL G-CLEF (UTF-16 surrogate pair)
         "'\uFFFD'", // U+FFFD REPLACEMENT CHARACTER
 
+        "new Uint8Array()",
+        "new Uint8Array([0])",
+        "new Uint8Array([0, 0])",
+        "new Uint8Array([0, 1])",
+        "new Uint8Array([1])",
+        "new Uint8Array([1, 0])",
+        "new Uint8Array([1, 1])",
+        "new Uint8Array([255])",
+
         "[]",
 
         "[-Infinity]",
@@ -77,6 +86,15 @@
         "['\uD834\uDD1E']", // U+1D11E MUSICAL SYMBOL G-CLEF (UTF-16 surrogate pair)
         "['\uFFFD']", // U+FFFD REPLACEMENT CHARACTER
 
+        "[new Uint8Array()]",
+        "[new Uint8Array([0])]",
+        "[new Uint8Array([0, 0])]",
+        "[new Uint8Array([0, 1])]",
+        "[new Uint8Array([1])]",
+        "[new Uint8Array([1, 0])]",
+        "[new Uint8Array([1, 1])]",
+        "[new Uint8Array([255])]",
+
         "[[]]",
 
         "[[], []]",
@@ -83,7 +101,7 @@
         "[[], [], []]",
 
         "[[[]]]",
-        "[[[[]]]]"
+        "[[[[]]]]",
     ];
 
     var i, key1, key2;
@@ -115,22 +133,6 @@
         "self",
         "self.document",
         "self.document.body",
-        "new Uint8Array()",
-        "new Uint8Array([0])",
-        "new Uint8Array([0, 0])",
-        "new Uint8Array([0, 1])",
-        "new Uint8Array([1])",
-        "new Uint8Array([1, 0])",
-        "new Uint8Array([1, 1])",
-        "new Uint8Array([255])",
-        "[new Uint8Array()]",
-        "[new Uint8Array([0])]",
-        "[new Uint8Array([0, 0])]",
-        "[new Uint8Array([0, 1])]",
-        "[new Uint8Array([1])]",
-        "[new Uint8Array([1, 0])]",
-        "[new Uint8Array([1, 1])]",
-        "[new Uint8Array([255])]",
     ];
 
     var i, key1, key2;

Modified: trunk/LayoutTests/storage/indexeddb/resources/key-type-binary.js (208348 => 208349)


--- trunk/LayoutTests/storage/indexeddb/resources/key-type-binary.js	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/LayoutTests/storage/indexeddb/resources/key-type-binary.js	2016-11-03 21:47:21 UTC (rev 208349)
@@ -5,7 +5,7 @@
 
 description("Test IndexedDB binary keys");
 
-indexedDBTest(prepareDatabase, testInvalidBinaryKeys1);
+indexedDBTest(prepareDatabase, testBinaryKeys1);
 function prepareDatabase()
 {
     db = event.target.result;
@@ -14,7 +14,7 @@
     debug("");
 }
 
-function testInvalidBinaryKeys1()
+function testBinaryKeys1()
 {
     preamble();
     evalAndLog("trans = db.transaction('store', 'readwrite')");
@@ -39,14 +39,14 @@
             key = cases.shift();
             value = n++;
             debug("");
-            evalAndExpectException("store.put(" + JSON.stringify(value) + ", new Uint8Array(" + key + "));", "0", "'DataError'");
+            evalAndLog("store.put(" + JSON.stringify(value) + ", new Uint8Array(" + key + "));");
         }
     }());
 
-    trans._oncomplete_ = testInvalidBinaryKeys2;
+    trans._oncomplete_ = testBinaryKeys2;
 }
 
-function testInvalidBinaryKeys2()
+function testBinaryKeys2()
 {
     preamble();
     evalAndLog("trans = db.transaction('store', 'readwrite')");
@@ -67,7 +67,7 @@
 
     cases.forEach(function(testCase) {
         debug("");
-        evalAndExpectException("store.put('value', " + testCase + ")", "0", "'DataError'");
+        evalAndLog("store.put('value', " + testCase + ")");
     });
 
     finishJSTest();

Modified: trunk/Source/WTF/ChangeLog (208348 => 208349)


--- trunk/Source/WTF/ChangeLog	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WTF/ChangeLog	2016-11-03 21:47:21 UTC (rev 208349)
@@ -1,3 +1,13 @@
+2016-11-03  Brady Eidson  <beid...@apple.com>
+
+        IndexedDB 2.0: Support binary keys.
+        <rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
+
+        Reviewed by Alex Christensen.
+
+        * wtf/Hasher.h:
+        (WTF::StringHasher::hashMemory): Teach hashMemory() to handle buffers with odd lengths.
+
 2016-11-02  Filip Pizlo  <fpi...@apple.com>
 
         The GC should be in a thread

Modified: trunk/Source/WTF/wtf/Hasher.h (208348 => 208349)


--- trunk/Source/WTF/wtf/Hasher.h	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WTF/wtf/Hasher.h	2016-11-03 21:47:21 UTC (rev 208349)
@@ -240,16 +240,18 @@
 
     static unsigned hashMemory(const void* data, unsigned length)
     {
-        // FIXME: Why does this function use the version of the hash that drops the top 8 bits?
-        // We want that for all string hashing so we can use those bits in StringImpl and hash
-        // strings consistently, but I don't see why we'd want that for general memory hashing.
-        ASSERT(!(length % 2));
-        return computeHashAndMaskTop8Bits<UChar>(static_cast<const UChar*>(data), length / sizeof(UChar));
+        size_t lengthInUChar = length / sizeof(UChar);
+        StringHasher hasher;
+        hasher.addCharactersAssumingAligned(static_cast<const UChar*>(data), lengthInUChar);
+
+        for (size_t i = 0; i < length % sizeof(UChar); ++i)
+            hasher.addCharacter(static_cast<const char*>(data)[lengthInUChar * sizeof(UChar) + i]);
+
+        return hasher.hash();
     }
 
     template<size_t length> static unsigned hashMemory(const void* data)
     {
-        static_assert(!(length % 2), "length must be a multiple of two!");
         return hashMemory(data, length);
     }
 

Modified: trunk/Source/WebCore/ChangeLog (208348 => 208349)


--- trunk/Source/WebCore/ChangeLog	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/ChangeLog	2016-11-03 21:47:21 UTC (rev 208349)
@@ -1,3 +1,49 @@
+2016-11-03  Brady Eidson  <beid...@apple.com>
+
+        IndexedDB 2.0: Support binary keys.
+        <rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
+
+        Reviewed by Alex Christensen.
+
+        Tests: storage/indexeddb/modern/binary-keys-1-private.html
+               storage/indexeddb/modern/binary-keys-1.html
+               Changes to other existing tests.
+
+        * Modules/indexeddb/IDBKey.cpp:
+        (WebCore::IDBKey::createBinary):
+        (WebCore::IDBKey::IDBKey):
+        (WebCore::IDBKey::compare):
+        * Modules/indexeddb/IDBKey.h:
+        (WebCore::IDBKey::binary):
+        (WebCore::compareBinaryKeyData):
+
+        * Modules/indexeddb/IDBKeyData.cpp:
+        (WebCore::IDBKeyData::IDBKeyData):
+        (WebCore::IDBKeyData::maybeCreateIDBKey):
+        (WebCore::IDBKeyData::isolatedCopy):
+        (WebCore::IDBKeyData::encode):
+        (WebCore::IDBKeyData::decode):
+        (WebCore::IDBKeyData::compare):
+        (WebCore::IDBKeyData::loggingString):
+        (WebCore::IDBKeyData::operator==):
+        * Modules/indexeddb/IDBKeyData.h:
+        (WebCore::IDBKeyData::hash):
+        (WebCore::IDBKeyData::encode):
+        (WebCore::IDBKeyData::decode):
+
+        * Modules/indexeddb/IndexedDB.h: Add new enum for the new key type.
+
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::toJS):
+        (WebCore::createIDBKeyFromValue):
+
+        * platform/ThreadSafeDataBuffer.h:
+        (WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
+        (WebCore::ThreadSafeDataBuffer::copyData):
+        (WebCore::ThreadSafeDataBuffer::size):
+        (WebCore::ThreadSafeDataBuffer::operator==):
+        (WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
+
 2016-11-03  Tim Horton  <timothy_hor...@apple.com>
 
         Printing to PDF should produce internal links when HTML has internal links

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp (208348 => 208349)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp	2016-11-03 21:47:21 UTC (rev 208349)
@@ -29,11 +29,32 @@
 #if ENABLE(INDEXED_DATABASE)
 
 #include "IDBKeyData.h"
+#include <runtime/ArrayBufferView.h>
+#include <runtime/JSArrayBuffer.h>
+#include <runtime/JSArrayBufferView.h>
+#include <runtime/JSCInlines.h>
 
 namespace WebCore {
 
 using IDBKeyVector = Vector<RefPtr<IDBKey>>;
 
+Ref<IDBKey> IDBKey::createBinary(const ThreadSafeDataBuffer& buffer)
+{
+    return adoptRef(*new IDBKey(buffer));
+}
+
+Ref<IDBKey> IDBKey::createBinary(JSC::JSArrayBuffer& arrayBuffer)
+{
+    auto* buffer = arrayBuffer.impl();
+    return adoptRef(*new IDBKey(ThreadSafeDataBuffer::copyData(buffer->data(), buffer->byteLength())));
+}
+
+Ref<IDBKey> IDBKey::createBinary(JSC::JSArrayBufferView& arrayBufferView)
+{
+    auto bufferView = arrayBufferView.possiblySharedImpl();
+    return adoptRef(*new IDBKey(ThreadSafeDataBuffer::copyData(bufferView->data(), bufferView->byteLength())));
+}
+
 IDBKey::IDBKey(KeyType type, double number)
     : m_type(type)
     , m_value(number)
@@ -55,6 +76,13 @@
 {
 }
 
+IDBKey::IDBKey(const ThreadSafeDataBuffer& buffer)
+    : m_type(KeyType::Binary)
+    , m_value(buffer)
+    , m_sizeEstimate(OverheadSize + buffer.size())
+{
+}
+
 IDBKey::~IDBKey()
 {
 }
@@ -93,6 +121,8 @@
             return 1;
         return 0;
     }
+    case KeyType::Binary:
+        return compareBinaryKeyData(WTF::get<ThreadSafeDataBuffer>(m_value), WTF::get<ThreadSafeDataBuffer>(other.m_value));
     case KeyType::String:
         return -codePointCompare(WTF::get<String>(other.m_value), WTF::get<String>(m_value));
     case KeyType::Date:

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.h (208348 => 208349)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.h	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.h	2016-11-03 21:47:21 UTC (rev 208349)
@@ -23,12 +23,12 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef IDBKey_h
-#define IDBKey_h
+#pragma once
 
 #if ENABLE(INDEXED_DATABASE)
 
 #include "IndexedDB.h"
+#include "ThreadSafeDataBuffer.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Variant.h>
@@ -37,6 +37,11 @@
 
 using WebCore::IndexedDB::KeyType;
 
+namespace JSC {
+class JSArrayBuffer;
+class JSArrayBufferView;
+}
+
 namespace WebCore {
 
 class IDBKey : public RefCounted<IDBKey> {
@@ -96,6 +101,10 @@
         return adoptRef(*new IDBKey(array, sizeEstimate));
     }
 
+    static Ref<IDBKey> createBinary(const ThreadSafeDataBuffer&);
+    static Ref<IDBKey> createBinary(JSC::JSArrayBuffer&);
+    static Ref<IDBKey> createBinary(JSC::JSArrayBufferView&);
+
     WEBCORE_EXPORT ~IDBKey();
 
     KeyType type() const { return m_type; }
@@ -125,6 +134,12 @@
         return WTF::get<double>(m_value);
     }
 
+    const ThreadSafeDataBuffer& binary() const
+    {
+        ASSERT(m_type == KeyType::Binary);
+        return WTF::get<ThreadSafeDataBuffer>(m_value);
+    }
+
     int compare(const IDBKey& other) const;
     bool isLessThan(const IDBKey& other) const;
     bool isEqual(const IDBKey& other) const;
@@ -153,9 +168,10 @@
     IDBKey(KeyType, double number);
     explicit IDBKey(const String& value);
     IDBKey(const Vector<RefPtr<IDBKey>>& keyArray, size_t arraySize);
+    explicit IDBKey(const ThreadSafeDataBuffer&);
 
     const KeyType m_type;
-    Variant<Vector<RefPtr<IDBKey>>, String, double> m_value;
+    Variant<Vector<RefPtr<IDBKey>>, String, double, ThreadSafeDataBuffer> m_value;
 
     const size_t m_sizeEstimate;
 
@@ -163,8 +179,43 @@
     enum { OverheadSize = 16 };
 };
 
+inline int compareBinaryKeyData(const Vector<uint8_t>& a, const Vector<uint8_t>& b)
+{
+    size_t length = std::min(a.size(), b.size());
+
+    for (size_t i = 0; i < length; ++i) {
+        if (a[i] > b[i])
+            return 1;
+        if (a[i] < b[i])
+            return -1;
+    }
+
+    if (a.size() == b.size())
+        return 0;
+
+    if (a.size() > b.size())
+        return 1;
+
+    return -1;
 }
 
+inline int compareBinaryKeyData(const ThreadSafeDataBuffer& a, const ThreadSafeDataBuffer& b)
+{
+    auto* aData = a.data();
+    auto* bData = b.data();
+
+    // Covers the cases where both pointers are null as well as both pointing to the same buffer.
+    if (aData == bData)
+        return 0;
+
+    if (aData && !bData)
+        return 1;
+    if (!aData && bData)
+        return -1;
+
+    return compareBinaryKeyData(*aData, *bData);
+}
+
+}
+
 #endif // ENABLE(INDEXED_DATABASE)
-
-#endif // IDBKey_h

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (208348 => 208349)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2016-11-03 21:47:21 UTC (rev 208349)
@@ -53,6 +53,9 @@
             array.append(IDBKeyData(key2.get()));
         break;
     }
+    case KeyType::Binary:
+        m_value = key->binary();
+        break;
     case KeyType::String:
         m_value = key->string();
         break;
@@ -84,6 +87,8 @@
         }
         return IDBKey::createArray(array);
     }
+    case KeyType::Binary:
+        return IDBKey::createBinary(WTF::get<ThreadSafeDataBuffer>(m_value));
     case KeyType::String:
         return IDBKey::createString(WTF::get<String>(m_value));
     case KeyType::Date:
@@ -125,6 +130,9 @@
             destinationArray.append(key.isolatedCopy());
         return;
     }
+    case KeyType::Binary:
+        destination.m_value = WTF::get<ThreadSafeDataBuffer>(source.m_value);
+        return;
     case KeyType::String:
         destination.m_value = WTF::get<String>(source.m_value).isolatedCopy();
         return;
@@ -158,6 +166,13 @@
         });
         return;
     }
+    case KeyType::Binary: {
+        auto* data = ""
+        encoder.encodeBool("hasBinary", !!data);
+        if (data)
+            encoder.encodeBytes("binary", data->data(), data->size());
+        return;
+    }
     case KeyType::String:
         encoder.encodeString("string", WTF::get<String>(m_value));
         return;
@@ -185,6 +200,7 @@
         return value == KeyType::Max
             || value == KeyType::Invalid
             || value == KeyType::Array
+            || value == KeyType::Binary
             || value == KeyType::String
             || value == KeyType::Date
             || value == KeyType::Number
@@ -212,6 +228,24 @@
         return decoder.decodeDouble("number", WTF::get<double>(result.m_value));
     }
 
+    if (result.m_type == KeyType::Binary) {
+        result.m_value = ThreadSafeDataBuffer();
+
+        bool hasBinaryData;
+        if (!decoder.decodeBool("hasBinary", hasBinaryData))
+            return false;
+
+        if (!hasBinaryData)
+            return true;
+
+        Vector<uint8_t> bytes;
+        if (!decoder.decodeBytes("binary", bytes))
+            return false;
+
+        result.m_value = ThreadSafeDataBuffer::adoptVector(bytes);
+        return true;
+    }
+
     ASSERT(result.m_type == KeyType::Array);
 
     auto arrayFunction = [](KeyedDecoder& decoder, IDBKeyData& result) {
@@ -255,6 +289,8 @@
             return 1;
         return 0;
     }
+    case KeyType::Binary:
+        return compareBinaryKeyData(WTF::get<ThreadSafeDataBuffer>(m_value), WTF::get<ThreadSafeDataBuffer>(other.m_value));
     case KeyType::String:
         return codePointCompare(WTF::get<String>(m_value), WTF::get<String>(other.m_value));
     case KeyType::Date:
@@ -299,6 +335,27 @@
         result = builder.toString();
         break;
     }
+    case KeyType::Binary: {
+        StringBuilder builder;
+        builder.append("<binary> - ");
+
+        auto* data = ""
+        if (!data) {
+            builder.append("(null)");
+            result = builder.toString();
+            break;
+        }
+
+        size_t i = 0;
+        for (; i < 8 && i < data->size(); ++i)
+            builder.append(String::format("%02x", data->at(i)));
+
+        if (data->size() > 8)
+            builder.append("...");
+
+        result = builder.toString();
+        break;
+    }
     case KeyType::String:
         result = "<string> - " + WTF::get<String>(m_value);
         break;
@@ -310,8 +367,6 @@
         return "<maximum>";
     case KeyType::Min:
         return "<minimum>";
-    default:
-        return String();
     }
 
     if (result.length() > 150) {
@@ -382,6 +437,8 @@
         return WTF::get<double>(m_value) == WTF::get<double>(other.m_value);
     case KeyType::String:
         return WTF::get<String>(m_value) == WTF::get<String>(other.m_value);
+    case KeyType::Binary:
+        return WTF::get<ThreadSafeDataBuffer>(m_value) == WTF::get<ThreadSafeDataBuffer>(other.m_value);
     case KeyType::Array:
         return WTF::get<Vector<IDBKeyData>>(m_value) == WTF::get<Vector<IDBKeyData>>(other.m_value);
     }

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h (208348 => 208349)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2016-11-03 21:47:21 UTC (rev 208349)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef IDBKeyData_h
-#define IDBKeyData_h
+#pragma once
 
 #if ENABLE(INDEXED_DATABASE)
 
@@ -120,6 +119,14 @@
         case KeyType::String:
             hashCodes.append(StringHash::hash(WTF::get<String>(m_value)));
             break;
+        case KeyType::Binary: {
+            auto* data = ""
+            if (!data)
+                hashCodes.append(0);
+            else
+                hashCodes.append(StringHasher::hashMemory(data->data(), data->size()));
+            break;
+        }
         case KeyType::Array:
             for (auto& key : WTF::get<Vector<IDBKeyData>>(m_value))
                 hashCodes.append(key.hash());
@@ -160,7 +167,7 @@
     static void isolatedCopy(const IDBKeyData& source, IDBKeyData& destination);
 
     KeyType m_type;
-    Variant<Vector<IDBKeyData>, String, double> m_value;
+    Variant<Vector<IDBKeyData>, String, double, ThreadSafeDataBuffer> m_value;
 
     bool m_isNull { false };
     bool m_isDeletedValue { false };
@@ -214,6 +221,9 @@
     case KeyType::Array:
         encoder << WTF::get<Vector<IDBKeyData>>(m_value);
         break;
+    case KeyType::Binary:
+        encoder << WTF::get<ThreadSafeDataBuffer>(m_value);
+        break;
     case KeyType::String:
         encoder << WTF::get<String>(m_value);
         break;
@@ -246,6 +256,11 @@
         if (!decoder.decode(WTF::get<Vector<IDBKeyData>>(keyData.m_value)))
             return false;
         break;
+    case KeyType::Binary:
+        keyData.m_value = ThreadSafeDataBuffer();
+        if (!decoder.decode(WTF::get<ThreadSafeDataBuffer>(keyData.m_value)))
+            return false;
+        break;
     case KeyType::String:
         keyData.m_value = String();
         if (!decoder.decode(WTF::get<String>(keyData.m_value)))
@@ -265,4 +280,3 @@
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBKeyData_h

Modified: trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h (208348 => 208349)


--- trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h	2016-11-03 21:47:21 UTC (rev 208349)
@@ -79,6 +79,7 @@
     Max = -1,
     Invalid = 0,
     Array,
+    Binary,
     String,
     Date,
     Number,

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (208348 => 208349)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-11-03 21:47:21 UTC (rev 208349)
@@ -45,6 +45,7 @@
 #include "SerializedScriptValue.h"
 #include "SharedBuffer.h"
 #include "ThreadSafeDataBuffer.h"
+#include <runtime/ArrayBuffer.h>
 #include <runtime/DateInstance.h>
 #include <runtime/ObjectConstructor.h>
 
@@ -104,6 +105,20 @@
             outArray->putDirectIndex(&state, i, toJS(state, globalObject, inArray.at(i).get()));
         return outArray;
     }
+    case KeyType::Binary: {
+        auto* data = ""
+        if (!data) {
+            ASSERT_NOT_REACHED();
+            return jsNull();
+        }
+
+        auto arrayBuffer = ArrayBuffer::create(data->data(), data->size());
+        Structure* structure = globalObject.arrayBufferStructure(arrayBuffer->sharingMode());
+        if (!structure)
+            return jsNull();
+
+        return JSArrayBuffer::create(state.vm(), structure, WTFMove(arrayBuffer));
+    }
     case KeyType::String:
         return jsStringWithCache(&state, key->string());
     case KeyType::Date:
@@ -163,6 +178,12 @@
             stack.removeLast();
             return IDBKey::createArray(subkeys);
         }
+
+        if (auto* arrayBuffer = jsDynamicCast<JSArrayBuffer*>(value))
+            return IDBKey::createBinary(*arrayBuffer);
+
+        if (auto* arrayBufferView = jsDynamicCast<JSArrayBufferView*>(value))
+            return IDBKey::createBinary(*arrayBufferView);
     }
     return nullptr;
 }

Modified: trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h (208348 => 208349)


--- trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h	2016-11-03 21:20:12 UTC (rev 208348)
+++ trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h	2016-11-03 21:47:21 UTC (rev 208349)
@@ -47,6 +47,12 @@
     {
     }
 
+    ThreadSafeDataBufferImpl(const void* data, unsigned length)
+        : m_data(length)
+    {
+        memcpy(m_data.data(), data, length);
+    }
+
     Vector<uint8_t> m_data;
 };
 
@@ -62,6 +68,11 @@
         return ThreadSafeDataBuffer(data);
     }
 
+    static ThreadSafeDataBuffer copyData(const void* data, unsigned length)
+    {
+        return ThreadSafeDataBuffer(data, length);
+    }
+
     ThreadSafeDataBuffer()
     {
     }
@@ -71,6 +82,19 @@
         return m_impl ? &m_impl->m_data : nullptr;
     }
 
+    size_t size() const
+    {
+        return m_impl ? m_impl->m_data.size() : 0;
+    }
+
+    bool operator==(const ThreadSafeDataBuffer& other) const
+    {
+        if (!m_impl)
+            return !other.m_impl;
+
+        return m_impl->m_data == other.m_impl->m_data;
+    }
+
     template<class Encoder> void encode(Encoder&) const;
     template<class Decoder> static bool decode(Decoder&, ThreadSafeDataBuffer&);
 
@@ -85,6 +109,11 @@
         m_impl = adoptRef(new ThreadSafeDataBufferImpl(data));
     }
 
+    explicit ThreadSafeDataBuffer(const void* data, unsigned length)
+    {
+        m_impl = adoptRef(new ThreadSafeDataBufferImpl(data, length));
+    }
+
     RefPtr<ThreadSafeDataBufferImpl> m_impl;
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to