OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 void testLocalStorage() { | 6 void testLocalStorage() { |
7 void testWithLocalStorage(String name, fn()) { | 7 void testWithLocalStorage(String name, fn()) { |
8 test(name, () { | 8 test(name, () { |
9 window.localStorage['key1'] = 'val1'; | 9 window.localStorage['key1'] = 'val1'; |
10 window.localStorage['key2'] = 'val2'; | 10 window.localStorage['key2'] = 'val2'; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 window.localStorage.clear(); | 94 window.localStorage.clear(); |
95 Expect.equals(0, window.localStorage.length); | 95 Expect.equals(0, window.localStorage.length); |
96 }); | 96 }); |
97 | 97 |
98 testWithLocalStorage('isEmpty', () { | 98 testWithLocalStorage('isEmpty', () { |
99 Expect.isFalse(window.localStorage.isEmpty()); | 99 Expect.isFalse(window.localStorage.isEmpty()); |
100 window.localStorage.clear(); | 100 window.localStorage.clear(); |
101 Expect.isTrue(window.localStorage.isEmpty()); | 101 Expect.isTrue(window.localStorage.isEmpty()); |
102 }); | 102 }); |
103 } | 103 } |
OLD | NEW |