Files
sdk/tests/html/storage_test.dart
T
2012-08-14 22:36:59 +00:00

20 lines
484 B
Dart

#library('StorageTest');
#import('../../pkg/unittest/unittest.dart');
#import('../../pkg/unittest/html_config.dart');
#import('dart:html');
main() {
useHtmlConfiguration();
test('GetItem', () {
final value = window.localStorage['does not exist'];
Expect.isNull(value);
});
test('SetItem', () {
final key = 'foo';
final value = 'bar';
window.localStorage[key] = value;
final stored = window.localStorage[key];
Expect.equals(value, stored);
});
}