Closed Bug 431774 Opened 14 years ago Closed 14 years ago

test_bug261425.js doesn't test what it was supposed to

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9

People

(Reporter: Gavin, Assigned: Gavin)

Details

Attachments

(1 file, 2 obsolete files)

It tries to ensure that the "spec" and "host" nsIURI setters throw, but it's using "setHost" and "setSpec", which don't exist in JS. It should use ".host" and ".spec" instead.
Attached patch fix the test (obsolete) — Splinter Review
When I make this change, the second test no longer passes:

../../_tests/xpcshell-simple/test_necko/unit/test_bug261425.js: FAIL
../../_tests/xpcshell-simple/test_necko/unit/test_bug261425.js.log:
>>>>>>>
*** test pending
*** exiting
*** CHECK FAILED: We didn't throw when a space was passed in the hostname!
JS frame :: c:/moz/mozilla/tools/test-harness/xpcshell-simple/head.js :: do_throw :: line 99
JS frame :: ../../_tests/xpcshell-simple/test_necko/unit/test_bug261425.js :: run_test :: line 18
JS frame :: c:/moz/mozilla/tools/test-harness/xpcshell-simple/tail.js :: _execute_test :: line 41
JS frame :: c:/moz/mozilla/tools/test-harness/xpcshell-simple/execute_test.js :: <TOP_LEVEL> :: line 38
2147500036
*** FAIL ***
Filed bug 431890 about the failure.
Assignee: nobody → gavin.sharp
Attachment #318924 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #319052 - Flags: review?(cbiesinger)
Target Milestone: --- → mozilla1.9
Comment on attachment 319052 [details] [diff] [review]
fix the tests, disable the one that fails

+    success = /NS_ERROR_MALFORMED_URI/.test(e);

this should work:
success = e.result == Components.results.NS_ERROR_MALFORMED_URI;

(do test that it does though :) )

+    success = /NS_ERROR_MALFORMED_URI/.test(e);

and here
Attachment #319052 - Flags: review?(cbiesinger) → review+
Attached patch for checkinSplinter Review
Attachment #319052 - Attachment is obsolete: true
mozilla/netwerk/test/unit/test_bug261425.js 	1.2 
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.