OLD | NEW |
1 import 'dart:html'; | 1 import 'dart:html'; |
2 | 2 |
3 import 'package:expect/minitest.dart'; | 3 import 'package:expect/minitest.dart'; |
4 | 4 |
5 main() { | 5 main() { |
6 test('GetItem', () { | 6 test('GetItem', () { |
7 final value = window.localStorage['does not exist']; | 7 final value = window.localStorage['does not exist']; |
8 expect(value, isNull); | 8 expect(value, isNull); |
9 }); | 9 }); |
10 test('SetItem', () { | 10 test('SetItem', () { |
11 final key = 'foo'; | 11 final key = 'foo'; |
12 final value = 'bar'; | 12 final value = 'bar'; |
13 window.localStorage[key] = value; | 13 window.localStorage[key] = value; |
14 final stored = window.localStorage[key]; | 14 final stored = window.localStorage[key]; |
15 expect(stored, value); | 15 expect(stored, value); |
16 }); | 16 }); |
17 | 17 |
18 test('event', () { | 18 test('event', () { |
19 // Bug 8076 that not all optional params are optional in Dartium. | 19 // Bug 8076 that not all optional params are optional in Dartium. |
20 var event = new StorageEvent('something', oldValue: 'old', newValue: 'new', | 20 var event = new StorageEvent('something', |
21 url: 'url', key: 'key'); | 21 oldValue: 'old', newValue: 'new', url: 'url', key: 'key'); |
22 expect(event is StorageEvent, isTrue); | 22 expect(event is StorageEvent, isTrue); |
23 expect(event.oldValue, 'old'); | 23 expect(event.oldValue, 'old'); |
24 expect(event.newValue, 'new'); | 24 expect(event.newValue, 'new'); |
25 }); | 25 }); |
26 } | 26 } |
OLD | NEW |