Closed Bug 1570147 Opened 5 years ago Closed 5 years ago

Add tests for the new drawSnapshot API

Categories

(Core :: Graphics, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: whimboo, Assigned: mattwoodrow, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

As spoken with Matt on IRC there are currently no tests for this new API. It would be very helpful to have at least a basic set of tests to verify its functionality.

It's not a real hard-blocker for bug 1559592, but it would be good to keep track of it, and to not downgrade the reliability for users of Marionette and geckodriver.

Flags: needinfo?(matt.woodrow)
Priority: -- → P3
Depends on: 1569930, 1569974
Depends on: 1571341

Depends on D41827

Assignee: nobody → matt.woodrow
Flags: needinfo?(matt.woodrow)
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4b4feec0a4e2
Add SpecialPowers API for calling drawSnapshot in the parent and returning the results. r=kmag
https://hg.mozilla.org/integration/autoland/rev/4d528be8bae4
Modify existing drawWindow tests to take a callback for the inner draw function. r=kmag
https://hg.mozilla.org/integration/autoland/rev/7a24b9027519
Add test for drawSnapshot. r=kmag
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b5d442a2f457
Fix linting error in file_drawWindow_common.js r=lint-fix CLOSED TREE
Backout by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1f3fcdc28dfd
Backed out 4 changesets for causing failures in test_drawSnapshot.html

Backed out 4 changesets for causing failures in test_drawSnapshot.html

Backout link: https://hg.mozilla.org/integration/autoland/rev/1f3fcdc28dfd

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=android%2C7.0%2Cx86-64%2Cdebug%2Cmochitests%2Ctest-android-em-7.0-x86_64%2Fdebug-geckoview-mochitest-e10s-1%2Cm%281%29&fromchange=be174ffafb1d907a290e5838cca043ead0cd9443&tochange=c1683d4d191a40572b799947933b65aa94384209

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=261745754&repo=autoland&lineNumber=4992

[task 2019-08-15T08:11:26.643Z] 08:11:26 INFO - 1701 INFO TEST-START | dom/canvas/test/test_drawSnapshot.html
[task 2019-08-15T08:16:34.624Z] 08:16:34 INFO - Buffered messages logged at 08:11:25
[task 2019-08-15T08:16:34.624Z] 08:16:34 INFO - 1702 INFO TEST-PASS | dom/canvas/test/test_drawSnapshot.html | reftest comparison: == full draw of source on white background reference
[task 2019-08-15T08:16:34.624Z] 08:16:34 INFO - 1703 INFO TEST-PASS | dom/canvas/test/test_drawSnapshot.html | reftest comparison: != full draw of source on yellow background reference
[task 2019-08-15T08:16:34.624Z] 08:16:34 INFO - 1704 INFO TEST-PASS | dom/canvas/test/test_drawSnapshot.html | reftest comparison: == full draw of source on yellow background reference
[task 2019-08-15T08:16:34.624Z] 08:16:34 INFO - 1705 INFO TEST-PASS | dom/canvas/test/test_drawSnapshot.html | reftest comparison: == draw of subrect of source with matching background reference
[task 2019-08-15T08:16:34.624Z] 08:16:34 INFO - 1706 INFO TEST-PASS | dom/canvas/test/test_drawSnapshot.html | reftest comparison: == draw of subrect of source with different background reference
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - 1707 INFO TEST-PASS | dom/canvas/test/test_drawSnapshot.html | reftest comparison: == draw of subrect of source with different background reference
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - Buffered messages finished
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - 1708 INFO TEST-UNEXPECTED-FAIL | dom/canvas/test/test_drawSnapshot.html | Test timed out.
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - SimpleTest.ok@SimpleTest/SimpleTest.js:275:18
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - reportError@SimpleTest/TestRunner.js:121:22
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - TestRunner._checkForHangs@SimpleTest/TestRunner.js:142:18
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - 1709 INFO TEST-OK | dom/canvas/test/test_drawSnapshot.html | took 301923ms
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - 1710 INFO TEST-START | dom/canvas/test/test_drawWindow.html
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - 1711 INFO TEST-OK | dom/canvas/test/test_drawWindow.html | took 300ms
[task 2019-08-15T08:16:34.625Z] 08:16:34 INFO - 1712 INFO TEST-START | dom/canvas/test/test_filter.html
[task 2019-08-15T08:16:34.626Z] 08:16:34 INFO - 1713 INFO TEST-OK | dom/canvas/test/test_filter.html | took 80ms

Flags: needinfo?(matt.woodrow)

Matt, I have a problem to get the fix from bug 1571341 working from within JS. Also I do not see any test here which utilizes the new flags argument. Would you mind adding one, or explain how it should work? Whatever values I use for the flags, I actually do not see a difference. Not sure what I'm doing wrong. Thanks.

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #8)

Matt, I have a problem to get the fix from bug 1571341 working from within JS. Also I do not see any test here which utilizes the new flags argument. Would you mind adding one, or explain how it should work? Whatever values I use for the flags, I actually do not see a difference. Not sure what I'm doing wrong. Thanks.

I went through all the drawWindow callers, and the only ones using the DRAW_VIEW flag were also using USE_WIDGET_LAYERS. Given that we're not supporting the USE_WIDGET_LAYERS use case with this API, I just removed the flags bit entirely for now.

Snapshotting whole documents (outside of the viewport) seems to work for me though, does it not for you?

Flags: needinfo?(matt.woodrow)
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/19443ebbd552
Add SpecialPowers API for calling drawSnapshot in the parent and returning the results. r=kmag
https://hg.mozilla.org/integration/autoland/rev/7ef0d6f34119
Modify existing drawWindow tests to take a callback for the inner draw function. r=kmag
https://hg.mozilla.org/integration/autoland/rev/db86b932e899
Add test for drawSnapshot. r=kmag
https://hg.mozilla.org/integration/autoland/rev/11919743f599
Use a Set for HiddenFrame.jsm, so that GC can't clean up frames that we're sitll waiting on. r=kmag

(In reply to Matt Woodrow (:mattwoodrow) from comment #9)

Snapshotting whole documents (outside of the viewport) seems to work for me though, does it not for you?

The problem I have is actually with Bugzilla like this page. If you try to screenshot you only get the current viewport. But talking to different people yesterday the problem seems to be the overlay Bugzilla uses for top-level scrolling. I assume there is no way to create a screenshot of the full document?

Flags: needinfo?(matt.woodrow)

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #12)

(In reply to Matt Woodrow (:mattwoodrow) from comment #9)

Snapshotting whole documents (outside of the viewport) seems to work for me though, does it not for you?

The problem I have is actually with Bugzilla like this page. If you try to screenshot you only get the current viewport. But talking to different people yesterday the problem seems to be the overlay Bugzilla uses for top-level scrolling. I assume there is no way to create a screenshot of the full document?

Indeed, there's no easy way to do this sorry.

We have hacks in the platform to handle the case where the page itself scrolls within the viewport, to let us capture the full page without it being clipped to the viewport.

Pages like bugzilla that don't scroll, but instead use a viewport-sized element that has scrolled contents aren't supported in this way.

Flags: needinfo?(matt.woodrow)

(In reply to Matt Woodrow (:mattwoodrow) from comment #14)

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #12)

(In reply to Matt Woodrow (:mattwoodrow) from comment #9)

Snapshotting whole documents (outside of the viewport) seems to work for me though, does it not for you?

The problem I have is actually with Bugzilla like this page. If you try to screenshot you only get the current viewport. But talking to different people yesterday the problem seems to be the overlay Bugzilla uses for top-level scrolling. I assume there is no way to create a screenshot of the full document?

Indeed, there's no easy way to do this sorry.

We have hacks in the platform to handle the case where the page itself scrolls within the viewport, to let us capture the full page without it being clipped to the viewport.

Pages like bugzilla that don't scroll, but instead use a viewport-sized element that has scrolled contents aren't supported in this way.

Thanks Matt. Slightly off-topic now but let me ask a remaining last question to Dylan... Dylan, is there something possible with the design of Bugzilla to improve that? Maybe we should file a new bug in the Bugzilla component, if it is. Thanks

Flags: needinfo?(dylan)
Regressions: 1647894
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: