Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: tests/html/utils.dart

Issue 33593003: Reapply remove upgradeCustomElement methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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]);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698