OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 chrome.test.getConfig(function(config) { | 5 chrome.test.getConfig(function(config) { |
6 chrome.test.runTests([ | 6 chrome.test.runTests([ |
7 function testCookieNotSet() { | 7 function testCookieNotSet() { |
8 var xhr = new XMLHttpRequest(); | 8 var xhr = new XMLHttpRequest(); |
9 xhr.open( | 9 xhr.open( |
10 'GET', | 10 'GET', |
11 'http://localhost:' + config.testServer.port + '/echoheader?Cookie', | 11 'http://localhost:' + config.testServer.port + '/echoheader?Cookie', |
12 true); | 12 true); |
13 xhr.onload = function() { | 13 xhr.onload = function() { |
14 // Cookies should not have been passed in the request, so the echo of | 14 // Cookies should not have been passed in the request. |
15 // their header should be the Pythonic "None". | 15 chrome.test.assertEq('', xhr.responseText); |
16 chrome.test.assertEq('None', xhr.responseText); | |
17 chrome.test.succeed(); | 16 chrome.test.succeed(); |
18 }; | 17 }; |
19 xhr.onerror = function() { | 18 xhr.onerror = function() { |
20 chrome.test.fail('Unexpected HTTP status ' + xhr.status); | 19 chrome.test.fail('Unexpected HTTP status ' + xhr.status); |
21 } | 20 } |
22 xhr.send(); | 21 xhr.send(); |
23 } | 22 } |
24 ]); | 23 ]); |
25 }); | 24 }); |
OLD | NEW |