2dcd56ef43
There are far too many files here to review everyone carefully. Spot checking most of the diffs look good as test code is generally written with less care than application code so lots of ugly formatting get through. If people notice files where the automated formatting bothers them feel free to comment indicating file names and I'll move spaces within comments to make the formatting cleaner and use comments to force block formatting as I have done for other case where formatting looked bad. BUG= R=efortuna@google.com Review-Url: https://codereview.chromium.org/2771453003 .
30 lines
789 B
Dart
30 lines
789 B
Dart
library StorageTest;
|
|
|
|
import 'package:unittest/unittest.dart';
|
|
import 'package:unittest/html_config.dart';
|
|
import 'dart:html';
|
|
|
|
main() {
|
|
useHtmlConfiguration();
|
|
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');
|
|
});
|
|
}
|