| 1 | The Layout Test Protocol (LTP) is a line-based protocol for requesting layout tests from DumpRenderTree (DRT) or WebKitTestRunner (WKTR). Requests come into DRT/WKTR from standard input or into a socket. Responses leave DRT/WKTR via standard output/error or into a socket. The protocol works similarly to HTTP, where a content type and length are sent before blocks of data. A response consists of multiple chunks, all of which are optional: |
| 2 | |
| 3 | - RenderTree: The textual representation of the render tree |
| 4 | - Image: An image capture of the web view |
| 5 | - Audio: An audio capture during the test |
| 6 | - Error: Other textual output corresponding to standard error |
| 7 | - DumpMalloc: Number of committed virtual memory bytes |
| 8 | |
| 9 | Requests |
| 10 | |
| 11 | {{{ |
| 12 | Request -> [\n]+ Newline |
| 13 | }}} |
| 14 | |
| 15 | Responses |
| 16 | |
| 17 | |
| 18 | {{{ |
| 19 | Response -> RenderTree Image Audio Error DumpMalloc EOF |
| 20 | ContentLength: -> 'Content-Length: %lu' Newline |
| 21 | EOF -> '#EOF' Newline |
| 22 | Newline -> '\n' |
| 23 | |
| 24 | RenderTree -> ContentTypeText ContentLength Data |
| 25 | ContentTypeText -> 'Content-type: text/plain' Newline |
| 26 | Data -> bytes |
| 27 | |
| 28 | Image -> ContentTypePNG ContentLength Data |
| 29 | ContentTypePNG -> 'Content-type: image/png' Newline |
| 30 | |
| 31 | Audio -> ContentTypeAudio ContentLength Data |
| 32 | ContentTypeAudio -> 'Content-type: audio/wav' newline |
| 33 | |
| 34 | Error -> ContentTypeText ContentLength Text |
| 35 | |
| 36 | DumpMalloc -> 'DumpMalloc: %li' |
| 37 | |
| 38 | }}} |