1 // This script should be run in an environment where all DNS resolution are
2 // failing. It tests that functions return the expected values.
4 // Returns "PROXY success:80" on success.
5 function FindProxyForURL(url, host) {
7 expectEq("127.0.0.1", myIpAddress());
8 expectEq("", myIpAddressEx());
10 expectEq(null, dnsResolve("not-found"));
11 expectEq("", dnsResolveEx("not-found"));
13 expectEq(false, isResolvable("not-found"));
14 expectEq(false, isResolvableEx("not-found"));
16 return "PROXY success:80";
19 return "PROXY failed:80";
23 function expectEq(expected, actual) {
24 if (expected != actual)
25 throw "Expected " + expected + " but was " + actual;