On Tue, Oct 9, 2012 at 11:41 PM, Boris Zbarsky <bzbar...@mit.edu> wrote:

> On 10/10/12 12:23 AM, Ian Bicking wrote:
>
>> Here's how I think you'd write a simple XHR test in both:
>>
>> // SimpleTest aka MochiTest
>> req = new XMLHttpRequest();
>> req.open("GET", "/example.json");
>>
>
> How did example.json get there?
>
> What if you need to test CORS?
>
> With mochitest at this point you're doing some SJS work and whatnot.
>
>  // testharness
>>
>
> And here you have to go and do whatever is appropriate to your server
> setup.  Which is not part of testharness.  Which is why the CORS tests
> imported from Opera to the W3C ended up all broken, because they did not
> configure the server correctly.
>

OK – so if I understand the objection to testharness isn't anything in
testharness.js itself, but that it's an incomplete solution as it doesn't
define an environment?  That is, MochiTest gives an environment where we
can define resources at a variety of URLs and serve them with arbitrary
headers, and so you can define tests that are more complete and
self-contained.  There's also stuff like permission overrides, which are
really just about how MochiTest sets up the environment, and of course that
stuff by its nature is not portable.  But of course if you can't override
permission checks it makes testing annoying.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to