Index: LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js |
diff --git a/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js b/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js |
index 76a5c2f2012f3f4d812669b67ea590ec52744850..68dfa4be41bdbecd02b585c1086436ca13216ed3 100644 |
--- a/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js |
+++ b/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js |
@@ -13,12 +13,13 @@ function prepareDatabase() |
evalAndLog("store = db.createObjectStore('store', {keyPath: 'id'})"); |
evalAndLog("store.createIndex('string length', 'string.length')"); |
evalAndLog("store.createIndex('array length', 'array.length')"); |
+ evalAndLog("store.createIndex('blob size', 'blob.size')"); |
+ evalAndLog("store.createIndex('blob type', 'blob.type')"); |
} |
function testKeyPaths() |
{ |
- debug(""); |
- debug("testKeyPaths():"); |
+ preamble(); |
transaction = evalAndLog("transaction = db.transaction('store', 'readwrite')"); |
transaction.onabort = unexpectedAbortCallback; |
@@ -28,9 +29,11 @@ function testKeyPaths() |
var datum = { |
id: 'id#' + i, |
string: Array(i * 2 + 1).join('x'), |
- array: Array(i * 3 + 1).join('x').split(/(?:)/) |
+ array: Array(i * 3 + 1).join('x').split(/(?:)/), |
+ blob: new Blob([Array(i * 4 + 1).join('x')], {type: "type " + i}) |
}; |
- evalAndLog("store.put("+JSON.stringify(datum)+")"); |
+ debug("store.put(" + JSON.stringify(datum) + ")"); |
+ store.put(datum); |
} |
checkStringLengths(); |
@@ -57,6 +60,34 @@ function testKeyPaths() |
if (cursor) { |
shouldBe("cursor.key", "cursor.value.array.length"); |
cursor.continue(); |
+ } else { |
+ checkBlobSizes(); |
+ } |
+ } |
+ } |
+ |
+ function checkBlobSizes() { |
+ evalAndLog("request = store.index('blob size').openCursor()"); |
+ request.onerror = unexpectedErrorCallback; |
+ request.onsuccess = function (e) { |
+ cursor = e.target.result; |
+ if (cursor) { |
+ shouldBe("cursor.key", "cursor.value.blob.size"); |
+ cursor.continue(); |
+ } else { |
+ checkBlobTypes(); |
+ } |
+ } |
+ } |
+ |
+ function checkBlobTypes() { |
+ evalAndLog("request = store.index('blob type').openCursor()"); |
+ request.onerror = unexpectedErrorCallback; |
+ request.onsuccess = function (e) { |
+ cursor = e.target.result; |
+ if (cursor) { |
+ shouldBe("cursor.key", "cursor.value.blob.type"); |
+ cursor.continue(); |
} |
} |
} |