Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: chrome/test/data/extensions/api_test/proxy/individual/test.js

Issue 6468002: Implementation of getCurrentProxySettings for proxy settings API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/out/Debug
Patch Set: Removed todo and ask mpcomplete now. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/proxy/direct/test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.ProxyFixedIndividual 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.ProxyFixedIndividual
7 7
8 function expect(expected, message) {
9 return chrome.test.callbackPass(function(value) {
10 chrome.test.assertEq(expected, value, message);
11 });
12 }
13
8 chrome.test.runTests([ 14 chrome.test.runTests([
9 function setIndividualProxies() { 15 function setIndividualProxies() {
10 var httpProxy = { 16 var httpProxy = {
11 host: "1.1.1.1" 17 host: "1.1.1.1"
12 }; 18 };
19 var httpProxyExpected = {
20 scheme: "http",
21 host: "1.1.1.1",
22 port: 80
23 };
13 var httpsProxy = { 24 var httpsProxy = {
14 host: "2.2.2.2" 25 host: "2.2.2.2"
15 }; 26 };
27 var httpsProxyExpected = {
28 scheme: "http",
29 host: "2.2.2.2",
30 port: 80
31 };
16 var ftpProxy = { 32 var ftpProxy = {
17 host: "3.3.3.3", 33 host: "3.3.3.3",
18 port: 9000 34 port: 9000
19 }; 35 };
36 var ftpProxyExpected = {
37 scheme: "http", // this is added.
38 host: "3.3.3.3",
39 port: 9000
40 };
20 var socksProxy = { 41 var socksProxy = {
21 scheme: "socks4", 42 scheme: "socks4",
22 host: "4.4.4.4", 43 host: "4.4.4.4",
23 port: 9090 44 port: 9090
24 }; 45 };
46 var socksProxyExpected = socksProxy;
25 47
26 var rules = { 48 var rules = {
27 proxyForHttp: httpProxy, 49 proxyForHttp: httpProxy,
28 proxyForHttps: httpsProxy, 50 proxyForHttps: httpsProxy,
29 proxyForFtp: ftpProxy, 51 proxyForFtp: ftpProxy,
30 socksProxy: socksProxy, 52 socksProxy: socksProxy,
31 }; 53 };
54 var rulesExpected = {
55 proxyForHttp: httpProxyExpected,
56 proxyForHttps: httpsProxyExpected,
57 proxyForFtp: ftpProxyExpected,
58 socksProxy: socksProxyExpected,
59 };
32 60
33 var config = { rules: rules, mode: "fixed_servers" }; 61 var config = { rules: rules, mode: "fixed_servers" };
62 var configExpected = { rules: rulesExpected, mode: "fixed_servers" };
63
34 chrome.experimental.proxy.useCustomProxySettings(config); 64 chrome.experimental.proxy.useCustomProxySettings(config);
35 chrome.test.succeed(); 65 chrome.experimental.proxy.getCurrentProxySettings(
66 false,
67 expect(configExpected, "invalid proxy settings"));
68 chrome.experimental.proxy.getCurrentProxySettings(
69 true,
70 expect(configExpected, "invalid proxy settings"));
36 } 71 }
37 ]); 72 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/proxy/direct/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698