d2cd2a4720
Bug: Change-Id: If23630da318547e3beaf417a5ad97b30f6ffcbd3 Reviewed-on: https://dart-review.googlesource.com/10340 Reviewed-by: Florian Loitsch <floitsch@google.com> Commit-Queue: Jakob Roland Andersen <jakobr@google.com>
27 lines
696 B
Dart
27 lines
696 B
Dart
import 'dart:html';
|
|
|
|
import 'package:expect/minitest.dart';
|
|
|
|
main() {
|
|
test('GetItem', () {
|
|
final value = window.localStorage['does not exist'];
|
|
expect(value, isNull);
|
|
});
|
|
test('SetItem', () {
|
|
final key = 'foo';
|
|
final value = 'bar';
|
|
window.localStorage[key] = value;
|
|
final stored = window.localStorage[key];
|
|
expect(stored, value);
|
|
});
|
|
|
|
test('event', () {
|
|
// Bug 8076 that not all optional params are optional in Dartium.
|
|
var event = new StorageEvent('something',
|
|
oldValue: 'old', newValue: 'new', url: 'url', key: 'key');
|
|
expect(event is StorageEvent, isTrue);
|
|
expect(event.oldValue, 'old');
|
|
expect(event.newValue, 'new');
|
|
});
|
|
}
|