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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../../../../../resources/js-test.js"></script>
3 <style>
4 div.box {
5 margin: 5px;
6 padding: 20px;
7 float: left;
8 }
9 #grey {
mustaq 2016/04/19 19:11:43 Nit: could join the two style entries since there'
sahel 2016/04/19 21:39:20 Done.
10 width: 50px;
11 height: 50px;
12 }
13 </style>
14
15 <div id="grey" class="box" style="background-color:grey">
16 </div>
17
18 <div id="console"></div>
19
20 <script>
21 description("Verifies that use of pointerEvents is measured by use counters.");
22
23
24 var rect = document.getElementById("grey").getBoundingClientRect();
25 var x1 = rect.left + 5;
26 var y1 = rect.top + 5;
27
28
29 function init() {
30 var eventList = ["pointerover", "pointerenter", "pointermove", "pointerdown", "pointerup"];
31
32 var targetDiv = document.getElementById("grey");
33 eventList.forEach(function(eventName) {
34 targetDiv.addEventListener(eventName, function(event) {
35 if (event.eventPhase == Event.AT_TARGET) {
tdresser 2016/04/19 17:52:00 We don't need to check the event phase here.
sahel 2016/04/19 21:39:20 Done.
36 debug("grey" + " received " + event.type);
37 if (event.type == "pointerdown") {
tdresser 2016/04/19 17:52:00 We don't need to check the event type here.
sahel 2016/04/19 21:39:20 I didn't want to print it for every event type. I
38 debug(" **** read pointerID to trigger MeasureAs ***** ");
39 debug("pointerID is "+ event.pointerId);
40 }
41 }
42 });
43 });
44
45 }
46
47 function runTest() {
48 debug(" **** Move to grey box & mouse press & jiggle ***** ");
49 eventSender.mouseMoveTo(x1, y1);
50 eventSender.mouseDown(1);
51 eventSender.mouseMoveTo(x1+1, y1+1);
52 eventSender.mouseUp(1);
53
54 var PointerEventCount = 1306;
mustaq 2016/04/19 19:11:43 Please add a comment to explain the number, e.g.:
sahel 2016/04/19 21:39:20 Done.
55 debug(" **** Print PointerEventCount usage ***** ");
56 debug(internals.isUseCounted(document, PointerEventCount));
57 }
58
59 init();
60 if (window.eventSender)
61 runTest();
62 else
63 debug("This test requires eventSender");
64
65 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698