Bug 137581

Summary: [iOS] DumpRenderTree fails to render every other test when pixel tests are on
Product: WebKit Reporter: David Farler <dfarler>
Component: Tools / TestsAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: dbates, ddkilzer, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: All   
Bug Depends on:    
Bug Blocks: 139314    
Attachments:
Description Flags
Patch none

Description David Farler 2014-10-09 16:04:56 PDT
When running DumpRenderTree with --pixel-tests, PNG data gets dumped to stdout before the test has finished rendering. This happens regardless of whether the iOS app is in the foreground or background.

The consequence:
1. When running the first pixel test "A" on a freshly launched DRT, you get a blank image.
2. Running subsequent test "B" is "one behind", and the previous contents for test "A" are dumped, although "B" does eventually appear in app.

Steps to reproduce:

Build iOS for iphonesimulator

open -a $(xcode-select --print-path)/Applications/iOS\ Simulator.app

DYLD_FRAMEWORK_PATH=/absolute/path/to/OpenSource/WebKitBuild/Release-iphonesimulator DYLD_LIBRARY_PATH=/absolute/path/to/OpenSource/WebKitBuild/Release-iphonesimulator /path/to/OpenSource/WebKitBuild/Release/LayoutTestRelay -runtime com.apple.CoreSimulator.SimRuntime.iOS-8-3 -deviceType com.apple.CoreSimulator.SimDeviceType.iPhone-5s -suffix 0 -productDir /absolute/path/to/OpenSource/WebKitBuild/Release-iphonesimulator -app /absolute/path/to/OpenSource/WebKitBuild/Release-iphonesimulator/DumpRenderTree.app -- --pixel-test - | tee /tmp/test.txt

# Now listening to stdin, paste the following twice

/absolute/path/to/OpenSource/LayoutTests/compositing/regions/fixed-in-named-flow-position-changed.html

^C

Now, there will be two PNGs in /tmp/test.txt - paste each into their own image files. Observe.
Comment 1 David Farler 2014-10-09 16:07:10 PDT
Specify your `-runtime` as necessary
Comment 2 David Farler 2014-10-15 10:07:13 PDT
Another effect that I noticed here after smfr's change to wait for the web thread is that if you keep passing in tests with pixel dumps requested, essentially every other test will do the right thing, otherwise resetting to a blank view. Before, it would always be "one behind." So, there's still some state getting in the way.

This behavior only happens with --pixel-tests passed at the command line to DumpRenderTree (all tests in server loop mode are pixel tests), or '-p is appended to individual tests in server loop mode.

In light of this, I'm retitling the bug to reflect this.
Comment 3 David Farler 2014-10-15 10:07:36 PDT
<rdar://problem/18642906>
Comment 4 Daniel Bates 2014-12-05 10:44:37 PST
Created attachment 242643 [details]
Patch
Comment 5 Daniel Bates 2014-12-05 14:12:46 PST
Comment on attachment 242643 [details]
Patch

Clearing flags on attachment: 242643

Committed r176872: <http://trac.webkit.org/changeset/176872>
Comment 6 Daniel Bates 2014-12-05 14:12:52 PST
All reviewed patches have been landed.  Closing bug.