OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This PAC script will throw an exception when accessing the "FindProxyForURL" |
| 6 // the *second* time it is accessed. |
| 7 |
| 8 function actualFindProxyForURL(url, host) { |
| 9 return "DIRECT"; |
| 10 } |
| 11 |
| 12 var counter = 2; |
| 13 |
| 14 function FindProxyForURLGetter() { |
| 15 counter--; |
| 16 if (counter <= 0) |
| 17 throw "crash!"; |
| 18 return actualFindProxyForURL; |
| 19 } |
| 20 |
| 21 Object.defineProperty(this, "FindProxyForURL", {get: FindProxyForURLGetter}); |
OLD | NEW |