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 // TODO(vsm): Rename this to wrapper_caching_test or similar. It's | 5 // TODO(vsm): Rename this to wrapper_caching_test or similar. It's |
6 // basically a port of dom/dart_object_local_storage_test.dart. For | 6 // basically a port of dom/dart_object_local_storage_test.dart. For |
7 // wrapping implementation of dart:html (i.e., the dartium one), it is | 7 // wrapping implementation of dart:html (i.e., the dartium one), it is |
8 // effectively testing dart_object_local_storage in the underlying dom | 8 // effectively testing dart_object_local_storage in the underlying dom |
9 // object. | 9 // object. |
10 main() { | 10 main() { |
11 BodyElement body = document.body; | 11 BodyElement body = document.body; |
12 Storage localStorage = window.localStorage; | 12 Storage localStorage = window.localStorage; |
13 Storage sessionStorage = window.sessionStorage; | 13 Storage sessionStorage = window.sessionStorage; |
14 var element = new Element.tag('canvas'); | 14 var element = new Element.tag('canvas'); |
15 element.id = 'test'; | 15 element.id = 'test'; |
16 body.append(element); | 16 body.append(element); |
17 | 17 |
18 test('body', () { | 18 test('body', () { |
19 expect(body, equals(document.body)); | 19 expect(body, equals(document.body)); |
20 }); | 20 }); |
21 test('localStorage', () { | 21 test('localStorage', () { |
22 expect(localStorage, equals(window.localStorage)); | 22 expect(localStorage, equals(window.localStorage)); |
23 }); | 23 }); |
24 test('sessionStorage', () { | 24 test('sessionStorage', () { |
25 expect(sessionStorage, equals(window.sessionStorage)); | 25 expect(sessionStorage, equals(window.sessionStorage)); |
26 }); | 26 }); |
27 test('unknown', () { | 27 test('unknown', () { |
28 var test = document.query('#test'); | 28 var test = document.query('#test'); |
29 expect(element, equals(test)); | 29 expect(element, equals(test)); |
30 }); | 30 }); |
31 } | 31 } |
OLD | NEW |