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

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

Issue 6871019: Enable (optional) blocking of webrequests in case a PAC script cannot be fetched or is invalid. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years, 7 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/common/extensions/docs/samples.json ('k') | net/base/net_error_list.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 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 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=ProxySettingsApiTest.ProxyPacData 6 // browser_tests.exe --gtest_filter=ProxySettingsApiTest.ProxyPacData
7 7
8 function expect(expected, message) { 8 function expect(expected, message) {
9 return chrome.test.callbackPass(function(value) { 9 return chrome.test.callbackPass(function(value) {
10 chrome.test.assertEq(expected, value, message); 10 chrome.test.assertEq(expected, value, message);
11 }); 11 });
12 } 12 }
13 13
14 chrome.test.runTests([ 14 chrome.test.runTests([
15 function setAutoSettings() { 15 function setAutoSettings() {
16 var pacScriptObject = { 16 var pacScriptObject = {
17 data: "function FindProxyForURL(url, host) {\n" + 17 data: "function FindProxyForURL(url, host) {\n" +
18 " if (host == 'foobar.com')\n" + 18 " if (host == 'foobar.com')\n" +
19 " return 'PROXY blackhole:80';\n" + 19 " return 'PROXY blackhole:80';\n" +
20 " return 'DIRECT';\n" + 20 " return 'DIRECT';\n" +
21 "}" 21 "}",
22 mandatory: false
22 }; 23 };
23 var config = { 24 var config = {
24 mode: "pac_script", 25 mode: "pac_script",
25 pacScript: pacScriptObject 26 pacScript: pacScriptObject
26 }; 27 };
27 chrome.experimental.proxy.settings.set( 28 chrome.experimental.proxy.settings.set(
28 {'value': config}, 29 {'value': config},
29 chrome.test.callbackPass()); 30 chrome.test.callbackPass());
30 chrome.experimental.proxy.settings.get( 31 chrome.experimental.proxy.settings.get(
31 {'incognito': false}, 32 {'incognito': false},
32 expect({ 'value': config, 33 expect({ 'value': config,
33 'levelOfControl': "ControlledByThisExtension" }, 34 'levelOfControl': "ControlledByThisExtension" },
34 "invalid proxy settings")); 35 "invalid proxy settings"));
35 } 36 }
36 ]); 37 ]);
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | net/base/net_error_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698