Chromium Code Reviews| Index: pkg/template_binding/test/template_binding_test.dart |
| diff --git a/pkg/template_binding/test/template_binding_test.dart b/pkg/template_binding/test/template_binding_test.dart |
| index de7e8c37af7f783668f6f50f0c25fa84ef6a87c0..fde463b55f6e83d9d4a4b1a6e674dc9a9b01e20d 100644 |
| --- a/pkg/template_binding/test/template_binding_test.dart |
| +++ b/pkg/template_binding/test/template_binding_test.dart |
| @@ -1369,14 +1369,22 @@ templateInstantiationTests() { |
| expect(div.nodes.length, 4); |
| expect('Hi, Fry', div.nodes[3].text); |
| - div.nodes[2].attributes['ref'] = 'B'; |
| + // In IE 11, MutationObservers do not fire before setTimeout. |
| + // So rather than using "then" to queue up the next test, we use a |
| + // MutationObserver here to detect the change to "ref". |
|
Siggi Cherem (dart-lang)
2014/09/09 21:21:43
what if we use endOfMicrotask instead? or is that
jakemac
2014/09/10 16:30:00
I think its best to keep this in sync with the js
|
| + var done = new Completer(); |
| + new MutationObserver((mutations, observer) { |
| + expect(div.nodes.length, 5); |
| + |
| + expect('Hola, Fry', div.nodes[3].text); |
| + expect('Hola, Leela', div.nodes[4].text); |
| + done.complete(); |
| + }).observe(template, attributes: true, attributeFilter: ['ref']); |
| + |
| + template.setAttribute('ref', 'B'); |
| model.add('Leela'); |
| - }).then(nextMicrotask).then((x) { |
| - expect(div.nodes.length, 5); |
| - |
| - expect('Hola, Fry', div.nodes[3].text); |
| - expect('Hola, Leela', div.nodes[4].text); |
| + return done.future; |
| }); |
| }); |