Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running Lighthouse from Webpagetest there is no support of touch device #5659

Closed
Svenmay opened this issue Jul 12, 2018 · 4 comments · Fixed by #5661
Closed

When running Lighthouse from Webpagetest there is no support of touch device #5659

Svenmay opened this issue Jul 12, 2018 · 4 comments · Fixed by #5661

Comments

@Svenmay
Copy link

Svenmay commented Jul 12, 2018

Provide the steps to reproduce

  1. Run LH on
    Test-URL: https://tolwin.spdns.org/test/test_touch.html

URL of webpagetest run: https://www.webpagetest.org/result/180712_GP_88a851ffa3165b62cc505c566d91d4c0/

URL of Lighthouse report from that WPT run: https://www.webpagetest.org/lighthouse.php?test=180712_GP_88a851ffa3165b62cc505c566d91d4c0&run=1

What is the current behavior?

Running a standard test on webpagetest simulates a mobile device with touch support. That is the correct/expected behavior.
But the Lighthouse report, also run from webpagetest seems to be running as a device WITHOUT touch support.

You can see in the screenshots from WPT and from Lighthouse report that they are different. The testpage itself is not doing much useful, other than trying to detect a device with touch support.

NOTE: It is not about the question, if my touch detection is correct or not. It is just about the question why WPT is different from Lighthouse. Both tools should be either "touch detected" or "no touch detected".
Personally I do think Lighthouse is wrong here, not WPT.

What is the expected behavior?

Lighthouse should also run as a device with touch support.

Environment Information

  • Affected Channels: The version on webpagetest.org, https://www.webpagetest.org/lighthouse (not sure if this is a bug for webpagetest or for Lighthouse then)
  • Lighthouse version: 3.0.2
  • Node.js version:
  • Operating System:

Related issues

@Svenmay
Copy link
Author

Svenmay commented Jul 12, 2018

Another observation, this time related to the Lighthouse extension.
The Lighthouse extension (3.0.2) itself is also not setting/overriding the support for touch.

Steps to reproduce:

  • Open https://tolwin.spdns.org/test/test_touch.html
  • Open Chrome devtools, select a device with touch support (e.g. nexus 5x).
  • Close devtools again
  • Run Lighthouse extension ==> The report is executed by a device with touch support
  • Close Lighthouse extension.
  • Open devtools again
  • Switch to a device without touch support (e.g. desktop)
  • Close devtools.
  • Run extension again ==> This time the report is executed by a device WITHOUT touch support.

This seems wrong to me. The lighthouse extension report says, that it was using "Device: Emulated Nexus 5X". This should always have touch support then.
Lighthouse Report.pdf

@patrickhulce
Copy link
Collaborator

Thanks for reporting @Svenmay you're right this seems to have regressed. LH certainly used to emulate touch devices but at some point the code was removed because DevTools was supposed to handle it through the protocol. It seems that's not happening though so we might need to bring our support back.

@patrickhulce
Copy link
Collaborator

So it seems like #4914 switched to start using setEmitTouchEventsForMouse instead of setTouchEmulationEnabled, setTouchEmulationEnabled seems to be what we actually want. We don't actually have any mouse input we just want the page to think that touch input is available.

Moving back to setTouchEmulationEnabled seems to fix the problem.

@paulirish
Copy link
Member

@Svenmay hugely appreciate you reporting this bug! our bad. we'll ship this fix in 3.0.3 in a week or two, and you'll see it in WPT then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants