-
Notifications
You must be signed in to change notification settings - Fork 157
any postMessage to TestSwarm kills the test iframe #272
Comments
Thanks for posting this issue @jsgoupil. I can confirm this as responsible for my own Testswarm failures to save results: any non-Testswarm I would recommend two updates:
I'd be happy to create a pull request with these changes if the project leaders are interested. Background: |
Thanks @jsgoupil and @editor. Those are excellent suggestions. How would the following changes sound?
|
Those changes, together, seem great @Krinkle. What we have today, more or less, is piece two without piece one. These two changes wouldn't account for the sending of I'd be beyond happy to contribute any or all these two changes via pull request. Just let me know how I can help. |
Restricting the target origin by using the swarmURL parameter sounds good as well, I have no opposition to that. It isn't strictly necessary, but it's a good habit. I'd love to get a pull request for this. Let me know if you need any pointers. |
Our tests use some parent.postMessage which usually points to ourselves (since we are the topmost)
However, in an iFrame scenario, that postMessage will post to TestSwarm. In this case, TestSwarm is configured to send anything to the server; on success, it kills the iFrame.
This causes the test to never resolve as it never posts its result back.
I agree my test should not post to a parent that it is not aware of, but at least, my test could fail instead of silently be stopped.
A mechanism should be in place to listen to a specific set of message such as
__TESTSWARM__restOfMessage
When run.js reads the message, if the first bytes don't start with that string constant, you could ignore the message.
The text was updated successfully, but these errors were encountered: