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 2e5c3279952d9bfd48f4ea8b15890ec045070457..1bfa8fbf8e415a7ab62b1c18d90ea2eddd367cba 100644 |
| --- a/pkg/template_binding/test/template_binding_test.dart |
| +++ b/pkg/template_binding/test/template_binding_test.dart |
| @@ -1147,7 +1147,9 @@ templateInstantiationTests() { |
| expect(div.nodes[i++].text, 'Item 2'); |
| }); |
| - observeTest('Attribute Template Option/Optgroup', () { |
| + // Note: we don't need a zone for this test, and we don't want to alter timing |
| + // since we're testing a rather subtle relationship between select and option. |
| + test('Attribute Template Option/Optgroup', () { |
| var div = createTestHtml( |
| '<template bind>' |
| '<select selectedIndex="{{ selected }}">' |
| @@ -1165,27 +1167,27 @@ templateInstantiationTests() { |
| }); |
| recursivelySetTemplateModel(div, m); |
| - performMicrotaskCheckpoint(); |
| - |
| - var select = div.nodes[0].nextNode; |
| - expect(select.nodes.length, 2); |
| - |
| - scheduleMicrotask(expectAsync0(() { |
| - scheduleMicrotask(expectAsync0(() { |
| - // TODO(jmesserly): this should be called sooner. |
| - expect(select.selectedIndex, 1); |
| - })); |
| - })); |
| - expect(select.nodes[0].tagName, 'TEMPLATE'); |
| - expect((templateBind(templateBind(select.nodes[0]).ref) |
| - .content.nodes[0] as Element).tagName, 'OPTGROUP'); |
| - |
| - var optgroup = select.nodes[1]; |
| - expect(optgroup.nodes[0].tagName, 'TEMPLATE'); |
| - expect(optgroup.nodes[1].tagName, 'OPTION'); |
| - expect(optgroup.nodes[1].text, '0'); |
| - expect(optgroup.nodes[2].tagName, 'OPTION'); |
| - expect(optgroup.nodes[2].text, '1'); |
| + Observable.dirtyCheck(); |
| + |
| + // Use a timer so it's slower than mutation observers. |
| + return new Future.delayed(Duration.ZERO, () { |
|
Siggi Cherem (dart-lang)
2013/11/04 20:49:23
I believe this is equivalent to do: new Future(()
Jennifer Messerly
2013/11/04 21:58:39
dug into the code, it doesn't look like it. new Fu
|
| + var select = div.nodes[0].nextNode; |
| + expect(select.nodes.length, 2); |
| + |
| + expect(select.selectedIndex, 1, reason: 'selected index should update by ' |
| + 'animationFrame time'); |
| + |
| + expect(select.nodes[0].tagName, 'TEMPLATE'); |
| + expect((templateBind(templateBind(select.nodes[0]).ref) |
| + .content.nodes[0] as Element).tagName, 'OPTGROUP'); |
| + |
| + var optgroup = select.nodes[1]; |
| + expect(optgroup.nodes[0].tagName, 'TEMPLATE'); |
| + expect(optgroup.nodes[1].tagName, 'OPTION'); |
| + expect(optgroup.nodes[1].text, '0'); |
| + expect(optgroup.nodes[2].tagName, 'OPTION'); |
| + expect(optgroup.nodes[2].text, '1'); |
| + }); |
| }); |
| observeTest('NestedIterateTableMixedSemanticNative', () { |