| <script src="../../resources/js-test.js"></script> |
| description('Tests that serialized image buffers account for neutered state.'); |
| window.jsTestIsAsync = true; |
| function checkState(state) { |
| var elementCount = state.width * state.height; |
| for (var i = 0; i < elementCount; ++i) { |
| if (state.data[i] != 0) { |
| testFailed("Found non-zero data."); |
| testPassed("Found only zeros."); |
| testRunner.dumpAsText(true); |
| testRunner.waitUntilDone(); |
| var id = new ImageData(1, 256); |
| // This will neuter the data buffer. |
| postMessage("", "*", [id.data.buffer]); |
| history.pushState(id, ""); |
| checkState(history.state); |
| <body onload="runTest()"> |