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

Unified Diff: LayoutTests/storage/indexeddb/blob-basics-metadata-expected.txt

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
Index: LayoutTests/storage/indexeddb/blob-basics-metadata-expected.txt
diff --git a/LayoutTests/storage/indexeddb/blob-basics-metadata-expected.txt b/LayoutTests/storage/indexeddb/blob-basics-metadata-expected.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b9d3b31d89c89b127042b2547cf03878caefc6c1
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/blob-basics-metadata-expected.txt
@@ -0,0 +1,68 @@
+Confirm basic Blob/File/FileList functionality.
+
+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;
+
+dbname = "blob-basics-metadata.html"
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+store = db.createObjectStore('storeName')
+store.put('value', 'key')
+
+testBlob():
+PASS FileReader != null is true
+test_content = 'This is a test. This is only a test.'
+blob = new Blob([test_content])
+
+validateResult(blob):
+transaction = db.transaction('storeName', 'readwrite')
+store = transaction.objectStore('storeName')
+store.put(blob, 'blobkey')
+transaction = db.transaction('storeName', 'readwrite')
+store = transaction.objectStore('storeName')
+request = store.get('blobkey')
+PASS event.target.result.size == test_content.length is true
+
+testFile():
+file = fileInput.files[0]
+
+validateResult(file):
+transaction = db.transaction('storeName', 'readwrite')
+store = transaction.objectStore('storeName')
+store.put(file, 'filekey')
+transaction = db.transaction('storeName', 'readwrite')
+store = transaction.objectStore('storeName')
+request = store.get('filekey')
+PASS event.target.result.name == fileInput.files[0].name is true
+
+testFileList():
+filelist = fileInput.files
+
+validateResult(filelist):
+transaction = db.transaction('storeName', 'readwrite')
+store = transaction.objectStore('storeName')
+store.put(filelist, 'filelistkey')
+transaction = db.transaction('storeName', 'readwrite')
+store = transaction.objectStore('storeName')
+request = store.get('filelistkey')
+PASS event.target.result[1].name == fileInput.files[1].name is true
+
+testCursor():
+transaction = db.transaction('storeName', 'readonly')
+store = transaction.objectStore('storeName')
+request = store.openCursor()
+PASS cursor.value.size == test_content.length is true
+cursor.continue();
+PASS cursor.value.name == fileInput.files[0].name is true
+cursor.continue();
+PASS cursor.value[1].name == fileInput.files[1].name is true
+cursor.continue();
+PASS cursor.value == 'value' is true
+cursor.continue();
+PASS cursor is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
« no previous file with comments | « LayoutTests/storage/indexeddb/blob-basics-metadata.html ('k') | LayoutTests/storage/indexeddb/blob-delete-objectstore-db.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698