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

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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-use-count-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 width: 50px;
9 height: 50px;
10 }
11 </style>
12
13 <div id="grey" class="box" style="background-color:grey">
14 </div>
15
16 <div id="console"></div>
17
18 <script>
19 description("Verifies that use of pointerEvents is measured by use counters.");
20
21
22 var rect = document.getElementById("grey").getBoundingClientRect();
23 var x1 = rect.left + 5;
24 var y1 = rect.top + 5;
25
26
27 function init() {
28 var eventList = ["pointerover", "pointerenter", "pointermove", "pointerdown", "pointerup"];
tdresser 2016/04/20 12:04:54 On second thought, let's just add a single pointer
mustaq 2016/04/20 14:40:09 Yes. And since the JS can check only the boolean r
tdresser 2016/04/20 14:54:40 I don't think there's a way to useCount the interf
sahel 2016/04/20 21:45:51 Done.
sahel 2016/04/20 21:45:51 Done.
29
30 var targetDiv = document.getElementById("grey");
31 eventList.forEach(function(eventName) {
32 targetDiv.addEventListener(eventName, function(event) {
33 debug("grey" + " received " + event.type);
34 if (event.type == "pointerdown") {
35 debug(" **** read pointerID to trigger MeasureAs ***** ");
36 debug("pointerID is "+ event.pointerId);
37 }
38 });
39 });
40
41 }
42
43 function runTest() {
44 debug(" **** Move to grey box & mouse press & jiggle ***** ");
45 eventSender.mouseMoveTo(x1, y1);
46 eventSender.mouseDown(1);
47 eventSender.mouseMoveTo(x1+1, y1+1);
48 eventSender.mouseUp(1);
49
50 var PointerEventAttributeCount = 1306; //Comes from enum Feature in UseCounter .h
51 debug(" **** Print PointerEventCount usage ***** ");
mustaq 2016/04/20 14:40:09 s/PointerEventCount/PointerEventAttributeCount/
52 debug(internals.isUseCounted(document, PointerEventAttributeCount));
53 }
54
55 init();
56 if (window.eventSender)
57 runTest();
58 else
59 debug("This test requires eventSender");
60
61 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-use-count-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698