Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js

Issue 18590006: Blob support for IDB [Blink] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebasing issue? Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698