OLD | NEW |
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 chrome.test.getConfig(function(config) { | 5 chrome.test.getConfig(function(config) { |
6 | 6 |
7 function rewriteURL(url) { | 7 function rewriteURL(url) { |
8 var isFtp = /^ftp:/i.test(url); | 8 var isFtp = /^ftp:/i.test(url); |
9 var port = isFtp ? config.ftpServer.port : config.testServer.port; | 9 var port = isFtp ? config.ftpServer.port : config.testServer.port; |
10 return url.replace(/PORT/, port); | 10 return url.replace(/PORT/, port); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 function noSubdomain() { | 71 function noSubdomain() { |
72 doReq("http://b.com", true); | 72 doReq("http://b.com", true); |
73 }, | 73 }, |
74 function disallowedSubdomain() { | 74 function disallowedSubdomain() { |
75 doReq("http://foob.com", false); | 75 doReq("http://foob.com", false); |
76 }, | 76 }, |
77 // TODO(asargent): Explicitly create SSL test server and enable the test. | 77 // TODO(asargent): Explicitly create SSL test server and enable the test. |
78 // function disallowedSSL() { | 78 // function disallowedSSL() { |
79 // doReq("https://a.com", false); | 79 // doReq("https://a.com", false); |
80 // }, | 80 // }, |
81 function allowedFtpHostAllowed() { | 81 function allowedFtpHostDisallowed() { |
82 doReq('ftp://127.0.0.1', true); | 82 doReq('ftp://127.0.0.1', false); |
83 }, | 83 }, |
84 function disallowedFtpHostDisallowed() { | 84 function disallowedFtpHostDisallowed() { |
85 doReq('ftp://this.host.is.not.whitelisted', false); | 85 doReq('ftp://this.host.is.not.whitelisted', false); |
86 } | 86 } |
87 ]); | 87 ]); |
88 }); | 88 }); |
OLD | NEW |