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

Unified Diff: chrome/test/data/extensions/api_test/filebrowser_component/intent.js

Issue 10834383: Chrome OS "open with" picker allowing Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tbarzic comments Created 8 years, 3 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
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);
+ }));
+}]);

Powered by Google App Engine
This is Rietveld 408576698