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

Unified 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, 9 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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/scroll-behavior/wheel-and-touch-scroll-use-count.html
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/wheel-and-touch-scroll-use-count.html b/third_party/WebKit/LayoutTests/fast/scroll-behavior/wheel-and-touch-scroll-use-count.html
new file mode 100644
index 0000000000000000000000000000000000000000..74aeb2af55aaa68e9c6dfdc10944f396a6603f7f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scroll-behavior/wheel-and-touch-scroll-use-count.html
@@ -0,0 +1,77 @@
+<!DOCTYPE HTML>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+
+ ::-webkit-scrollbar {
+ display: none;
+ }
+ body {
+ margin: 0px;
+ height: 1000px;
+ width: 1000px;
+ }
+ #scrollable {
+ background-color: #FF7F7F;
+ height: 600px;
+ width: 600px;
+ overflow: scroll;
+ }
+ #content {
+ height: 700px;
+ width: 700px;
+ }
+
+</style>
+
+<div id="scrollable">
+ <div id="content"></div>
+</div>
+
+<script>
+
+var div = document.getElementById('scrollable');
+var rect = div.getBoundingClientRect();
+
+const TOUCH_SOURCE_TYPE = 1; // TOUCH_INPUT from synthetic_gesture_params.h
+const WHEEL_SOURCE_TYPE = 2; // MOUSE_INPUT from synthetic_gesture_params.h
+
+var ScrollByTouch = 1847; // from enum Feature in UseCounter.h
+var ScrollByWheel = 1848; // from enum Feature in UseCounter.h
+
+setup({ explicit_done: true });
+test(() => {
+ // Skip touch scroll use count test on mac since touch smoothScrollBy
+ // is not supported for mac.
+ if (navigator.platform.indexOf('Mac') == 0) {
+ scrollByWheel();
+ } else {
+ chrome.gpuBenchmarking.smoothScrollBy(50, waitForTouchScrollAndCheck,
+ (rect.left + rect.right) / 2,
+ (rect.top + rect.bottom) / 2,
+ TOUCH_SOURCE_TYPE, "down", 4000);
+ }
+}, "Scrolling by touch/wheel on main/compositor should update usecounters.");
+
+function waitForTouchScrollAndCheck() {
+ if (internals.isUseCounted(document, ScrollByTouch))
+ scrollByWheel();
+ else
+ requestAnimationFrame(waitForTouchScrollAndCheck);
+}
+
+function scrollByWheel() {
+ chrome.gpuBenchmarking.smoothScrollBy(50, waitForWheelScrollAndCheck,
+ (rect.left + rect.right) / 2,
+ (rect.top + rect.bottom) / 2,
+ WHEEL_SOURCE_TYPE, "down", 4000);
+}
+
+function waitForWheelScrollAndCheck() {
+ if (internals.isUseCounted(document, ScrollByWheel))
+ done();
+ else
+ requestAnimationFrame(waitForWheelScrollAndCheck);
+}
+
+</script>
« 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