Bug 193108

Summary: [ Mojave WK1 ] Some Image tests are flakey failures and are failing in tandem with zoomed in or blank image results
Product: WebKit Reporter: Truitt Savell <tsavell>
Component: Tools / TestsAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jlewis3, lforschler, ryanhaddad, sabouhallawa, simon.fraser, sroberts, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=193107
https://bugs.webkit.org/show_bug.cgi?id=193091
https://bugs.webkit.org/show_bug.cgi?id=192881
https://bugs.webkit.org/show_bug.cgi?id=193116
https://bugs.webkit.org/show_bug.cgi?id=190383
Attachments:
Description Flags
Patch none

Description Truitt Savell 2019-01-03 08:48:05 PST
There seems to be a fair amount of image tests that are flakey failures due to a zoomed in or blank rendered result. These tests also appear to be failing in tandem in small groups. These tests are not all part of the same directory but are displaying very similar failures. 

Bugs:
https://bugs.webkit.org/show_bug.cgi?id=193107
https://bugs.webkit.org/show_bug.cgi?id=193091
https://bugs.webkit.org/show_bug.cgi?id=192881
Comment 1 Truitt Savell 2019-01-03 11:39:05 PST
another set of tests appear to exhibiting this issue.

https://bugs.webkit.org/show_bug.cgi?id=193116
Comment 2 Truitt Savell 2019-01-04 09:28:33 PST
It appears that Image tests on Mojave WK1 in general have this zooming or blank issue. 

Here is a run with 15 failing image tests with many of them showing a zoomed in result:
https://build.webkit.org/results/Apple%20Mojave%20Release%20WK1%20(Tests)/r239610%20(1925)/results.html
Comment 3 Radar WebKit Bug Importer 2019-01-04 09:32:48 PST
<rdar://problem/47049667>
Comment 4 Shawn Roberts 2019-02-06 10:06:27 PST
Another set of tests exhibiting this issue.

https://build.webkit.org/results/Apple%20Mojave%20Release%20WK1%20(Tests)/r241018%20(2754)/results.html
Comment 7 Said Abou-Hallawa 2019-07-15 15:15:21 PDT
This bug is happening because of a bug in CGWindowListCreateImage() in which it returns the wrong size snapshot when changing the window deviceScaleFactor from 2 to 1.

When running DRT, the bug happens only when running a hidpi test followed by a composite layout test. To fake the hipdi the deviceScaleFactor is set manually to 2. Before running a new test, the deviceScaleFactor has to be set back to 1. But this does not make CGWindowListCreateImage() works correctly in this case.

When createBitmapContextFromWebView() calls CGContextDrawImage(), only the bottom left quarter snapshot is drawn from the snapshot image to the bitmapContext. Most of the layout tests do not draw in this part of the WebView. So the result is seen as blank.

Like what we did in WebViewImpl::takeViewSnapshot() as a workaround for <rdar://problem/17084993>, we have to do similar workaround for DRT function createBitmapContextFromWebView().
Comment 8 Said Abou-Hallawa 2019-07-15 15:22:32 PDT
Created attachment 374154 [details]
Patch
Comment 9 WebKit Commit Bot 2019-07-15 19:32:48 PDT
Comment on attachment 374154 [details]
Patch

Clearing flags on attachment: 374154

Committed r247466: <https://trac.webkit.org/changeset/247466>
Comment 10 WebKit Commit Bot 2019-07-15 19:32:50 PDT
All reviewed patches have been landed.  Closing bug.