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
,
Sep 14
guidou@ can you please confirm/triage? Thanks
,
Sep 14
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.
,
Sep 14
Assigning to reillyg@ since this issue is specific to image capture.
,
Sep 17
,
Sep 18
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
,
Sep 18
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
,
Sep 18
,
Jan 11
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 |
||||||||
Comment 1 by mcasas@chromium.org
, Sep 14