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.
6 // browser_tests.exe --gtest_filter=ProxySettingsApiTest.ProxyFixedIndividual
8 function expect(expected
, message
) {
9 return chrome
.test
.callbackPass(function(value
) {
10 chrome
.test
.assertEq(expected
, value
, message
);
18 var httpProxyExpected
= {
26 var httpsProxyExpected
= {
35 var ftpProxyExpected
= {
36 scheme
: "http", // this is added.
45 var fallbackProxyExpected
= fallbackProxy
;
48 proxyForHttp
: httpProxy
,
49 proxyForHttps
: httpsProxy
,
50 proxyForFtp
: ftpProxy
,
51 fallbackProxy
: fallbackProxy
,
54 proxyForHttp
: httpProxyExpected
,
55 proxyForHttps
: httpsProxyExpected
,
56 proxyForFtp
: ftpProxyExpected
,
57 fallbackProxy
: fallbackProxyExpected
,
60 var config
= { rules
: rules
, mode
: "fixed_servers" };
61 var configExpected
= { rules
: rulesExpected
, mode
: "fixed_servers" };
63 chrome
.test
.runTests([
64 // Verify that execution has started to make sure flaky timeouts are not
66 function verifyTestsHaveStarted() {
67 chrome
.test
.succeed();
69 function setIndividualProxies() {
70 chrome
.proxy
.settings
.set(
72 chrome
.test
.callbackPass());
74 function verifyRegular() {
75 chrome
.proxy
.settings
.get(
77 expect({ 'value': configExpected
,
78 'levelOfControl': "controlled_by_this_extension" },
79 "invalid proxy settings"));
81 function verifyIncognito() {
82 chrome
.proxy
.settings
.get(
84 expect({ 'value': configExpected
,
85 'incognitoSpecific': false,
86 'levelOfControl': "controlled_by_this_extension" },
87 "invalid proxy settings"));