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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.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/web-animations/testcommon.js
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js b/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js
index 5ba03082a9cd65bd7ae916ad99d877e879896484..e375a0f8741788984f9c7be658a3b88c7396c0ff 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js
+++ b/third_party/WebKit/LayoutTests/imported/wpt/web-animations/testcommon.js
@@ -28,15 +28,22 @@ if (!window.assert_times_equal) {
// creates div element, appends it to the document body and
// removes the created element during test cleanup
function createDiv(test, doc) {
+ return createElement(test, 'div', doc);
+}
+
+// creates element of given tagName, appends it to the document body and
+// removes the created element during test cleanup
+// if tagName is null or undefined, returns div element
+function createElement(test, tagName, doc) {
if (!doc) {
doc = document;
}
- var div = doc.createElement('div');
- doc.body.appendChild(div);
+ var element = doc.createElement(tagName || 'div');
+ doc.body.appendChild(element);
test.add_cleanup(function() {
- div.remove();
+ element.remove();
});
- return div;
+ return element;
}
// Creates a style element with the specified rules, appends it to the document

Powered by Google App Engine
This is Rietveld 408576698