Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: net/data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_resolve.js

Issue 950433002: Fix a crash when processing an invalid PAC script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add copyright to test data (placate presubmit) Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_resolve.js
diff --git a/net/data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_resolve.js b/net/data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_resolve.js
new file mode 100644
index 0000000000000000000000000000000000000000..d5b89328e37078b3e40ea3090a271dca005dfe1f
--- /dev/null
+++ b/net/data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_resolve.js
@@ -0,0 +1,21 @@
+// Copyright (c) 2015 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.
+
+// This PAC script will throw an exception when accessing the "FindProxyForURL"
+// the *second* time it is accessed.
+
+function actualFindProxyForURL(url, host) {
+ return "DIRECT";
+}
+
+var counter = 2;
+
+function FindProxyForURLGetter() {
+ counter--;
+ if (counter <= 0)
+ throw "crash!";
+ return actualFindProxyForURL;
+}
+
+Object.defineProperty(this, "FindProxyForURL", {get: FindProxyForURLGetter});
« no previous file with comments | « net/data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_init.js ('k') | net/proxy/proxy_resolver_v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698