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

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

Issue 433983002: LayoutTests for writing empty Blob/File/FileList to IndexedDB. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated test expectations to match ToT. Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 Confirm basic Blob/File/FileList functionality. 1 Confirm basic Blob/File/FileList functionality.
2 2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ". 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ".
4 4
5 5
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self. msIndexedDB || self.OIndexedDB; 6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self. msIndexedDB || self.OIndexedDB;
7 7
8 dbname = "blob-basics-metadata.html" 8 dbname = "blob-basics-metadata.html"
9 indexedDB.deleteDatabase(dbname) 9 indexedDB.deleteDatabase(dbname)
10 indexedDB.open(dbname) 10 indexedDB.open(dbname)
11 store = db.createObjectStore('storeName') 11 store = db.createObjectStore('storeName')
12 store.put('value', 'key') 12 store.put('value', 'key')
13 13
14 testBlob(): 14 testBlob():
15 PASS FileReader != null is true 15 PASS FileReader != null is true
16 test_content = 'This is a test. This is only a test.' 16 test_content = 'This is a test. This is only a test.'
17 blob = new Blob([test_content]) 17 blob = new Blob([test_content])
18 18
19 validateResult(blob): 19 validateResult(blob):
20 PASS blob.size == test_content.length is true
20 transaction = db.transaction('storeName', 'readwrite') 21 transaction = db.transaction('storeName', 'readwrite')
21 store = transaction.objectStore('storeName') 22 store = transaction.objectStore('storeName')
22 store.put(blob, 'blobkey') 23 store.put(blob, 'blobkey')
23 transaction = db.transaction('storeName', 'readwrite') 24 transaction = db.transaction('storeName', 'readwrite')
24 store = transaction.objectStore('storeName') 25 store = transaction.objectStore('storeName')
25 request = store.get('blobkey') 26 request = store.get('blobkey')
26 PASS event.target.result.size == test_content.length is true 27 PASS event.target.result.size == test_content.length is true
27 28
28 testFile(): 29 testFile():
29 file = fileInput.files[0] 30 file = fileInput.files[0]
30 31
31 validateResult(file): 32 validateResult(file):
33 PASS file.name == fileInput.files[0].name is true
32 transaction = db.transaction('storeName', 'readwrite') 34 transaction = db.transaction('storeName', 'readwrite')
33 store = transaction.objectStore('storeName') 35 store = transaction.objectStore('storeName')
34 store.put(file, 'filekey') 36 store.put(file, 'filekey')
35 transaction = db.transaction('storeName', 'readwrite') 37 transaction = db.transaction('storeName', 'readwrite')
36 store = transaction.objectStore('storeName') 38 store = transaction.objectStore('storeName')
37 request = store.get('filekey') 39 request = store.get('filekey')
38 PASS event.target.result.name == fileInput.files[0].name is true 40 PASS event.target.result.name == fileInput.files[0].name is true
39 41
40 testNewFile(): 42 testNewFile():
41 newFile = new File([test_content], 'filename', {type:'text/plain'}) 43 newFile = new File([test_content], 'filename', {type:'text/plain'})
42 44
43 validateResult(newFile): 45 validateResult(newFile):
46 PASS newFile.name == newFile.name is true
44 transaction = db.transaction('storeName', 'readwrite') 47 transaction = db.transaction('storeName', 'readwrite')
45 store = transaction.objectStore('storeName') 48 store = transaction.objectStore('storeName')
46 store.put(newFile, 'newFilekey') 49 store.put(newFile, 'newFilekey')
47 transaction = db.transaction('storeName', 'readwrite') 50 transaction = db.transaction('storeName', 'readwrite')
48 store = transaction.objectStore('storeName') 51 store = transaction.objectStore('storeName')
49 request = store.get('newFilekey') 52 request = store.get('newFilekey')
50 PASS event.target.result.name == newFile.name is true 53 PASS event.target.result.name == newFile.name is true
51 54
52 testFileList(): 55 testFileList():
53 filelist = fileInput.files 56 filelist = fileInput.files
54 57
55 validateResult(filelist): 58 validateResult(filelist):
59 PASS filelist[1].name == fileInput.files[1].name is true
56 transaction = db.transaction('storeName', 'readwrite') 60 transaction = db.transaction('storeName', 'readwrite')
57 store = transaction.objectStore('storeName') 61 store = transaction.objectStore('storeName')
58 store.put(filelist, 'filelistkey') 62 store.put(filelist, 'filelistkey')
59 transaction = db.transaction('storeName', 'readwrite') 63 transaction = db.transaction('storeName', 'readwrite')
60 store = transaction.objectStore('storeName') 64 store = transaction.objectStore('storeName')
61 request = store.get('filelistkey') 65 request = store.get('filelistkey')
62 PASS event.target.result[1].name == fileInput.files[1].name is true 66 PASS event.target.result[1].name == fileInput.files[1].name is true
63 67
64 testCursor(): 68 testCursor():
65 transaction = db.transaction('storeName', 'readonly') 69 transaction = db.transaction('storeName', 'readonly')
66 store = transaction.objectStore('storeName') 70 store = transaction.objectStore('storeName')
67 request = store.openCursor() 71 request = store.openCursor()
68 PASS cursor.value.size == test_content.length is true 72 PASS cursor.value.size == test_content.length is true
69 cursor.continue(); 73 cursor.continue();
70 PASS cursor.value.name == fileInput.files[0].name is true 74 PASS cursor.value.name == fileInput.files[0].name is true
71 cursor.continue(); 75 cursor.continue();
72 PASS cursor.value[1].name == fileInput.files[1].name is true 76 PASS cursor.value[1].name == fileInput.files[1].name is true
73 cursor.continue(); 77 cursor.continue();
74 PASS cursor.value == 'value' is true 78 PASS cursor.value == 'value' is true
75 cursor.continue(); 79 cursor.continue();
76 PASS cursor.value.name == newFile.name is true 80 PASS cursor.value.name == newFile.name is true
77 cursor.continue(); 81 cursor.continue();
78 PASS cursor is null 82 PASS cursor is null
79 PASS successfullyParsed is true 83 PASS successfullyParsed is true
80 84
81 TEST COMPLETE 85 TEST COMPLETE
82 86
OLDNEW
« no previous file with comments | « LayoutTests/storage/indexeddb/blob-basics-metadata.html ('k') | LayoutTests/storage/indexeddb/empty-blob-file.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698