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

Unified Diff: chrome/test/data/extensions/api_test/downloads/test.js

Issue 9762002: Disable downloads from "file:" or "data:" URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed test to make sure to run message loop while pinging IO thread. Created 8 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/download-anchor-attrib.html ('k') | content/browser/download/download_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 56cbbc0f54ed0b1f924c7b26bd72cbb48835aa0a..672603315600355b45ddc21c513ddddd6d877b10 100644
--- a/chrome/test/data/extensions/api_test/downloads/test.js
+++ b/chrome/test/data/extensions/api_test/downloads/test.js
@@ -702,26 +702,18 @@ chrome.test.getConfig(function(testConfig) {
}));
},
- function downloadAllowDataURLs() {
- // Valid data URLs are valid URLs.
- var downloadId = getNextId();
- console.debug(downloadId);
+ function downloadDontAllowDataURLs() {
+ // We block downloading from data URLs.
downloads.download(
{'url': 'data:text/plain,hello'},
- chrome.test.callback(function(id) {
- chrome.test.assertEq(downloadId, id);
- }));
+ chrome.test.callbackFail("net::ERR_DISALLOWED_URL_SCHEME"));
},
- function downloadAllowFileURLs() {
- // Valid file URLs are valid URLs.
- var downloadId = getNextId();
- console.debug(downloadId);
+ function downloadDontAllowFileURLs() {
+ // We block downloading from file URLs.
downloads.download(
{'url': 'file:///'},
- chrome.test.callback(function(id) {
- chrome.test.assertEq(downloadId, id);
- }));
+ chrome.test.callbackFail("net::ERR_DISALLOWED_URL_SCHEME"));
},
// TODO(benjhayden): Set up a test ftp server.
« no previous file with comments | « chrome/test/data/download-anchor-attrib.html ('k') | content/browser/download/download_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698