Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2010 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 // proxy api test | |
| 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.ProxyBypass | |
| 7 | |
| 8 function expect(expected, message) { | |
| 9 return chrome.test.callbackPass(function(value) { | |
| 10 chrome.test.assertEq(expected, value, message); | |
| 11 }); | |
| 12 } | |
| 13 | |
| 14 chrome.test.runTests([ | |
| 15 function setIndividualProxies() { | |
| 16 var httpProxy = { | |
| 17 host: "1.1.1.1" | |
| 18 }; | |
| 19 var httpProxyExpected = { | |
| 20 scheme: "http", | |
| 21 host: "1.1.1.1", | |
| 22 port: 80 | |
| 23 }; | |
| 24 | |
| 25 var rules = { | |
| 26 proxyForHttp: httpProxy, | |
| 27 bypassList: ["localhost", "::1", "foo.bar"] | |
| 28 }; | |
| 29 var rulesExpected = { | |
| 30 proxyForHttp: httpProxyExpected, | |
| 31 bypassList: ["localhost", "::1", "foo.bar"] | |
|
eroman
2011/02/11 04:52:28
side note: there are also some "magical" values wh
battre
2011/02/11 15:06:03
I realized this when writing the documentation for
| |
| 32 }; | |
| 33 | |
| 34 var config = { rules: rules, mode: "fixed_servers" }; | |
| 35 var configExpected = { rules: rulesExpected, mode: "fixed_servers" }; | |
| 36 | |
| 37 chrome.experimental.proxy.useCustomProxySettings(config); | |
| 38 chrome.experimental.proxy.getCurrentProxySettings( | |
| 39 false, | |
| 40 expect(configExpected, "invalid proxy settings")); | |
| 41 chrome.experimental.proxy.getCurrentProxySettings( | |
| 42 true, | |
| 43 expect(configExpected, "invalid proxy settings")); | |
| 44 } | |
| 45 ]); | |
| OLD | NEW |