OLD | NEW |
1 #library('StorageTest'); | 1 #library('StorageTest'); |
2 #import('../../../../lib/unittest/unittest_dom.dart'); | 2 #import('../../../../lib/unittest/unittest.dart'); |
| 3 #import('../../../../lib/unittest/dom_config.dart'); |
3 #import('dart:dom'); | 4 #import('dart:dom'); |
4 | 5 |
5 main() { | 6 main() { |
6 forLayoutTests(); | 7 useDomConfiguration(isLayoutTest: true); |
7 test('GetItem', () { | 8 test('GetItem', () { |
8 final value = window.localStorage.getItem('does not exist'); | 9 final value = window.localStorage.getItem('does not exist'); |
9 Expect.isNull(value); | 10 Expect.isNull(value); |
10 }); | 11 }); |
11 test('SetItem', () { | 12 test('SetItem', () { |
12 final key = 'foo'; | 13 final key = 'foo'; |
13 final value = 'bar'; | 14 final value = 'bar'; |
14 window.localStorage.setItem(key, value); | 15 window.localStorage.setItem(key, value); |
15 final stored = window.localStorage.getItem(key); | 16 final stored = window.localStorage.getItem(key); |
16 Expect.equals(value, stored); | 17 Expect.equals(value, stored); |
17 }); | 18 }); |
18 } | 19 } |
OLD | NEW |