Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / proxy / events / parse_error.js
blob67338ab5f4f7af60cde4394a5762b34576c58acc
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.ProxyEventsParseError
8 var expected_error = {
9 error: "net::ERR_PAC_SCRIPT_FAILED",
10 details: "line: 1: Uncaught SyntaxError: Unexpected token !",
11 fatal: false
14 function test() {
15 // Install error handler and get the test server config.
16 chrome.proxy.onProxyError.addListener(function (error) {
17 chrome.test.assertEq(expected_error, error);
18 chrome.test.notifyPass();
19 });
21 // Set an invalid PAC script. This should trigger a proxy errors.
22 var config = {
23 mode: "pac_script",
24 pacScript: {
25 data: "trash!-FindProxyForURL",
26 mandatory: false
29 chrome.proxy.settings.set({'value': config}, testDone);
32 function testDone() {
33 // Do nothing. The test success/failure is decided in the event handler.
36 test();