| Index: chrome/test/data/extensions/api_test/filebrowser_component/intent.js
|
| diff --git a/chrome/test/data/extensions/api_test/filebrowser_component/intent.js b/chrome/test/data/extensions/api_test/filebrowser_component/intent.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..810c02d19cf0395043e325a6589398af36e46a16
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/api_test/filebrowser_component/intent.js
|
| @@ -0,0 +1,31 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +function testForUrl(fileUrl) {
|
| + chrome.fileBrowserPrivate.getFileTasks([fileUrl], [], function(tasks) {
|
| + if (!tasks || !tasks.length) {
|
| + chrome.test.fail('No tasks registered');
|
| + return;
|
| + }
|
| + console.log('Tasks: ' + tasks.length);
|
| + chrome.fileBrowserPrivate.executeTask(tasks[0].taskId, [fileUrl]);
|
| + });
|
| +};
|
| +
|
| +chrome.test.runTests([function() {
|
| + var hash = window.location.hash.toString();
|
| +
|
| + if (!hash.length) {
|
| + chrome.test.fail('No fileUrl given to test');
|
| + return;
|
| + }
|
| + var fileUrl = hash.substring(1);
|
| +
|
| + // The local filesystem is not explicitly used, but this test still needs to
|
| + // request it; it configures local access permissions.
|
| + chrome.fileBrowserPrivate.requestLocalFileSystem(chrome.test.callbackPass(
|
| + function(fs) {
|
| + testForUrl(fileUrl);
|
| + }));
|
| +}]);
|
|
|