Home | History | Annotate | Download | only in domstorage
      1 Test some corner case DOM Storage values.
      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 
     10 PASS typeof storage['foo'] is "undefined"
     11 PASS storage['foo'] is undefined.
     12 PASS typeof storage.foo is "undefined"
     13 PASS storage.foo is undefined.
     14 PASS typeof storage.getItem('foo') is "object"
     15 PASS storage.getItem('foo') is null
     16 
     17 storage.foo1 = null
     18 PASS typeof storage['foo1'] is "string"
     19 PASS storage['foo1'] is "null"
     20 PASS typeof storage.foo1 is "string"
     21 PASS storage.foo1 is "null"
     22 PASS typeof storage.getItem('foo1') is "string"
     23 PASS storage.getItem('foo1') is "null"
     24 storage['foo2'] = null
     25 PASS typeof storage['foo2'] is "string"
     26 PASS storage['foo2'] is "null"
     27 PASS typeof storage.foo2 is "string"
     28 PASS storage.foo2 is "null"
     29 PASS typeof storage.getItem('foo2') is "string"
     30 PASS storage.getItem('foo2') is "null"
     31 storage.setItem('foo3', null)
     32 PASS typeof storage['foo3'] is "string"
     33 PASS storage['foo3'] is "null"
     34 PASS typeof storage.foo3 is "string"
     35 PASS storage.foo3 is "null"
     36 PASS typeof storage.getItem('foo3') is "string"
     37 PASS storage.getItem('foo3') is "null"
     38 
     39 storage.foo4 = undefined
     40 PASS typeof storage['foo4'] is "string"
     41 PASS storage['foo4'] is "undefined"
     42 PASS typeof storage.foo4 is "string"
     43 PASS storage.foo4 is "undefined"
     44 PASS typeof storage.getItem('foo4') is "string"
     45 PASS storage.getItem('foo4') is "undefined"
     46 storage['foo5'] = undefined
     47 PASS typeof storage['foo5'] is "string"
     48 PASS storage['foo5'] is "undefined"
     49 PASS typeof storage.foo5 is "string"
     50 PASS storage.foo5 is "undefined"
     51 PASS typeof storage.getItem('foo5') is "string"
     52 PASS storage.getItem('foo5') is "undefined"
     53 storage.setItem('foo6', undefined)
     54 PASS typeof storage['foo6'] is "string"
     55 PASS storage['foo6'] is "undefined"
     56 PASS typeof storage.foo6 is "string"
     57 PASS storage.foo6 is "undefined"
     58 PASS typeof storage.getItem('foo6') is "string"
     59 PASS storage.getItem('foo6') is "undefined"
     60 
     61 storage.foo7 = 2
     62 PASS typeof storage['foo7'] is "string"
     63 PASS storage['foo7'] is "2"
     64 PASS typeof storage.foo7 is "string"
     65 PASS storage.foo7 is "2"
     66 PASS typeof storage.getItem('foo7') is "string"
     67 PASS storage.getItem('foo7') is "2"
     68 storage['foo8'] = 2
     69 PASS typeof storage['foo8'] is "string"
     70 PASS storage['foo8'] is "2"
     71 PASS typeof storage.foo8 is "string"
     72 PASS storage.foo8 is "2"
     73 PASS typeof storage.getItem('foo8') is "string"
     74 PASS storage.getItem('foo8') is "2"
     75 storage.setItem('foo9', 2)
     76 PASS typeof storage['foo9'] is "string"
     77 PASS storage['foo9'] is "2"
     78 PASS typeof storage.foo9 is "string"
     79 PASS storage.foo9 is "2"
     80 PASS typeof storage.getItem('foo9') is "string"
     81 PASS storage.getItem('foo9') is "2"
     82 
     83 storage.foo10 = k
     84 PASS typeof storage['foo10'] is "string"
     85 PASS storage['foo10'] is "\0hello"
     86 PASS typeof storage.foo10 is "string"
     87 PASS storage.foo10 is "\0hello"
     88 PASS typeof storage.getItem('foo10') is "string"
     89 PASS storage.getItem('foo10') is "\0hello"
     90 storage['foo11'] = k
     91 PASS typeof storage['foo11'] is "string"
     92 PASS storage['foo11'] is "\0hello"
     93 PASS typeof storage.foo11 is "string"
     94 PASS storage.foo11 is "\0hello"
     95 PASS typeof storage.getItem('foo11') is "string"
     96 PASS storage.getItem('foo11') is "\0hello"
     97 storage.setItem('foo12', k)
     98 PASS typeof storage['foo12'] is "string"
     99 PASS storage['foo12'] is "\0hello"
    100 PASS typeof storage.foo12 is "string"
    101 PASS storage.foo12 is "\0hello"
    102 PASS typeof storage.getItem('foo12') is "string"
    103 PASS storage.getItem('foo12') is "\0hello"
    104 
    105 
    106 Testing localStorage
    107 storage.clear()
    108 PASS storage.length is 0
    109 
    110 PASS typeof storage['foo'] is "undefined"
    111 PASS storage['foo'] is undefined.
    112 PASS typeof storage.foo is "undefined"
    113 PASS storage.foo is undefined.
    114 PASS typeof storage.getItem('foo') is "object"
    115 PASS storage.getItem('foo') is null
    116 
    117 storage.foo1 = null
    118 PASS typeof storage['foo1'] is "string"
    119 PASS storage['foo1'] is "null"
    120 PASS typeof storage.foo1 is "string"
    121 PASS storage.foo1 is "null"
    122 PASS typeof storage.getItem('foo1') is "string"
    123 PASS storage.getItem('foo1') is "null"
    124 storage['foo2'] = null
    125 PASS typeof storage['foo2'] is "string"
    126 PASS storage['foo2'] is "null"
    127 PASS typeof storage.foo2 is "string"
    128 PASS storage.foo2 is "null"
    129 PASS typeof storage.getItem('foo2') is "string"
    130 PASS storage.getItem('foo2') is "null"
    131 storage.setItem('foo3', null)
    132 PASS typeof storage['foo3'] is "string"
    133 PASS storage['foo3'] is "null"
    134 PASS typeof storage.foo3 is "string"
    135 PASS storage.foo3 is "null"
    136 PASS typeof storage.getItem('foo3') is "string"
    137 PASS storage.getItem('foo3') is "null"
    138 
    139 storage.foo4 = undefined
    140 PASS typeof storage['foo4'] is "string"
    141 PASS storage['foo4'] is "undefined"
    142 PASS typeof storage.foo4 is "string"
    143 PASS storage.foo4 is "undefined"
    144 PASS typeof storage.getItem('foo4') is "string"
    145 PASS storage.getItem('foo4') is "undefined"
    146 storage['foo5'] = undefined
    147 PASS typeof storage['foo5'] is "string"
    148 PASS storage['foo5'] is "undefined"
    149 PASS typeof storage.foo5 is "string"
    150 PASS storage.foo5 is "undefined"
    151 PASS typeof storage.getItem('foo5') is "string"
    152 PASS storage.getItem('foo5') is "undefined"
    153 storage.setItem('foo6', undefined)
    154 PASS typeof storage['foo6'] is "string"
    155 PASS storage['foo6'] is "undefined"
    156 PASS typeof storage.foo6 is "string"
    157 PASS storage.foo6 is "undefined"
    158 PASS typeof storage.getItem('foo6') is "string"
    159 PASS storage.getItem('foo6') is "undefined"
    160 
    161 storage.foo7 = 2
    162 PASS typeof storage['foo7'] is "string"
    163 PASS storage['foo7'] is "2"
    164 PASS typeof storage.foo7 is "string"
    165 PASS storage.foo7 is "2"
    166 PASS typeof storage.getItem('foo7') is "string"
    167 PASS storage.getItem('foo7') is "2"
    168 storage['foo8'] = 2
    169 PASS typeof storage['foo8'] is "string"
    170 PASS storage['foo8'] is "2"
    171 PASS typeof storage.foo8 is "string"
    172 PASS storage.foo8 is "2"
    173 PASS typeof storage.getItem('foo8') is "string"
    174 PASS storage.getItem('foo8') is "2"
    175 storage.setItem('foo9', 2)
    176 PASS typeof storage['foo9'] is "string"
    177 PASS storage['foo9'] is "2"
    178 PASS typeof storage.foo9 is "string"
    179 PASS storage.foo9 is "2"
    180 PASS typeof storage.getItem('foo9') is "string"
    181 PASS storage.getItem('foo9') is "2"
    182 
    183 storage.foo10 = k
    184 PASS typeof storage['foo10'] is "string"
    185 PASS storage['foo10'] is "\0hello"
    186 PASS typeof storage.foo10 is "string"
    187 PASS storage.foo10 is "\0hello"
    188 PASS typeof storage.getItem('foo10') is "string"
    189 PASS storage.getItem('foo10') is "\0hello"
    190 storage['foo11'] = k
    191 PASS typeof storage['foo11'] is "string"
    192 PASS storage['foo11'] is "\0hello"
    193 PASS typeof storage.foo11 is "string"
    194 PASS storage.foo11 is "\0hello"
    195 PASS typeof storage.getItem('foo11') is "string"
    196 PASS storage.getItem('foo11') is "\0hello"
    197 storage.setItem('foo12', k)
    198 PASS typeof storage['foo12'] is "string"
    199 PASS storage['foo12'] is "\0hello"
    200 PASS typeof storage.foo12 is "string"
    201 PASS storage.foo12 is "\0hello"
    202 PASS typeof storage.getItem('foo12') is "string"
    203 PASS storage.getItem('foo12') is "\0hello"
    204 PASS successfullyParsed is true
    205 
    206 TEST COMPLETE
    207 
    208