OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // proxy api test | 5 // proxy api test |
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.ProxyFixedSingle | 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.ProxyFixedSingle |
7 | 7 |
8 chrome.test.runTests([ | 8 chrome.test.runTests([ |
9 function setSingleProxy() { | 9 function setSingleProxy() { |
10 var oneProxy = { | 10 var oneProxy = { |
11 scheme: "http", | |
12 host: "127.0.0.1", | 11 host: "127.0.0.1", |
13 port: 100 | 12 port: 100 |
14 }; | 13 }; |
15 | 14 |
16 // Single proxy should override HTTP proxy. | |
17 var httpProxy = { | |
18 host: "8.8.8.8" | |
19 }; | |
20 | |
21 // Single proxy should not override SOCKS proxy. | |
22 var socksProxy = { | |
23 host: "9.9.9.9" | |
24 }; | |
25 | |
26 var rules = { | 15 var rules = { |
27 singleProxy: oneProxy, | 16 singleProxy: oneProxy |
28 proxyForHttp: httpProxy, | |
29 socksProxy: socksProxy, | |
30 }; | 17 }; |
31 | 18 |
32 var config = { rules: rules, mode: "fixed_servers" }; | 19 var config = { rules: rules, mode: "fixed_servers" }; |
33 chrome.experimental.proxy.useCustomProxySettings(config); | 20 chrome.experimental.proxy.useCustomProxySettings(config); |
34 chrome.test.succeed(); | 21 chrome.test.succeed(); |
35 } | 22 } |
36 ]); | 23 ]); |
OLD | NEW |