summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/complex-keys-expected.txt
blob: 4ff0d294c4a4462f6a38cd07bf3720f21965afe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
Test dom storage with many different types of keys (as opposed to values)

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


Testing sessionStorage
storage.clear()
PASS storage.length is 0

PASS storage.getItem('FOO') is null
storage.setItem('FOO', 'BAR')
PASS storage.length is 1
PASS storage.getItem('FOO') is "BAR"
PASS storage.getItem('foo') is null
PASS storage.foo is undefined.
PASS storage['foo'] is undefined.
storage.foo = 'x'
PASS storage.foo is "x"
PASS storage['foo'] is "x"
PASS storage.getItem('foo') is "x"
storage['foo'] = 'y'
PASS storage.foo is "y"
PASS storage['foo'] is "y"
PASS storage.getItem('foo') is "y"
storage.setItem('foo', 'z')
PASS storage.foo is "z"
PASS storage['foo'] is "z"
PASS storage.getItem('foo') is "z"
PASS storage.length is 2

Testing a null key
storage.setItem(null, 'asdf')
PASS storage.getItem('null') is "asdf"
PASS storage.getItem(null) is "asdf"
PASS storage['null'] is "asdf"
PASS storage[null] is "asdf"
PASS storage.length is 3
storage[null] = 1
PASS storage.getItem(null) is "1"
storage['null'] = 2
PASS storage.getItem(null) is "2"
storage.setItem('null', 3)
PASS storage.getItem(null) is "3"
PASS storage.length is 3

Testing an undefined key
storage[undefined] = 'xyz'
PASS storage.getItem('undefined') is "xyz"
PASS storage.getItem(undefined) is "xyz"
PASS storage['undefined'] is "xyz"
PASS storage[undefined] is "xyz"
PASS storage.length is 4
storage['undefined'] = 4
PASS storage.getItem(undefined) is "4"
storage.setItem(undefined, 5)
PASS storage.getItem(undefined) is "5"
storage.setItem('undefined', 6)
PASS storage.getItem(undefined) is "6"
PASS storage.length is 4

Testing a numeric key
storage['2'] = 'ppp'
PASS storage.getItem('2') is "ppp"
PASS storage.getItem(2) is "ppp"
PASS storage['2'] is "ppp"
PASS storage[2] is "ppp"
PASS storage.length is 5
storage[2] = 7
PASS storage.getItem(2) is "7"
storage.setItem(2, 8)
PASS storage.getItem(2) is "8"
storage.setItem('2', 9)
PASS storage.getItem(2) is "9"
PASS storage.length is 5

Setting a non-ascii string to foo
storage[k] = 'hello'
PASS storage.getItem(k) is "hello"
PASS storage[k] is "hello"
PASS storage.length is 6

Testing case differences
storage.foo1 = 'lower1'
storage.FOO1 = 'UPPER1'
storage['foo2'] = 'lower2'
storage['FOO2'] = 'UPPER2'
storage.setItem('foo3', 'lower3')
storage.setItem('FOO3', 'UPPER3')
PASS storage.foo1 is "lower1"
PASS storage.FOO1 is "UPPER1"
PASS storage['foo2'] is "lower2"
PASS storage['FOO2'] is "UPPER2"
PASS storage.getItem('foo3') is "lower3"
PASS storage.getItem('FOO3') is "UPPER3"
PASS storage.length is 12

Testing overriding length
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage.length = 0
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage['length'] = 0
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage.setItem('length', 0)
PASS storage.length is 13
PASS storage['length'] is 13
PASS storage.getItem('length') is "0"
storage.removeItem('length')
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage.setItem('length', 0)
PASS storage.length is 13


Testing localStorage
storage.clear()
PASS storage.length is 0

PASS storage.getItem('FOO') is null
storage.setItem('FOO', 'BAR')
PASS storage.length is 1
PASS storage.getItem('FOO') is "BAR"
PASS storage.getItem('foo') is null
PASS storage.foo is undefined.
PASS storage['foo'] is undefined.
storage.foo = 'x'
PASS storage.foo is "x"
PASS storage['foo'] is "x"
PASS storage.getItem('foo') is "x"
storage['foo'] = 'y'
PASS storage.foo is "y"
PASS storage['foo'] is "y"
PASS storage.getItem('foo') is "y"
storage.setItem('foo', 'z')
PASS storage.foo is "z"
PASS storage['foo'] is "z"
PASS storage.getItem('foo') is "z"
PASS storage.length is 2

Testing a null key
storage.setItem(null, 'asdf')
PASS storage.getItem('null') is "asdf"
PASS storage.getItem(null) is "asdf"
PASS storage['null'] is "asdf"
PASS storage[null] is "asdf"
PASS storage.length is 3
storage[null] = 1
PASS storage.getItem(null) is "1"
storage['null'] = 2
PASS storage.getItem(null) is "2"
storage.setItem('null', 3)
PASS storage.getItem(null) is "3"
PASS storage.length is 3

Testing an undefined key
storage[undefined] = 'xyz'
PASS storage.getItem('undefined') is "xyz"
PASS storage.getItem(undefined) is "xyz"
PASS storage['undefined'] is "xyz"
PASS storage[undefined] is "xyz"
PASS storage.length is 4
storage['undefined'] = 4
PASS storage.getItem(undefined) is "4"
storage.setItem(undefined, 5)
PASS storage.getItem(undefined) is "5"
storage.setItem('undefined', 6)
PASS storage.getItem(undefined) is "6"
PASS storage.length is 4

Testing a numeric key
storage['2'] = 'ppp'
PASS storage.getItem('2') is "ppp"
PASS storage.getItem(2) is "ppp"
PASS storage['2'] is "ppp"
PASS storage[2] is "ppp"
PASS storage.length is 5
storage[2] = 7
PASS storage.getItem(2) is "7"
storage.setItem(2, 8)
PASS storage.getItem(2) is "8"
storage.setItem('2', 9)
PASS storage.getItem(2) is "9"
PASS storage.length is 5

Setting a non-ascii string to foo
storage[k] = 'hello'
PASS storage.getItem(k) is "hello"
PASS storage[k] is "hello"
PASS storage.length is 6

Testing case differences
storage.foo1 = 'lower1'
storage.FOO1 = 'UPPER1'
storage['foo2'] = 'lower2'
storage['FOO2'] = 'UPPER2'
storage.setItem('foo3', 'lower3')
storage.setItem('FOO3', 'UPPER3')
PASS storage.foo1 is "lower1"
PASS storage.FOO1 is "UPPER1"
PASS storage['foo2'] is "lower2"
PASS storage['FOO2'] is "UPPER2"
PASS storage.getItem('foo3') is "lower3"
PASS storage.getItem('FOO3') is "UPPER3"
PASS storage.length is 12

Testing overriding length
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage.length = 0
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage['length'] = 0
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage.setItem('length', 0)
PASS storage.length is 13
PASS storage['length'] is 13
PASS storage.getItem('length') is "0"
storage.removeItem('length')
PASS storage.length is 12
PASS storage['length'] is 12
PASS storage.getItem('length') is null
storage.setItem('length', 0)
PASS storage.length is 13
PASS successfullyParsed is true

TEST COMPLETE