Home | History | Annotate | Download | only in events
      1 This is a test to make sure DOM Storage mutations fire StorageEvents that are caught by the event listener specified as an attribute on the body.
      2 
      3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
      4 
      5 
      6 Testing sessionStorage
      7 storage.clear()
      8 PASS storage.length is 0
      9 iframe.onload = step1
     10 iframe.src = 'resources/body-event-handler.html'
     11 Reset storage event list
     12 storageEventList = new Array()
     13 storage.setItem('FOO', 'BAR')
     14 PASS storageEventList.length is 1
     15 PASS storageEventList[0].key is "FOO"
     16 PASS storageEventList[0].oldValue is null
     17 PASS storageEventList[0].newValue is "BAR"
     18 storage.setItem('FU', 'BAR')
     19 storage.setItem('a', '1')
     20 storage.setItem('b', '2')
     21 storage.setItem('b', '3')
     22 PASS storageEventList.length is 5
     23 PASS storageEventList[1].key is "FU"
     24 PASS storageEventList[1].oldValue is null
     25 PASS storageEventList[1].newValue is "BAR"
     26 PASS storageEventList[2].key is "a"
     27 PASS storageEventList[2].oldValue is null
     28 PASS storageEventList[2].newValue is "1"
     29 PASS storageEventList[3].key is "b"
     30 PASS storageEventList[3].oldValue is null
     31 PASS storageEventList[3].newValue is "2"
     32 PASS storageEventList[4].key is "b"
     33 PASS storageEventList[4].oldValue is "2"
     34 PASS storageEventList[4].newValue is "3"
     35 storage.removeItem('FOO')
     36 PASS storageEventList.length is 6
     37 PASS storageEventList[5].key is "FOO"
     38 PASS storageEventList[5].oldValue is "BAR"
     39 PASS storageEventList[5].newValue is null
     40 storage.removeItem('FU')
     41 PASS storageEventList.length is 7
     42 PASS storageEventList[6].key is "FU"
     43 PASS storageEventList[6].oldValue is "BAR"
     44 PASS storageEventList[6].newValue is null
     45 storage.clear()
     46 PASS storageEventList.length is 8
     47 PASS storageEventList[7].key is null
     48 PASS storageEventList[7].oldValue is null
     49 PASS storageEventList[7].newValue is null
     50 
     51 
     52 Testing localStorage
     53 storage.clear()
     54 PASS storage.length is 0
     55 iframe.onload = step1
     56 iframe.src = 'resources/body-event-handler.html'
     57 Reset storage event list
     58 storageEventList = new Array()
     59 storage.setItem('FOO', 'BAR')
     60 PASS storageEventList.length is 1
     61 PASS storageEventList[0].key is "FOO"
     62 PASS storageEventList[0].oldValue is null
     63 PASS storageEventList[0].newValue is "BAR"
     64 storage.setItem('FU', 'BAR')
     65 storage.setItem('a', '1')
     66 storage.setItem('b', '2')
     67 storage.setItem('b', '3')
     68 PASS storageEventList.length is 5
     69 PASS storageEventList[1].key is "FU"
     70 PASS storageEventList[1].oldValue is null
     71 PASS storageEventList[1].newValue is "BAR"
     72 PASS storageEventList[2].key is "a"
     73 PASS storageEventList[2].oldValue is null
     74 PASS storageEventList[2].newValue is "1"
     75 PASS storageEventList[3].key is "b"
     76 PASS storageEventList[3].oldValue is null
     77 PASS storageEventList[3].newValue is "2"
     78 PASS storageEventList[4].key is "b"
     79 PASS storageEventList[4].oldValue is "2"
     80 PASS storageEventList[4].newValue is "3"
     81 storage.removeItem('FOO')
     82 PASS storageEventList.length is 6
     83 PASS storageEventList[5].key is "FOO"
     84 PASS storageEventList[5].oldValue is "BAR"
     85 PASS storageEventList[5].newValue is null
     86 storage.removeItem('FU')
     87 PASS storageEventList.length is 7
     88 PASS storageEventList[6].key is "FU"
     89 PASS storageEventList[6].oldValue is "BAR"
     90 PASS storageEventList[6].newValue is null
     91 storage.clear()
     92 PASS storageEventList.length is 8
     93 PASS storageEventList[7].key is null
     94 PASS storageEventList[7].oldValue is null
     95 PASS storageEventList[7].newValue is null
     96 
     97 
     98 PASS successfullyParsed is true
     99 
    100 TEST COMPLETE
    101 
    102 
    103