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..2fc5b4538f70f11d0119b77344492ab29d2ec46d 100644 |
--- a/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js |
+++ b/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js |
@@ -13,6 +13,7 @@ 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')"); |
jsbell
2014/05/29 00:40:06
The IDB spec also has Blob.size, File.name and Fil
ericu
2014/06/02 22:18:47
I added Blob.type. File.name and File.lastModified
jsbell
2014/06/02 23:05:06
If there's no special work being done, I'm fine wi
|
} |
function testKeyPaths() |
@@ -28,7 +29,8 @@ 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')]) |
}; |
evalAndLog("store.put("+JSON.stringify(datum)+")"); |
jsbell
2014/05/29 00:40:06
Note that the put() call is being constructed from
ericu
2014/06/02 22:18:47
Ah, good catch--I missed that. Array makes the tr
|
} |
@@ -57,6 +59,20 @@ 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(); |
} |
} |
} |