Closed Bug 1380346 Opened 7 years ago Closed 7 years ago

Improve screenshare testing

Categories

(Core :: WebRTC: Audio/Video, enhancement, P3)

55 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: dminor, Assigned: pehrsons)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

As per https://bugzilla.mozilla.org/show_bug.cgi?id=1379743#c5 we could do a lot better with our screenshare testing.
Should be doable to write a test that opens e.g. a black window then overtake it with a red window and check for pixel updates (after bug 1395289 I'd say in four quadrants of the capture).
Agree. We can make a 4x4 canvas cover the entire viewport - then check a couple of pixels in each quadrant (they have different colors) in the screenshare to see that we get what we expect. I can take this.
Assignee: nobody → apehrson
Rank: 25
There are also webrtc.org screensharing unit tests. They are not currently enabled, I'll file a separate bug to get them running.
See Also: → 1395566
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Status: NEW → ASSIGNED
Comment on attachment 8908225 [details] Bug 1380346 - Modernize test_gUM_basicScreenShare.html. https://reviewboard.mozilla.org/r/179892/#review187772 ::: dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html:62 (Diff revision 1) > + await Promise.all([ > + () => testVideo.srcObject.getVideoTracks()[0].applyConstraints({ > mediaSource: 'screen', > width: 200, > height: 200, > frameRate: { > min: '5', > max: '10' > } > - } > - ]; > - return Promise.resolve() > + }), > + () => listenUntil(testVideo, "resize", () => true), > + ]); This is good. Another pattern I like is: let p = listenUntil(testVideo, "resize", () => true); await testVideo.srcObject.getVideoTracks()[0].applyConstraints(c); await p; I go back and forth on which is more readable.
Attachment #8908225 - Flags: review?(jib) → review+
Comment on attachment 8908226 [details] Bug 1380346 - CaptureStreamTestHelper shouldn't need a full-size canvas to extract a pixel. https://reviewboard.mozilla.org/r/179894/#review187776 ::: dom/canvas/test/captureStream_common.js:62 (Diff revision 1) > * |video| as an array of the pixel's color channels: [R,G,B,A]. Allows > * optional scaling of the drawImage() call (so that a 1x1 black image scaling is no longer optional afaict ::: dom/canvas/test/captureStream_common.js:66 (Diff revision 1) > - getPixel: function (video, offsetX, offsetY, width, height) { > + getPixel: function (video, offsetX, offsetY) { > offsetX = offsetX || 0; // Set to 0 if not passed in. > offsetY = offsetY || 0; // Set to 0 if not passed in. use argument defaults to remove need for comment.
Attachment #8908226 - Flags: review?(jib) → review+
Comment on attachment 8908227 [details] Bug 1380346 - Let CaptureStreamTestHelper2D.drawColor draw squares wherever you want. https://reviewboard.mozilla.org/r/179896/#review187778
Attachment #8908227 - Flags: review?(jib) → review+
Comment on attachment 8908228 [details] Bug 1380346 - Verify screensharing content in mochitest. https://reviewboard.mozilla.org/r/179898/#review187780 \o/ ::: commit-message-de597:6 (Diff revision 1) > +Note that going fullscreen requires the tab (and window) to be in the foreground > +and having focus. maybe add this as a code comment as well? ::: dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html:36 (Diff revision 1) > + {dx: 0, dy: 0}, > + {dx: 1, dy: 3}, > + {dx: 8, dy: 5}, > + ]; > + for (let {dx, dy} of areaSamples) { > + let x = offsetX + dx + internalX; trailing space
Attachment #8908228 - Flags: review?(jib) → review+
Attachment #8908243 - Flags: review?(jib) → review+
Assertion failure on windows: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1cda02d4f1fae6c85e96f82ac13690299fca3c1 Looks like we're capturing the mouse cursor on the wrong thread.
Depends on: 1402818
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/455e69f2d765 Modernize test_gUM_basicScreenShare.html. r=jib https://hg.mozilla.org/integration/autoland/rev/7550c9bb04d7 CaptureStreamTestHelper shouldn't need a full-size canvas to extract a pixel. r=jib https://hg.mozilla.org/integration/autoland/rev/7a17cc8d3069 Let CaptureStreamTestHelper2D.drawColor draw squares wherever you want. r=jib https://hg.mozilla.org/integration/autoland/rev/5fd2e18c9007 Verify screensharing content in mochitest. r=jib https://hg.mozilla.org/integration/autoland/rev/9498c22c35fe Apply applyConstraints() properly. r=jib
Depends on: 1407842
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: