Chromium Code Reviews| Index: tests/html/native_gc_test.dart |
| diff --git a/tests/html/native_gc_test.dart b/tests/html/native_gc_test.dart |
| index 1882c6e2e00f9de246ca696f61bce7b01f0bd4a0..c8c9c934effd3dd946010755297f6d7ee2362c0f 100644 |
| --- a/tests/html/native_gc_test.dart |
| +++ b/tests/html/native_gc_test.dart |
| @@ -30,4 +30,24 @@ main() { |
| final event = new Event('test'); |
| div.on['test'].dispatch(event); |
| }); |
| + |
| + test('WindowEventListener', () { |
| + Element testDiv = new DivElement(); |
| + testDiv.id = '#TestDiv'; |
| + document.body.nodes.add(testDiv); |
| + window.on.message.add((e) => testDiv.click()); |
| + |
| + for (int i = 0; i < 100; ++i) { |
| + triggerMajorGC(); |
| + } |
| + |
| + testDiv.on.click.add(expectAsync1((e) {})); |
| + window.postMessage('test', '*'); |
| + }); |
| +} |
| + |
| +void triggerMajorGC() { |
| + List list = new List(1000000); |
|
Anton Muhin
2012/07/06 16:17:01
somewhat fragile, but, I don't know better approac
|
| + Element div = new DivElement(); |
| + div.on.click.add((e) => print(list[0])); |
|
Anton Muhin
2012/07/06 16:17:01
why?
podivilov
2012/07/10 08:33:52
why not? :)
Anton Muhin
2012/07/10 08:41:38
It's not obvious why code which promises to trigge
podivilov
2012/07/10 11:03:47
Is it possible that void foo() { List list = new L
Anton Muhin
2012/07/10 11:36:16
That's a good point, but in this case you'd better
|
| } |