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

On Tue, 13 Aug 2013 16:47:47 +0200, Arthur Barstow <art.barstow@nokia.com>  
wrote:

> 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.

Odin didn't reference just that, he also referenced:

On Tue, 13 Aug 2013 09:56:09 +0200, Odin Hørthe Omdal <odinho@opera.com>  
wrote:

> http://www.w3.org/TR/2012/CR-eventsource-20121211/#dom-eventsource
> Algorithm step 7. (the CORS part)

which is the primary thing it's testing. The other thing he referenced was  
just explaining what part of the spec justified having an  
EventSource-in-workers test at all.

> 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.

The URLs in this test aren't invalid, they just fail the CORS check. So  
it's not the same.

-- 
Simon Pieters
Opera Software

Received on Tuesday, 13 August 2013 15:01:03 UTC