diff options
Diffstat (limited to 'chromium/net/data/proxy_resolver_v8_tracing_unittest/terminate.js')
-rw-r--r-- | chromium/net/data/proxy_resolver_v8_tracing_unittest/terminate.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chromium/net/data/proxy_resolver_v8_tracing_unittest/terminate.js b/chromium/net/data/proxy_resolver_v8_tracing_unittest/terminate.js new file mode 100644 index 00000000000..88fe4cb2389 --- /dev/null +++ b/chromium/net/data/proxy_resolver_v8_tracing_unittest/terminate.js @@ -0,0 +1,20 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +var g_iteration = 0; + +function FindProxyForURL(url, host) { + g_iteration++; + + var ip1 = dnsResolve("host1"); + var ip2 = dnsResolveEx("host2"); + + if (ip1 == "182.111.0.222" && ip2 == "111.33.44.55") + return "PROXY foopy:" + g_iteration; + + // If the script didn't terminate when abandoned, then it will reach this and + // hang. + for (;;) {} + throw "not reached"; +} |