OLD | NEW |
1 library NativeGCTest; | 1 library NativeGCTest; |
2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import '../../pkg/unittest/lib/unittest.dart'; |
3 import '../../pkg/unittest/lib/html_config.dart'; | 3 import '../../pkg/unittest/lib/html_config.dart'; |
4 import 'dart:html'; | 4 import 'dart:html'; |
5 | 5 |
6 var testEvent = new EventStreamProvider<Event>('test'); | 6 var testEvent = new EventStreamProvider<Event>('test'); |
7 | 7 |
8 main() { | 8 main() { |
9 useHtmlConfiguration(); | 9 useHtmlConfiguration(); |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 testDiv.id = '#TestDiv'; | 40 testDiv.id = '#TestDiv'; |
41 document.body.append(testDiv); | 41 document.body.append(testDiv); |
42 window.onMessage.listen((e) { | 42 window.onMessage.listen((e) { |
43 if (e.data == message) testDiv.click(); | 43 if (e.data == message) testDiv.click(); |
44 }); | 44 }); |
45 | 45 |
46 for (int i = 0; i < 100; ++i) { | 46 for (int i = 0; i < 100; ++i) { |
47 triggerMajorGC(); | 47 triggerMajorGC(); |
48 } | 48 } |
49 | 49 |
50 testDiv.onClick.listen(expectAsync1((e) {})); | 50 testDiv.onClick.listen(expectAsync((e) {})); |
51 window.postMessage(message, '*'); | 51 window.postMessage(message, '*'); |
52 }); | 52 }); |
53 } | 53 } |
54 | 54 |
55 void triggerMajorGC() { | 55 void triggerMajorGC() { |
56 List list = new List(1000000); | 56 List list = new List(1000000); |
57 Element div = new DivElement(); | 57 Element div = new DivElement(); |
58 div.onClick.listen((e) => print(list[0])); | 58 div.onClick.listen((e) => print(list[0])); |
59 } | 59 } |
OLD | NEW |