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

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

Issue 2303013002: Add UMA metric to track usage of sending a mousedown to select elements. (Closed)
Patch Set: W3C auto test import CL. Created 4 years, 3 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/imported/wpt/custom-elements/resources/custom-elements-helpers.js
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/custom-elements/resources/custom-elements-helpers.js b/third_party/WebKit/LayoutTests/imported/wpt/custom-elements/resources/custom-elements-helpers.js
new file mode 100644
index 0000000000000000000000000000000000000000..0dfbd6363b22ed36fdf7c9106af3b19c5bf7d503
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/custom-elements/resources/custom-elements-helpers.js
@@ -0,0 +1,22 @@
+function create_window_in_test(t, srcdoc) {
+ let p = new Promise((resolve) => {
+ let f = document.createElement('iframe');
+ f.srcdoc = srcdoc ? srcdoc : '';
+ f.onload = (event) => {
+ let w = f.contentWindow;
+ t.add_cleanup(() => f.parentNode && f.remove());
+ resolve(w);
+ };
+ document.body.appendChild(f);
+ });
+ return p;
+}
+
+function test_with_window(f, name, srcdoc) {
+ promise_test((t) => {
+ return create_window_in_test(t, srcdoc)
+ .then((w) => {
+ f(w);
+ });
+ }, name);
+}

Powered by Google App Engine
This is Rietveld 408576698