1 4 open connections try to setVersion at the same time. 3 connections eventually close, allowing 1 setVersion call to proceed. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6 PASS IndexedDB == null is false 7 IndexedDB.open('set-version-queue') 8 IndexedDB.open('set-version-queue') 9 IndexedDB.open('set-version-queue') 10 IndexedDB.open('set-version-queue') 11 connections[0].setVersion('version 0') 12 connections[1].setVersion('version 1') 13 connections[2].setVersion('version 2') 14 connections[3].setVersion('version 3') 15 16 PASS event.version.length > 0 is true 17 connection[1] received versionChangeEvent: version 0 18 PASS event.version.length > 0 is true 19 connection[2] received versionChangeEvent: version 0 20 PASS event.version.length > 0 is true 21 connection[3] received versionChangeEvent: version 0 22 23 PASS connection[0] got blocked event 24 PASS event.version is "version 0" 25 Close the connection that received the block event: 26 connections[0].close() 27 Close another connection as well, to test 4.7.4-note: 28 connections[3].close() 29 blocked0fired = true 30 31 PASS event.version.length > 0 is true 32 connection[2] received versionChangeEvent: version 1 33 34 PASS connection[1] got blocked event 35 Ensure that this blocked event is in order: 36 PASS blocked0fired is true 37 PASS blocked2fired is false 38 39 PASS event.version.length > 0 is true 40 connection[1] received versionChangeEvent: version 2 41 42 PASS connection[2] got blocked event 43 PASS event.version is "version 2" 44 connections[2].close() 45 blocked2fired = true 46 47 PASS event.version.length > 0 is true 48 connection[1] received versionChangeEvent: version 3 49 50 PASS connection[3] got blocked event 51 Note: This means that a connection can receive a blocked event after its close() method has been called. Spec is silent on the issue and this is easiest to implement. 52 PASS event.version is "version 3" 53 54 PASS connection[0] got error event 55 PASS event.target.errorCode is 13 56 PASS event.target.webkitErrorMessage.length > 0 is true 57 Connection was closed before set version transaction was created 58 59 PASS connection[2] got error event 60 PASS event.target.errorCode is 13 61 PASS event.target.webkitErrorMessage.length > 0 is true 62 Connection was closed before set version transaction was created 63 64 PASS connection[3] got error event 65 PASS event.target.errorCode is 13 66 PASS event.target.webkitErrorMessage.length > 0 is true 67 Connection was closed before set version transaction was created 68 69 PASS connection[1] got into SetVersion 70 PASS successfullyParsed is true 71 72 TEST COMPLETE 73 74