| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 function testForUrl(fileUrl) { |
| 6 chrome.fileBrowserPrivate.getFileTasks([fileUrl], [], function(tasks) { |
| 7 if (!tasks || !tasks.length) { |
| 8 chrome.test.fail('No tasks registered'); |
| 9 return; |
| 10 } |
| 11 console.log('Tasks: ' + tasks.length); |
| 12 chrome.fileBrowserPrivate.executeTask(tasks[0].taskId, [fileUrl]); |
| 13 }); |
| 14 }; |
| 15 |
| 16 chrome.test.runTests([function() { |
| 17 var hash = window.location.hash.toString(); |
| 18 |
| 19 if (!hash.length) { |
| 20 chrome.test.fail('No fileUrl given to test'); |
| 21 return; |
| 22 } |
| 23 var fileUrl = hash.substring(1); |
| 24 |
| 25 // The local filesystem is not explicitly used, but this test still needs to |
| 26 // request it; it configures local access permissions. |
| 27 chrome.fileBrowserPrivate.requestLocalFileSystem(chrome.test.callbackPass( |
| 28 function(fs) { |
| 29 testForUrl(fileUrl); |
| 30 })); |
| 31 }]); |
| OLD | NEW |