Index: chrome/test/data/extensions/api_test/proxy/bypass/test.js |
diff --git a/chrome/test/data/extensions/api_test/proxy/bypass/test.js b/chrome/test/data/extensions/api_test/proxy/bypass/test.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8eb9a8367dbf79942ff11747fa92cdb0eefb9d4b |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/proxy/bypass/test.js |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2010 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. |
+ |
+// proxy api test |
+// browser_tests.exe --gtest_filter=ExtensionApiTest.ProxyBypass |
+ |
+function expect(expected, message) { |
+ return chrome.test.callbackPass(function(value) { |
+ chrome.test.assertEq(expected, value, message); |
+ }); |
+} |
+ |
+chrome.test.runTests([ |
+ function setIndividualProxies() { |
+ var httpProxy = { |
+ host: "1.1.1.1" |
+ }; |
+ var httpProxyExpected = { |
+ scheme: "http", |
+ host: "1.1.1.1", |
+ port: 80 |
+ }; |
+ |
+ var rules = { |
+ proxyForHttp: httpProxy, |
+ bypassList: ["localhost", "::1", "foo.bar"] |
+ }; |
+ var rulesExpected = { |
+ proxyForHttp: httpProxyExpected, |
+ 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
|
+ }; |
+ |
+ var config = { rules: rules, mode: "fixed_servers" }; |
+ var configExpected = { rules: rulesExpected, mode: "fixed_servers" }; |
+ |
+ chrome.experimental.proxy.useCustomProxySettings(config); |
+ chrome.experimental.proxy.getCurrentProxySettings( |
+ false, |
+ expect(configExpected, "invalid proxy settings")); |
+ chrome.experimental.proxy.getCurrentProxySettings( |
+ true, |
+ expect(configExpected, "invalid proxy settings")); |
+ } |
+]); |