Fix page always failing when iframes are being used #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the page being loaded by run-jasmine.coffee (the main jasmine page) contains specs that load iframes, each of those iframes triggers the phantomjs page's onLoadFinished callback. This can cause problems where the jasmine page loads successfully but some of the iframes that get generated by specs fail. When this happens, you get the following error:
Unable to access Jasmine specs at http://127.0.0.1:8888/
To fix this, the onLoadFinished handler for the page is reset after the first time its called. This first status result is a guarantee that jasmine loaded successfully. All further calls to that callback can be ignored.
This is potentially an issue that should be fixed in phantomjs, but we can at least get a workaround in guard-jasmine until then.