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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js

Issue 1952893003: Implement custom element construction and some 'define' checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use DCHECK, revert RuntimeEnabledFeatures.in. Created 4 years, 7 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: third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js b/third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js
new file mode 100644
index 0000000000000000000000000000000000000000..885677d54cd183c6226c7dd07a57753aaf3ec9f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js
@@ -0,0 +1,22 @@
+function create_window_in_test(t) {
+ let p = new Promise((resolve) => {
+ let f = document.createElement('iframe');
+ f.srcdoc = '';
+ f.onload = (event) => {
+ let w = f.contentWindow;
+ t.add_cleanup(() => f.remove());
+ resolve(w);
+ };
+ document.body.appendChild(f);
+ });
+ return p;
+}
+
+function test_with_window(f, name) {
+ promise_test((t) => {
+ return create_window_in_test(t)
+ .then((w) => {
+ f(w);
+ });
+ }, name);
+}

Powered by Google App Engine
This is Rietveld 408576698