| Index: tests/html/mutationobserver_test.dart
|
| diff --git a/tests/html/mutationobserver_test.dart b/tests/html/mutationobserver_test.dart
|
| index 0af69c50bb8f882a9c856eb3891ccccb3fea8204..a77a26b250b3f5ef669a005017b7b4a2da7c4bb4 100644
|
| --- a/tests/html/mutationobserver_test.dart
|
| +++ b/tests/html/mutationobserver_test.dart
|
| @@ -7,6 +7,16 @@ import '../../pkg/unittest/lib/unittest.dart';
|
| import '../../pkg/unittest/lib/html_individual_config.dart';
|
| import 'dart:html';
|
|
|
| +// MutationObservers sometimes do not fire if the node being observed is GCed
|
| +// so we keep around references to all nodes we have created mutation
|
| +// observers for. As a side note, this behavior only manifests in content_shell
|
| +// and not chrome and the behavior goes away in content_shell if the flag
|
| +// -js-flags="--gc_global" is passed to content_shell. Note: the gc behavior
|
| +// only has been detected when running dart2js but could equally reasonably
|
| +// impact the dartvm as well unless it is specified that mutation events must
|
| +// be delivered even if the object the events are for has already been GCed.
|
| +var keepAlive = [];
|
| +
|
| /**
|
| * Test suite for Mutation Observers. This is just a small set of sanity
|
| * checks, not a complete test suite.
|
| @@ -61,6 +71,7 @@ main() {
|
| test('direct-parallel options-named', () {
|
| expect(() {
|
| var container = new DivElement();
|
| + keepAlive.add(container);
|
| var div1 = new DivElement();
|
| var div2 = new DivElement();
|
| var mutationObserver = new MutationObserver(
|
| @@ -75,6 +86,7 @@ main() {
|
| test('direct-nested options-named', () {
|
| expect(() {
|
| var container = new DivElement();
|
| + keepAlive.add(container);
|
| var div1 = new DivElement();
|
| var div2 = new DivElement();
|
| var mutationObserver =
|
| @@ -89,6 +101,7 @@ main() {
|
| test('subtree options-named', () {
|
| expect(() {
|
| var container = new DivElement();
|
| + keepAlive.add(container);
|
| var div1 = new DivElement();
|
| var div2 = new DivElement();
|
| var mutationObserver = new MutationObserver(
|
|
|