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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/wheel-and-touch-scroll-use-count.html

Issue 2737653004: UMA metrics for use count of wheel and touch scrolls. (Closed)
Patch Set: TODO for GRC usage added. Created 3 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/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <style>
5
6 ::-webkit-scrollbar {
7 display: none;
8 }
9 body {
10 margin: 0px;
11 height: 1000px;
12 width: 1000px;
13 }
14 #scrollable {
15 background-color: #FF7F7F;
16 height: 600px;
17 width: 600px;
18 overflow: scroll;
19 }
20 #content {
21 height: 700px;
22 width: 700px;
23 }
24
25 </style>
26
27 <div id="scrollable">
28 <div id="content"></div>
29 </div>
30
31 <script>
32
33 var div = document.getElementById('scrollable');
34 var rect = div.getBoundingClientRect();
35
36 const TOUCH_SOURCE_TYPE = 1; // TOUCH_INPUT from synthetic_gesture_params.h
37 const WHEEL_SOURCE_TYPE = 2; // MOUSE_INPUT from synthetic_gesture_params.h
38
39 var ScrollByTouch = 1847; // from enum Feature in UseCounter.h
40 var ScrollByWheel = 1848; // from enum Feature in UseCounter.h
41
42 setup({ explicit_done: true });
43 test(() => {
44 // Skip touch scroll use count test on mac since touch smoothScrollBy
45 // is not supported for mac.
46 if (navigator.platform.indexOf('Mac') == 0) {
47 scrollByWheel();
48 } else {
49 chrome.gpuBenchmarking.smoothScrollBy(50, waitForTouchScrollAndCheck,
50 (rect.left + rect.right) / 2,
51 (rect.top + rect.bottom) / 2,
52 TOUCH_SOURCE_TYPE, "down", 4000);
53 }
54 }, "Scrolling by touch/wheel on main/compositor should update usecounters.");
55
56 function waitForTouchScrollAndCheck() {
57 if (internals.isUseCounted(document, ScrollByTouch))
58 scrollByWheel();
59 else
60 requestAnimationFrame(waitForTouchScrollAndCheck);
61 }
62
63 function scrollByWheel() {
64 chrome.gpuBenchmarking.smoothScrollBy(50, waitForWheelScrollAndCheck,
65 (rect.left + rect.right) / 2,
66 (rect.top + rect.bottom) / 2,
67 WHEEL_SOURCE_TYPE, "down", 4000);
68 }
69
70 function waitForWheelScrollAndCheck() {
71 if (internals.isUseCounted(document, ScrollByWheel))
72 done();
73 else
74 requestAnimationFrame(waitForWheelScrollAndCheck);
75 }
76
77 </script>
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | third_party/WebKit/Source/core/input/ScrollManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698