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

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: aaaaaaaand one more nit. Created 6 years, 6 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
« no previous file with comments | « LayoutTests/storage/indexeddb/noblobs-expected.txt ('k') | Source/bindings/v8/SerializedScriptValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
}
}
« no previous file with comments | « LayoutTests/storage/indexeddb/noblobs-expected.txt ('k') | Source/bindings/v8/SerializedScriptValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698