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

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

Issue 8896019: Refactor: Extract "InitProxyResolver" to "ProxyScriptDecider". (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: do another sync since commitbot failed... Created 9 years 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
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.ProxyEventsParseError 6 // browser_tests.exe --gtest_filter=ProxySettingsApiTest.ProxyEventsParseError
7 7
8 var expected_error = { 8 var expected_error = {
9 error: "net::ERR_PAC_SCRIPT_FAILED", 9 error: "net::ERR_PAC_SCRIPT_FAILED",
10 details: "line: 1: Uncaught SyntaxError: Unexpected token !", 10 details: "line: 1: Uncaught SyntaxError: Unexpected token !",
11 fatal: false 11 fatal: false
12 }; 12 };
13 13
14 function test() { 14 function test() {
15 // Install error handler and get the test server config. 15 // Install error handler and get the test server config.
16 chrome.proxy.onProxyError.addListener(function (error) { 16 chrome.proxy.onProxyError.addListener(function (error) {
17 chrome.test.assertEq(expected_error, error); 17 chrome.test.assertEq(expected_error, error);
18 chrome.test.notifyPass(); 18 chrome.test.notifyPass();
19 }); 19 });
20 20
21 // Set an invalid PAC script. This should trigger a proxy errors. 21 // Set an invalid PAC script. This should trigger a proxy errors.
22 var config = { 22 var config = {
23 mode: "pac_script", 23 mode: "pac_script",
24 pacScript: { 24 pacScript: {
25 data: "trash!", 25 data: "trash!-FindProxyForURL",
26 mandatory: false 26 mandatory: false
27 } 27 }
28 }; 28 };
29 chrome.proxy.settings.set({'value': config}, testDone); 29 chrome.proxy.settings.set({'value': config}, testDone);
30 } 30 }
31 31
32 function testDone() { 32 function testDone() {
33 // Do nothing. The test success/failure is decided in the event handler. 33 // Do nothing. The test success/failure is decided in the event handler.
34 } 34 }
35 35
36 test(); 36 test();
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/proxy_view.js ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698