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