summaryrefslogtreecommitdiff
path: root/chromium/net/data/proxy_resolver_v8_unittest/terminate.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/data/proxy_resolver_v8_unittest/terminate.js')
-rw-r--r--chromium/net/data/proxy_resolver_v8_unittest/terminate.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/chromium/net/data/proxy_resolver_v8_unittest/terminate.js b/chromium/net/data/proxy_resolver_v8_unittest/terminate.js
new file mode 100644
index 00000000000..08d92891907
--- /dev/null
+++ b/chromium/net/data/proxy_resolver_v8_unittest/terminate.js
@@ -0,0 +1,26 @@
+// 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.
+
+function FindProxyForURL(url, host) {
+ if (host != 'hang')
+ return 'PROXY ' + host + ':88';
+
+ var ip = dnsResolve("host1");
+
+ // The following may or may not be executed, even if dnsResolve() terminates
+ // the script execution.
+ dnsResolveEx("host2");
+ dnsResolveEx("host3");
+ alert("hahaha");
+
+ // Hang!
+ for (;;) {}
+
+ // The following definitely won't be executed, since control should never
+ // make it past the preceding hang.
+ dnsResolve("host4");
+ dnsResolve("host5");
+ alert("uhm...");
+ throw "not reached";
+}