Closed Bug 918706 Opened 11 years ago Closed 8 years ago

[XHR2] Wrong exception: "Illegal value" instead of "DOMException SyntaxError"

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: hsteen, Assigned: shawnjohnjr)

References

()

Details

(Whiteboard: [tw-dom] btpp-active)

Attachments

(1 file, 1 obsolete file)

Test cases that fail because the wrong type of exception is thrown:
http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/open-method-bogus.htm
(In reply to Hallvord R. M. Steen [:hallvors] from comment #0)
> Test cases that fail because the wrong type of exception is thrown:
> http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/open-method-
> bogus.htm

http://w3c-test.org/XMLHttpRequest/open-url-bogus.htm
(In reply to Shawn Huang [:shawnjohnjr] from comment #1)
> (In reply to Hallvord R. M. Steen [:hallvors] from comment #0)
> > Test cases that fail because the wrong type of exception is thrown:
> > http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/open-method-
> > bogus.htm
> 
> http://w3c-test.org/XMLHttpRequest/open-url-bogus.htm

opps. wrong url: http://w3c-test.org/XMLHttpRequest/open-method-bogus.htm
I would like to give it a try.
Assignee: nobody → shuang
Whiteboard: [tw-dom] → [tw-dom] btpp-active
Following https://xhr.spec.whatwg.org/#the-open()-method
"The open(method, url, async, username, password) method, when invoked, must run these steps:
 If method is not a method, throw a SyntaxError exception."

It looks like gecko simply throws "NS_ERROR_ILLEGAL_VALUE".
Comment on attachment 8731185 [details] [diff] [review]
Bug 918706 - Return NS_ERROR_DOM_SYNTAX_ERR if method is invalid

Review of attachment 8731185 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, but I expected to see some test changes too.  Did we start passing the web-platform-test for this?  If so, you need to change the metadata before you land.  If we pass unconditionally you can delete the metadata file in testing/web-platform/meta/XMLHttpRequest/open-method-bogus.htm.ini

You should be able to run this in our tree by doing:

./mach web-platform-tests testing/web-platform/tests/XMLHttpRequest/open-method-bogus.htm
Attachment #8731185 - Flags: review?(khuey) → review+
Hi
Thanks for the hint.
./mach web-platform-tests testing/web-platform/tests/XMLHttpRequest/open-method-bogus.htm

The result:

XMLHttpRequest: open() - bogus methods ()
-----------------------------------------
Expected FAIL, got PASS

XMLHttpRequest: open() - bogus methods (>)
------------------------------------------
Expected FAIL, got PASS

XMLHttpRequest: open() - bogus methods ( GET)
---------------------------------------------
Expected FAIL, got PASS

XMLHttpRequest: open() - bogus methods (G T)
--------------------------------------------
Expected FAIL, got PASS

XMLHttpRequest: open() - bogus methods (@GET)
---------------------------------------------
Expected FAIL, got PASS

XMLHttpRequest: open() - bogus methods (G:ET)
---------------------------------------------
Expected FAIL, got PASS

XMLHttpRequest: open() - bogus methods (GET?)
---------------------------------------------
Expected FAIL, got PASS

XMLHttpRequest: open() - bogus methods (GET
)
---------------------------------------------
Expected FAIL, got PASS

 0:05.67 LOG: Thread-TestrunnerManager-1 INFO Pausing until the browser exits
 0:14.45 LOG: Thread-TestrunnerManager-1 WARNING u'runner_teardown' ()
 0:14.45 LOG: Thread-TestrunnerManager-1 INFO No more tests
 0:14.45 LOG: MainThread INFO Running reftest tests
 0:14.45 LOG: MainThread INFO No reftest tests to run
 0:14.45 LOG: MainThread INFO Got 8 unexpected results
 0:14.45 SUITE_END: MainThread 
Summary
=======

Ran 9 tests (1 parents, 8 subtests)
Expected results: 1
Unexpected results: 8 (PASS: 8)

Unexpected Results
==================

/XMLHttpRequest/open-method-bogus.htm
-------------------------------------
PASS expected FAIL XMLHttpRequest: open() - bogus methods ()
PASS expected FAIL XMLHttpRequest: open() - bogus methods (>)
PASS expected FAIL XMLHttpRequest: open() - bogus methods ( GET)
PASS expected FAIL XMLHttpRequest: open() - bogus methods (G T)
PASS expected FAIL XMLHttpRequest: open() - bogus methods (@GET)
PASS expected FAIL XMLHttpRequest: open() - bogus methods (G:ET)
PASS expected FAIL XMLHttpRequest: open() - bogus methods (GET?)
PASS expected FAIL XMLHttpRequest: open() - bogus methods (GET
)
https://hg.mozilla.org/mozilla-central/rev/3a7616b8ac65
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.