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

Side by Side Diff: chrome/test/data/extensions/api_test/downloads/test.js

Issue 10103004: Disallow slashes in filename in downloads.download() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/download/download_extension_api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // downloads api test 5 // downloads api test
6 // browser_tests.exe --gtest_filter=DownloadsApiTest.Downloads 6 // browser_tests.exe --gtest_filter=DownloadsApiTest.Downloads
7 7
8 // Comment this out to enable debugging. 8 // Comment this out to enable debugging.
9 console.debug = function() {}; 9 console.debug = function() {};
10 10
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 } 581 }
582 downloads.onChanged.addListener(myListener); 582 downloads.onChanged.addListener(myListener);
583 downloads.download( 583 downloads.download(
584 {'url': SAFE_FAST_URL, 'filename': FILENAME}, 584 {'url': SAFE_FAST_URL, 'filename': FILENAME},
585 chrome.test.callback(function(id) { 585 chrome.test.callback(function(id) {
586 console.debug(downloadId); 586 console.debug(downloadId);
587 chrome.test.assertEq(downloadId, id); 587 chrome.test.assertEq(downloadId, id);
588 })); 588 }));
589 }, 589 },
590 590
591 // TODO(benjhayden): Update this test when downloading to sub-directories is
592 // supported.
593 function downloadFilenameDisallowSlashes() {
594 downloads.download(
595 {'url': SAFE_FAST_URL, 'filename': 'subdirectory/file.txt'},
596 chrome.test.callbackFail(downloads.ERROR_GENERIC));
597 },
598
591 function downloadOnCreated() { 599 function downloadOnCreated() {
592 // Test that the onCreated event fires when we start a download. 600 // Test that the onCreated event fires when we start a download.
593 var downloadId = getNextId(); 601 var downloadId = getNextId();
594 console.debug(downloadId); 602 console.debug(downloadId);
595 var createdCompleted = chrome.test.callbackAdded(); 603 var createdCompleted = chrome.test.callbackAdded();
596 function createdListener(item) { 604 function createdListener(item) {
597 console.debug(item.id); 605 console.debug(item.id);
598 if (item.id != downloadId) 606 if (item.id != downloadId)
599 return; 607 return;
600 console.debug(downloadId); 608 console.debug(downloadId);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 }, 857 },
850 858
851 function callNotifyPass() { 859 function callNotifyPass() {
852 chrome.test.notifyPass(); 860 chrome.test.notifyPass();
853 setTimeout(chrome.test.callback(function() { 861 setTimeout(chrome.test.callback(function() {
854 console.debug(''); 862 console.debug('');
855 }), 0); 863 }), 0);
856 } 864 }
857 ]); 865 ]);
858 }); 866 });
OLDNEW
« no previous file with comments | « chrome/browser/download/download_extension_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698