| Index: chrome/test/data/extensions/api_test/downloads/test.js
|
| diff --git a/chrome/test/data/extensions/api_test/downloads/test.js b/chrome/test/data/extensions/api_test/downloads/test.js
|
| index a31dee5aa8f146575592bd9132472dd77828293e..3e8589d8bf08c40968b497be394b3c096f1f1963 100644
|
| --- a/chrome/test/data/extensions/api_test/downloads/test.js
|
| +++ b/chrome/test/data/extensions/api_test/downloads/test.js
|
| @@ -722,32 +722,41 @@ chrome.test.getConfig(function(testConfig) {
|
| }));
|
| },
|
|
|
| - // TODO(benjhayden): Set up a test ftp server.
|
| - // function downloadAllowFTPURLs() {
|
| - // // Valid ftp URLs are valid URLs.
|
| - // var downloadId = getNextId();
|
| - // console.debug(downloadId);
|
| - // downloads.download(
|
| - // {'url': 'ftp://localhost:' + testConfig.testServer.port + '/'},
|
| - // chrome.test.callback(function(id) {
|
| - // chrome.test.assertEq(downloadId, id);
|
| - // }));
|
| - // },
|
| -
|
| function downloadInvalidURL7() {
|
| // Test that download() rejects javascript urls.
|
| downloads.download(
|
| {'url': 'javascript:document.write("hello");'},
|
| - chrome.test.callbackFail('net::ERR_ACCESS_DENIED'));
|
| + chrome.test.callbackFail(downloads.ERROR_INVALID_URL));
|
| },
|
|
|
| function downloadInvalidURL8() {
|
| // Test that download() rejects javascript urls.
|
| downloads.download(
|
| {'url': 'javascript:return false;'},
|
| - chrome.test.callbackFail('net::ERR_ACCESS_DENIED'));
|
| + chrome.test.callbackFail(downloads.ERROR_INVALID_URL));
|
| + },
|
| +
|
| + function downloadInvalidURL9() {
|
| + // Test that download() rejects otherwise-valid URLs that fail the host
|
| + // permissions check.
|
| + downloads.download(
|
| + {'url': 'ftp://example.com/example.txt'},
|
| + chrome.test.callbackFail(downloads.ERROR_INVALID_URL));
|
| },
|
|
|
| + // TODO(benjhayden): Set up a test ftp server, add ftp://localhost* to
|
| + // permissions, maybe update downloadInvalidURL9.
|
| + // function downloadAllowFTPURLs() {
|
| + // // Valid ftp URLs are valid URLs.
|
| + // var downloadId = getNextId();
|
| + // console.debug(downloadId);
|
| + // downloads.download(
|
| + // {'url': 'ftp://localhost:' + testConfig.testServer.port + '/'},
|
| + // chrome.test.callback(function(id) {
|
| + // chrome.test.assertEq(downloadId, id);
|
| + // }));
|
| + // },
|
| +
|
| function downloadInvalidMethod() {
|
| assertThrows(('Invalid value for argument 1. Property \'method\': ' +
|
| 'Value must be one of: [GET, POST].'),
|
|
|