New issue
Advanced search Search tips

Issue 755653 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 754708
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Emulation.setDeviceMetricsOverride doesn't ignore deviceScaleFactor = 0

Project Member Reported by skyos...@chromium.org, Aug 15 2017

Issue description

The Emulation.setDeviceMetricsOverride doesn't ignore a zero deviceScaleFactor like the documentation suggests.
 
Components: -Platform>Apps>DevTools Platform>DevTools>Platform
Cc: dgozman@chromium.org
Owner: pfeldman@chromium.org
Status: Assigned (was: Untriaged)
What do you mean by "doesn't ignore"? It should retain existing dpr in this case. Do you have any specific examples?
This was raised on the headless mailing list[1]. Basically the following script hangs but works if deviceScaleFactor is set to a non-zero value:

  const CDP = require('chrome-remote-interface');
                                                                                                                                                                               
  CDP((client) => {
    const {Page, Emulation, Runtime} = client;
    Page.loadEventFired(() => {
      Page.captureScreenshot().then((result) => {
        console.log(result);
        client.close();
      });
    });
    Promise.all([
      Page.enable(),
      Emulation.setDeviceMetricsOverride({
          "width": 1024, "height": 768,"screenWidth": 1024,
          "screenHeight": 768, "deviceScaleFactor": 0,
          "mobile": false})
    ]).then(() => {
      return Page.navigate({url: 'https://example.com'});
    });
  }).on('error', (err) => {
    console.error('Cannot connect to remote endpoint:', err);
  });

[1] https://groups.google.com/a/chromium.org/d/msgid/headless-dev/7414bfad-cbae-4cad-a575-41a5c8acfebe%40chromium.org?utm_medium=email&utm_source=footer
Mergedinto: 754708
Status: Duplicate (was: Assigned)
Thank you for details! I think this is a bug where captureScreenshot hangs when deviceScaleFactor = 0. See  issue 754708 .

Sign in to add a comment