New issue
Advanced search Search tips

Issue 884125 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Image Capture: OperationError is not thrown when the MediaStreamTrack is stopped while invoking getPhotoCapabilities()/getPhotoSettings()

Reported by xiuqix.j...@intel.com, Sep 14

Issue description

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

Steps to reproduce the problem:
Debug in the console as below:
  let canvas = document.createElement("canvas");
  document.body.appendChild(canvas);
  let context = canvas.getContext('2d');
  context.fillStyle = 'red';
  context.fillRect(0, 0, 10, 10);
  let stream = canvas.captureStream();
  let videoTrack = stream.getVideoTracks()[0];
  let capturer = new ImageCapture(videoTrack);
  capturer.getPhotoCapabilities();
  capturer.getPhotoSettings();
  videoTrack.stop();

What is the expected behavior?
Throw "OperationError" error.

What went wrong?
OperationError is not thrown.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 68.0.3440.106  Channel: canary
OS Version: 10.0
Flash Version: 

According to spec: 
https://w3c.github.io/mediacapture-image/#dom-imagecapture-getphotocapabilities
References relevant tests in WPT:
https://github.com/web-platform-tests/wpt/blob/master/mediacapture-image/getPhotoCapabilities.html#L61
https://github.com/web-platform-tests/wpt/blob/master/mediacapture-image/getPhotoSettings.html#L46
 
Components: Blink>ImageCapture Blink>MediaStream
Owner: guidou@chromium.org
guidou@ can you please confirm/triage? Thanks
Labels: Needs-Feedback
xiuqix.jiang@ can you confirm that the issue is not that the promises returned by getPhotoCapabilities()/getPhotoSettings() are resolved before the call to stop() is processed? The algorithm is supposed to run "in parallel" so I'm not sure there's a way to test this that isn't fundamentally racy.
Components: -Blink>MediaStream
Owner: reillyg@chromium.org
Assigning to reillyg@ since this issue is specific to image capture.
Labels: Needs-Triage-M68
I add some console log to see the execution secquency, see code snippet below: 

let capturer = new ImageCapture(videoTrack);
  capturer.getPhotoCapabilities()
  .then(() => {console.log(videoTrack.readyState);console.log("1");})
  .catch(() => {console.log("2")})
  console.log("3");
  videoTrack.stop();
  console.log(videoTrack.readyState); 

The expected result: 3 => ended => 2
The actual result: 3 => ended => ended => 2 
Project Member

Comment 7 by sheriffbot@chromium.org, Sep 18

Cc: reillyg@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: rijubrat...@intel.com
Status: Assigned (was: Unconfirmed)
This issue has an owner, a component and a priority, but is still listed as untriaged or unconfirmed. By definition, this bug is triaged. Changing status to "assigned". Please reach out to me if you disagree with how I've done this.

Sign in to add a comment