| <!-- webkit-test-runner [ IPCTestingAPIEnabled=true ] --> | |
| <p>This test passes if WebKit does not crash.</p> | |
| <script src="../resources/ipc.js"></script> | |
| <script> | |
| if (window.testRunner) { | |
| testRunner.dumpAsText(); | |
| testRunner.waitUntilDone(); | |
| } | |
| window.setTimeout(async () => { | |
| if (!window.IPC) | |
| return window.testRunner?.notifyDone(); | |
| const { CoreIPC } = await import('./coreipc.js'); | |
| const renderingBackendIdentifier = randomIPCID(); | |
| const connection = CoreIPC.newStreamConnection(); | |
| CoreIPC.GPU.GPUConnectionToWebProcess.CreateRenderingBackend(0, { renderingBackendIdentifier: renderingBackendIdentifier, connectionHandle: connection }); | |
| const remoteBackend = connection.newInterface("RemoteRenderingBackend", renderingBackendIdentifier); | |
| // The pixel formats to test. | |
| const pixelFormats = [ | |
| 0, // RGBX8 | |
| 1, // RGBA8 | |
| 2, // BGRX8 | |
| 3, // BGRA8 | |
| 4, // RGBA16F, if ENABLE(PIXEL_FORMAT_RGBA16F) | |
| 5, // RGB10, if ENABLE(PIXEL_FORMAT_RGB10) | |
| 6, // RGB10A8, if ENABLE(PIXEL_FORMAT_RGB10A8) | |
| 7 // Always out of range. | |
| ]; | |
| // Iterate through each pixel format and create image buffer | |
| for (let format of pixelFormats) { | |
| try { | |
| remoteBackend.CreateImageBuffer({ | |
| logicalSize: { width: 69, height: 67 }, | |
| renderingMode: 1, | |
| renderingPurpose: 2, | |
| resolutionScale: 96, | |
| colorSpace: { | |
| serializableColorSpace: { | |
| alias: { | |
| optionalValue: { | |
| m_cgColorSpace: { | |
| alias: { | |
| variantType: 'RetainPtr<CFStringRef>', | |
| variant: 'A' | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| bufferFormat: { pixelFormat: format, useLosslessCompression: 0 }, | |
| identifier: randomIPCID(), | |
| contextIdentifier: randomIPCID() | |
| }); | |
| } catch {} | |
| } | |
| connection.connection.invalidate(); | |
| window.testRunner?.notifyDone(); | |
| }, 10); | |
| </script> |