| Index: tests/html/utils.dart
|
| diff --git a/tests/html/utils.dart b/tests/html/utils.dart
|
| index 04c8235353f0303d9a0ce03b5971b9d6f0414c15..b1d7f689911f7d14958f4bbe79d3417259a7ba9d 100644
|
| --- a/tests/html/utils.dart
|
| +++ b/tests/html/utils.dart
|
| @@ -2,6 +2,7 @@ library TestUtils;
|
|
|
| import 'dart:async';
|
| import 'dart:html';
|
| +import 'dart:js' as js;
|
| import 'dart:typed_data';
|
| import 'package:unittest/unittest.dart';
|
|
|
| @@ -173,3 +174,16 @@ Future loadCustomElementPolyfill() {
|
| Future loadPolyfills() {
|
| return loadCustomElementPolyfill();
|
| }
|
| +
|
| +/**
|
| + * Upgrade all custom elements in the subtree which have not been upgraded.
|
| + *
|
| + * This is needed to cover timing scenarios which the custom element polyfill
|
| + * does not cover.
|
| + */
|
| +void upgradeCustomElements(Node node) {
|
| + if (js.context.hasProperty('CustomElements') &&
|
| + js.context['CustomElements'].hasProperty('upgradeAll')) {
|
| + js.context['CustomElements'].callMethod('upgradeAll', [node]);
|
| + }
|
| +}
|
|
|