Bug 193108 - [ Mojave WK1 ] Some Image tests are flakey failures and are failing in tandem with zoomed in or blank image results
Summary: [ Mojave WK1 ] Some Image tests are flakey failures and are failing in tandem...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
Keywords: InRadar
Depends on:
Reported: 2019-01-03 08:48 PST by Truitt Savell
Modified: 2019-07-15 19:32 PDT (History)
9 users (show)

See Also:

Patch (3.46 KB, patch)
2019-07-15 15:22 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. 

Comment 1 Truitt Savell 2019-01-03 11:39:05 PST
another set of tests appear to exhibiting this issue.

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:
Comment 3 Radar WebKit Bug Importer 2019-01-04 09:32:48 PST
Comment 4 Shawn Roberts 2019-02-06 10:06:27 PST
Another set of tests exhibiting this issue.

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]
Comment 9 WebKit Commit Bot 2019-07-15 19:32:48 PDT
Comment on attachment 374154 [details]

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.