New issue
Advanced search Search tips

Issue 784284 link

Starred by 17 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

No touch events in mobileEmulation

Reported by michael....@inftec.ch, Nov 13 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36

Steps to reproduce the problem:
1. Run Chromium with the mobileEmulation experimental option:
Map<String, String> mobileEmulation = new HashMap<>();
mobileEmulation.put("deviceName", "Nexus 5");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setExperimentalOption("mobileEmulation", mobileEmulation);

See details here: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation

2. Try to listen to e.g. the touchstart event on a button

For easier reproduction you can check out the example project attached.
It seems as Chromium is not in mobileEmulation at all. Did the configuration flag change?

What is the expected behavior?
touch events should fire

What went wrong?
None of the touch events are fired (touchstart, touchmove, touchend). Furthermore the grey round mouse cursor which indicates touch is missing.
Even the logs do not indicated any touch actions.

Did this work before? Yes Chromium build 493448

Chrome version: 62.0.3202.89  Channel: stable
OS Version: 10.0
Flash Version: 

The bug was opened in the chromedriver bug tracker but not regarded as a problem of the chromedriver. You might want to check out the discussion there aswell:
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2103

I could pin the problem to the exact commit in Chromium:
https://chromium.googlesource.com/chromium/src/+/f6b959f661e23990871fd751b8faecb6c2398a0a

I tested with ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) and found that builds until 493448 worked:
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/493448/
But failed beginning with 493474:
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/493474/
 
Issue2103Chromium.java
2.5 KB View Download
HTML_Issue2103.html
905 bytes View Download
example-project-no-touchEmulation.zip
3.9 MB Download
Not only Windows, but Linux and MacOSX is affected

Comment 2 by kozy@chromium.org, Nov 13 2017

Owner: einbinder@chromium.org
Status: Assigned (was: Unconfirmed)
Enabling touchscreen support was seperated from converting mouse events into touch events in
https://chromium.googlesource.com/chromium/src/+/1ff3b83b0c24978690c7766175f5ef7d9247d209

To replicate the old behavior, chromedriver can send the Emulation.setEmitTouchEventsForMouse protocol message. I'll look into sending a patch.
Labels: Needs-Bisect Needs-Triage-M62
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ba6f25f7e458037300b103abd365aee6e8ee3745

commit ba6f25f7e458037300b103abd365aee6e8ee3745
Author: Joel Einbinder <einbinder@chromium.org>
Date: Tue Nov 14 03:05:58 2017

ChromeDriver: Emit touch events when emulating mobile

The DevTools protocol separated emulating touchscreen support
from emitting touch events for mouse events. This patch
restores the old behavior in ChromeDriver.

Bug:  784284 ,  chromedriver:2103 
Change-Id: I25382d40130d5b3f049d5828586490bef3e1b896
Reviewed-on: https://chromium-review.googlesource.com/767290
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516159}
[modify] https://crrev.com/ba6f25f7e458037300b103abd365aee6e8ee3745/chrome/test/chromedriver/chrome/mobile_emulation_override_manager.cc
[modify] https://crrev.com/ba6f25f7e458037300b103abd365aee6e8ee3745/chrome/test/chromedriver/chrome/mobile_emulation_override_manager_unittest.cc

Status: Fixed (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Nov 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad567264b2cdf5c758a33f52b784cf088fbdff17

commit ad567264b2cdf5c758a33f52b784cf088fbdff17
Author: John Chen <johnchen@chromium.org>
Date: Tue Nov 14 23:22:40 2017

[ChromeDriver] Fix mobile emulation on v61

https://crrev.com/516159 broke mobile emulation on Chrome v61, since it
calls unavailable DevTools method Emulation.setEmitTouchEventsForMouse.
Temporarily allow this error until ChromeDriver stops supporting v61.

Bug:  784284 ,  chromedriver:2103 
Change-Id: I3cf2c38164512632e717ed0b5d02eb9da0664ae3
Reviewed-on: https://chromium-review.googlesource.com/769668
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516492}
[modify] https://crrev.com/ad567264b2cdf5c758a33f52b784cf088fbdff17/chrome/test/chromedriver/chrome/mobile_emulation_override_manager.cc

Thank you very much for the swift reaction!
I tried to test the fixed version. Am I correct in that the Chromium build 516552 should have the fix in it? (via https://omahaproxy.appspot.com/)
It still showed no signs of mobile emulation in the test case... even the newest build 524348 didn't emulate.

Comment 11 Deleted

I can confirm that it was fixed (at least under windows) with ChromeDriver 2.42.591088 which supports Chromium v68-70.

It is the first item in the changelist: "Fixed ClickEelement in Mobile Emulation" https://chromedriver.storage.googleapis.com/2.42/notes.txt
Tracked in issue-2144: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2144

Finally, we can move on with our pipeline.

Sign in to add a comment