gecko-dev/testing/xpcshell/example/unit/test_check_nsIException.js
Jim Blandy 58ad28120e Bug 899757: Make nsServerSocket::InitWithAddress provide more detailed error results. r=mayhemer, r=ted
I looked through the NSPR socket creation functions that InitWithAddress
uses to see which errors they could return, and placed appropriate comments
in ErrorAccordingToNSPR.

The test coverage is not great; in particular, I wasn't able to find a way
to elicit "address in use" errors from Windows (although I could from
Linux); the web says that Windows is much more relaxed about binding
listening sockets than Unix derivatives. I'm interested in suggestions.
2013-09-06 08:06:22 -07:00

12 lines
400 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function run_test() {
let env = Components.classes["@mozilla.org/process/environment;1"]
.getService(Components.interfaces.nsIEnvironment);
do_check_throws_nsIException(function () {
env.QueryInterface(Components.interfaces.nsIFile);
}, "NS_NOINTERFACE");
}