-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for posting results using cross-origin communication. #3
Conversation
Where supported, the test harness will now also send messages using cross-document messaging to each ancestor browsing context. Since it uses the wildcard keyword (*), cross-origin communication is enabled and script on different origins can collect the results. This API follows similar conventions as those described above only slightly modified to accommodate message event API. Each message is sent by the harness is passed a single vanilla object, available as the `data` property of the event object. These objects are structures as follows: start - { type: "start" } result - { type: "result", test: Test } complete - { type: "complete", tests: [Test, ...], status: TestsStatus }
/cc @darobin |
Solved the pending WebKit issue (pollution of the console by error messages). This is ready to go. Happy to answer questions you might have, @jgraham, and/or revise commits. |
var msg = this.message; | ||
msg = msg ? String(msg) : msg; | ||
this._structured_clone = { | ||
PASS:0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could move these constants out into a seperate object so they are only defined in one place and write a merge function to copy the properties over, so that this code would look like
this._structured_clone = merge({name:String(this.name), status:this.status, message:message}, test_statuses)
and something similar when they are put on the Test prototype object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WFM. What about as a prop of the constructor?
Test.statuses = {...};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that sounds OK.
…ion in browsers that don't support it.
Hi James, Is there anything that still needs work on my side before this makes it in? If so, please LMK. Thanks, --tobie |
* == External API through cross-document messaging == | ||
* | ||
* Where supported, the test harness will also send messages using | ||
* cross-document messaging to each ancestor browsing context. Since it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this should be ancestor and opener
This is OK now, I think; I will assume that you fix the docs without needing another review cycle. Are you OK to push it to mercurial? |
Where supported, the test harness will now also send messages using
cross-document messaging to each ancestor browsing context. Since it
uses the wildcard keyword (*), cross-origin communication is enabled and
script on different origins can collect the results.
This API follows similar conventions as those described above only slightly
modified to accommodate message event API. Each message is sent by the harness
is passed a single vanilla object, available as the
data
property of theevent object. These objects are structures as follows:
start - { type: "start" }
result - { type: "result", test: Test }
complete - { type: "complete", tests: [Test, ...], status: TestsStatus }