Commit 454ce328 authored by Ella Ge's avatar Ella Ge Committed by Commit Bot

Reland "Make touchevent timestamp update on every non Stationary touch points"

This reverts commit b24859d8.

Reason for revert: fixing the test and reland

Original change's description:
> Revert "Make touchevent timestamp update on every non Stationary touch points"
> 
> This reverts commit 2131ec3a.
> 
> Reason for revert: Seems to have broken WebKit Linux Leak build.
> 
> https://ci.chromium.org/p/chromium/builders/ci/WebKit%20Linux%20Leak
> https://ci.chromium.org/p/chromium/builders/ci/WebKit%20Linux%20Leak/2981
> 
> Original change's description:
> > Make touchevent timestamp update on every non Stationary touch points
> > 
> > Touch event's timestamp is set from the |first_touch_pointer_event|'s
> > timestamp. But in the case that this touch point is not changing but
> > the others changed, this timestamp is not the latest pointerevent's
> > timestamp.
> > This CL changes it to use the the latest timestamp of the pointerevents
> > in |touch_attribute_map|.
> > 
> > Bug: 973545
> > Change-Id: I08be3f58e886f40eca17d515b36ec3a6424a38ef
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1705051
> > Reviewed-by: David Bokan <bokan@chromium.org>
> > Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
> > Commit-Queue: Ella Ge <eirage@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#685612}
> 
> TBR=bokan@chromium.org,nzolghadr@chromium.org,eirage@chromium.org
> 
> Change-Id: Id5a4657d566006597c9b6db06e3736240899e8ef
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 973545
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1746789
> Reviewed-by: Scott Little <sclittle@chromium.org>
> Commit-Queue: Scott Little <sclittle@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#685638}

TBR=bokan@chromium.org,sclittle@chromium.org,nzolghadr@chromium.org,eirage@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 973545
Change-Id: Ia6ba0e493f8f0c495c462c2dbe5cdf4cdfa50171
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747736Reviewed-by: default avatarElla Ge <eirage@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686153}
parent 881df1ac
......@@ -244,6 +244,10 @@ WebCoalescedInputEvent TouchEventManager::GenerateWebCoalescedInputEvent() {
event.touches[event.touches_length++] =
CreateWebTouchPointFromWebPointerEvent(touch_pointer_event,
touch_point_attribute->stale_);
if (!touch_point_attribute->stale_) {
event.SetTimeStamp(std::max(event.TimeStamp(),
touch_point_attribute->event_.TimeStamp()));
}
// Only change the touch event type from move. So if we have two pointers
// in up and down state we just set the touch event type to the first one
......
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<div id="box" style="width:100%; height:100%; background:green">Target</div>
</body>
<script type="text/javascript">
var box = document.getElementById("box");
var targetRect = box.getBoundingClientRect();
var offset = 50;
var x = targetRect.left + offset;
var y = targetRect.top + offset;
var last_event_time = 0;
function validTouchResult(event) {
if (last_event_time) {
testTouchPointers.step(function () {
assert_greater_than(event.timeStamp, last_event_time)
});
}
last_event_time = Math.floor(event.timeStamp);
}
function endTest() {
testTouchPointers.done();
}
function testMultiTouchPointers() {
if (window.chrome && chrome.gpuBenchmarking) {
var pointerActions =
[{source: "touch", id: 0,
actions: [
{ name: "pointerDown", x: x, y: y },
{ name: "pointerMove", x: x + 30, y: y + 30 },
{ name: "pause", },
{ name: "pointerMove", x: x + 50, y: y + 50 },
{ name: "pause", },
{ name: "pointerMove", x: x + 90, y: y + 90 },
{ name: "pause", },
{ name: "pointerUp" }]},
{source: "touch", id: 1,
actions: [
{ name: "pause" },
{ name: "pointerDown", x: x, y: y },
{ name: "pointerMove", x: x + 50, y: y },
{ name: "pause" },
{ name: "pointerMove", x: x + 60, y: y + 20 },
{ name: "pause", },
{ name: "pointerMove", x: x + 90, y: y + 30 },
{ name: "pointerUp"}]}];
chrome.gpuBenchmarking.pointerActionSequence(pointerActions, endTest);
}
}
var testTouchPointers = async_test("Test touch event timestamp with multiple finger.");
box.addEventListener('touchstart', validTouchResult);
box.addEventListener('touchmove', validTouchResult);
box.addEventListener('touchend', validTouchResult);
testMultiTouchPointers();
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment