Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / proxy / auto / test.js
blobc6b9706c5ae467d96cbe2b5a3aab8d3a5e3b8e35
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.
5 // proxy api test
6 // browser_tests.exe --gtest_filter=ProxySettingsApiTest.ProxyAutoSettings
8 function expect(expected, message) {
9 return chrome.test.callbackPass(function(value) {
10 chrome.test.assertEq(expected, value, message);
11 });
14 var config = {
15 mode: "auto_detect"
18 chrome.test.runTests([
19 // Verify that execution has started to make sure flaky timeouts are not
20 // caused by us.
21 function verifyTestsHaveStarted() {
22 chrome.test.succeed();
24 function setAutoSettings() {
25 chrome.proxy.settings.set(
26 {'value': config},
27 chrome.test.callbackPass());
29 function verifyRegular() {
30 chrome.proxy.settings.get(
31 {'incognito': false},
32 expect({ 'value': config,
33 'levelOfControl': "controlled_by_this_extension" },
34 "invalid proxy settings"));
36 function verifyIncognito() {
37 chrome.proxy.settings.get(
38 {'incognito': true},
39 expect({ 'value': config,
40 'incognitoSpecific': false,
41 'levelOfControl': "controlled_by_this_extension" },
42 "invalid proxy settings"));
44 ]);