W3C home > Mailing lists > Public > public-webapps-testsuite@w3.org > August 2013

Re: [eventsource-tests] {dedicated-worker,shared-worker}/eventsource-constructor-non-same-origin

From: Arthur Barstow <art.barstow@nokia.com>
Date: Tue, 13 Aug 2013 10:47:47 -0400
Message-ID: <520A4713.9060304@nokia.com>
To: Simon Pieters <simonp@opera.com>
CC: "public-webapps-testsuite@w3.org" <public-webapps-testsuite@w3.org>
On 8/13/13 10:08 AM, ext Simon Pieters wrote:
> On Tue, 13 Aug 2013 15:47:54 +0200, Arthur Barstow 
> <art.barstow@nokia.com> wrote:
>
>> Hi Simon - but isn't that new line commented-out? [Sorry for my JS 
>> newbie Qs]
>
> The test is doing a non-obvious trick. It's commented out from the 
> initial HTML page load. However, the test then opens a worker with the 
> same URL (modulo the fragment), which means that the same source gets 
> interpreted as javascript by the worker. In javascript, <!-- is a line 
> comment (like //), so the code at the top gets executed, while the 
> part between /* ... */ is ignored.
>
> I was the one who came up with and started using the above trick, so 
> sorry for causing confusion. :-)

Wow ;-).

It seems like this test is more complicated than it needs to be to just 
test the one line of the spec Odin referenced. For starters, it seems 
like the fail function only needs to be called once. Additionally, it 
seems like it would be a bit clearer if the URL was actually valid and 
the test.step could be be crafted so it just needs to make a single check.

As is, this test seems to just re{test,state} that Chrome doesn't 
properly handle invalid URLs in the EventSource constructor which 
appears to be already tested by eventsource-constructor-url-bogus.htm.

-AB
Received on Tuesday, 13 August 2013 14:48:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:52:58 UTC