OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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.ProxyEvents |
| 7 |
| 8 chrome.experimental.proxy.onProxyError.addListener(function (error) { |
| 9 chrome.test.assertTrue(error.fatal); |
| 10 chrome.test.assertEq("net::ERR_PROXY_CONNECTION_FAILED", error.error); |
| 11 chrome.test.assertEq("", error.details); |
| 12 chrome.test.notifyPass(); |
| 13 }); |
| 14 |
| 15 var rules = { |
| 16 singleProxy: { host: "does.not.exist" } |
| 17 }; |
| 18 |
| 19 var config = { rules: rules, mode: "fixed_servers" }; |
| 20 chrome.experimental.proxy.useCustomProxySettings(config); |
| 21 |
| 22 var req = new XMLHttpRequest(); |
| 23 req.open("GET", "http://127.0.0.1/", true); |
| 24 req.onload = function () { chrome.test.notifyFail(); } |
| 25 req.send(null); |
OLD | NEW |