| OLD | NEW |
| (Empty) |
| 1 #import('../../../../../dart/client/testing/unittest/unittest.dart'); | |
| 2 #import('dart:dom'); | |
| 3 | |
| 4 main() { | |
| 5 forLayoutTests(); | |
| 6 test('ElementsIdentity', () { | |
| 7 HTMLDivElement div = document.createElement('div'); | |
| 8 div.id = 'test'; | |
| 9 document.body.appendChild(div); | |
| 10 | |
| 11 HTMLElement element = document.getElementById('test'); | |
| 12 Expect.identical(div, element); | |
| 13 }); | |
| 14 test('TwoIsolates', () { | |
| 15 // Test that we can access the same DOM nodes from different isolates. | |
| 16 // FIXME: uncomment when we have DOM isolates. | |
| 17 /* | |
| 18 Isolate isolate = new TestIsolate().spawn().then((SendPort port) { | |
| 19 HTMLElement testDiv = document.getElementById('test_div'); | |
| 20 Expect.equals('Hello from Dart Frame', testDiv.innerHTML); | |
| 21 document.body.removeChild(testDiv); | |
| 22 }); | |
| 23 */ | |
| 24 }); | |
| 25 } | |
| 26 | |
| 27 class TestIsolate extends Isolate { | |
| 28 TestIsolate() : super.heavy(); | |
| 29 | |
| 30 void main() { | |
| 31 HTMLElement element = document.createElement('div'); | |
| 32 element.id = 'test_div'; | |
| 33 element.innerHTML = 'Hello from Dart isolate'; | |
| 34 document.body.appendChild(element); | |
| 35 } | |
| 36 } | |
| OLD | NEW |