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

Unified Diff: third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-use-count.html

Issue 1895983002: Adding UMA metrics to track usage of pointerevents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/virtual/pointerevent/fast/events/pointerevents/pointer-use-count.html
diff --git a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-use-count.html b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-use-count.html
new file mode 100644
index 0000000000000000000000000000000000000000..69c23c89c84c3aa9fabd8bb3bfa5f91acad3dccb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-use-count.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<script src="../../../../../resources/js-test.js"></script>
+<style>
+div.box {
+ margin: 5px;
+ padding: 20px;
+ float: left;
+ width: 50px;
+ height: 50px;
+}
+</style>
+
+<div id="grey" class="box" style="background-color:grey">
+</div>
+
+<div id="console"></div>
+
+<script>
+description("Verifies that use of pointerEvents is measured by use counters.");
+
+
+var rect = document.getElementById("grey").getBoundingClientRect();
+var x1 = rect.left + 5;
+var y1 = rect.top + 5;
+
+
+function init() {
+ var eventName = "pointerdown";
+ var targetDiv = document.getElementById("grey");
+ targetDiv.addEventListener(eventName, function(event) {
+ debug("grey" + " received " + event.type);
+ debug(" **** read pointerID to trigger MeasureAs ***** ");
+ debug("pointerID is "+ event.pointerId);
+ });
+}
+
+function runTest() {
+ debug(" **** Move to grey box & mouse press ***** ");
+ eventSender.mouseMoveTo(x1, y1);
+ eventSender.mouseDown(1);
+
+ var PointerEventAttributeCount = 1306; //Comes from enum Feature in UseCounter.h
tdresser 2016/04/21 12:15:59 This didn't get updated.
sahel 2016/04/21 20:11:19 Done.
+ debug(" **** Print PointerEventCount usage ***** ");
+ debug(internals.isUseCounted(document, PointerEventAttributeCount));
bokan 2016/04/21 13:12:11 It's more idiomatic to check your assertions using
sahel 2016/04/21 20:11:19 Done.
+}
+
+init();
+if (window.eventSender)
+ runTest();
+else
+ debug("This test requires eventSender");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698