| <p>This is a test for https://bugs.webkit.org/show_bug.cgi?id=71229 (V8MessageEvent::dataAccessorGetter does not return a reference to its caller). If it succeeds, DONE will appear below. If it fails, you should see messages containing unexpected strings that were received and/or a renderer crash. |
| document.getElementById("log").innerHTML += message + "<br>"; |
| // Make a long prefix string. This seems to make it more likely that a use- |
| // after-free problem will cause an observable error. |
| for (var i = 0; i < 10; ++i) |
| function HandleMessage(message_event) { |
| if (message_event.data !== kPrefix + num.toString()) { |
| log("Expected '" + num + "', Got: '" + message_event.data + "'"); |
| setTimeout(SendString, 0); |
| var target = document.getElementById("event_target"); |
| var message_event = window.document.createEvent('MessageEvent'); |
| message_event.initMessageEvent('message', // type |
| kPrefix + num.toString(), // data |
| target.dispatchEvent(message_event); |
| var target = document.getElementById("event_target"); |
| target.addEventListener("message", HandleMessage, false); |
| document.addEventListener("DOMContentLoaded", AddListener, false); |
| testRunner.waitUntilDone(); |
| <div id="event_target"></div> |