Chromium Code Reviews| Index: pkg/custom_element/test/custom_element_test.dart |
| diff --git a/pkg/custom_element/test/custom_element_test.dart b/pkg/custom_element/test/custom_element_test.dart |
| index 341713aa364db6f061643e4c0b43f6a588efa2c2..3094518494192ce1837f94cd628a54a416ae2c55 100644 |
| --- a/pkg/custom_element/test/custom_element_test.dart |
| +++ b/pkg/custom_element/test/custom_element_test.dart |
| @@ -13,16 +13,16 @@ import 'package:unittest/unittest.dart'; |
| main() { |
| useHtmlConfiguration(); |
| - // Load the MutationObserver polyfill. |
| - HttpRequest.getString('/root_dart/pkg/mutation_observer/lib/' |
| - 'mutation_observer.js').then((code) { |
| - document.head.children.add(new ScriptElement()..text = code); |
| - |
| - customElementTests(); |
| + setUp(() { |
| + // Load the MutationObserver polyfill if needed. |
| + if (!MutationObserver.supported) { |
| + var script = new ScriptElement() |
| + ..src = '/packages/mutation_observer/mutation_observer.js'; |
| + document.head.append(script); |
| + return script.onLoad.first; |
|
Jennifer Messerly
2013/09/12 20:43:48
Nice! This blocks the test until it loads? That wa
blois
2013/09/12 21:23:13
The setUp function handles Future return types jus
|
| + } |
| }); |
| -} |
| -customElementTests() { |
| test('register creates the element and calls lifecycle methods', () { |
| // Add element to the page. |
| var element = new Element.html('<fancy-button>foo bar</fancy-button>', |