- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / proxy / individual_incognito_also / test.js
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
7 //     --gtest_filter=ProxySettingsApiTest.ProxyFixedIndividualIncognitoAlso
8
9 chrome.test.runTests([
10   // Verify that execution has started to make sure flaky timeouts are not
11   // caused by us.
12   function verifyTestsHaveStarted() {
13     chrome.test.succeed();
14   },
15   function setIndividualProxiesRegular() {
16     var httpProxy = {
17       host: "1.1.1.1"
18     };
19     var httpsProxy = {
20       scheme: "socks5",
21       host: "2.2.2.2"
22     };
23     var ftpProxy = {
24       host: "3.3.3.3",
25       port: 9000
26     };
27     var fallbackProxy = {
28       scheme: "socks4",
29       host: "4.4.4.4",
30       port: 9090
31     };
32
33     var rules = {
34       proxyForHttp: httpProxy,
35       proxyForHttps: httpsProxy,
36       proxyForFtp: ftpProxy,
37       fallbackProxy: fallbackProxy,
38     };
39
40     var config = { rules: rules, mode: "fixed_servers" };
41     chrome.proxy.settings.set(
42         {'value': config, 'scope': 'regular'},
43         chrome.test.callbackPass());
44   },
45   function setIndividualProxiesIncognito() {
46     var httpProxy = {
47       host: "5.5.5.5"
48     };
49     var httpsProxy = {
50       scheme: "socks5",
51       host: "6.6.6.6"
52     };
53     var ftpProxy = {
54       host: "7.7.7.7",
55       port: 9000
56     };
57     var fallbackProxy = {
58       scheme: "socks4",
59       host: "8.8.8.8",
60       port: 9090
61     };
62
63     var rules = {
64       proxyForHttp: httpProxy,
65       proxyForHttps: httpsProxy,
66       proxyForFtp: ftpProxy,
67       fallbackProxy: fallbackProxy,
68     };
69
70     var config = { rules: rules, mode: "fixed_servers" };
71     chrome.proxy.settings.set(
72         {'value': config, 'scope': 'incognito_persistent'},
73         chrome.test.callbackPass());
74   }
75 ]);