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

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

Issue 10834383: Chrome OS "open with" picker allowing Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: some fixes, haven't approached JS yet 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/main.js
diff --git a/chrome/test/data/extensions/api_test/filebrowser_component/main.js b/chrome/test/data/extensions/api_test/filebrowser_component/main.js
index 66505717695040373dc1d6ac2cfeb142e91f45f6..abbb8ad683498eb0900a80724689a628f6936208 100644
--- a/chrome/test/data/extensions/api_test/filebrowser_component/main.js
+++ b/chrome/test/data/extensions/api_test/filebrowser_component/main.js
@@ -18,8 +18,8 @@ var kFileManagerExtensionId = 'hhaomjibdihmijegdhdafkllkbggdgoj';
// Class specified by the client running the TestRunner.
// |expectedTasks| should contain list of actions defined for abc files defined
// by filesystem_handler part of the test.
-// |fileVerifierFunction| method that will verify test results received from the
-// filesystem_handler part of the test.
+// |fileVerifierFunction| optional method that will verify test results received
+// from the filesystem_handler part of the test.
// The method will be passed received fileEntry object, original file
// content, response received from filesystem_handler and callback
// function that will expect error object as its argument (or undefined on
@@ -71,14 +71,18 @@ TestExpectations.prototype.verifyHandlerRequest = function(request, callback) {
var TestRunner = function(expectations) {
this.expectations_ = expectations;
this.fileCreator_ = new TestFileCreator("tmp", true /* shouldRandomize */);
- this.listener_ = this.onHandlerRequest_.bind(this);
+ if (expectations.fileVerifierFunction_) {
+ this.listener_ = this.onHandlerRequest_.bind(this);
+ }
};
// Starts the test.
TestRunner.prototype.runTest = function() {
// Get local FS, create dir with a file in it.
console.log('Requesting local file system...');
- chrome.extension.onRequestExternal.addListener(this.listener_);
+ if (this.listener_) {
+ chrome.extension.onRequestExternal.addListener(this.listener_);
+ }
chrome.fileBrowserPrivate.requestLocalFileSystem(
this.onFileSystemFetched_.bind(this));
};
@@ -99,7 +103,6 @@ TestRunner.prototype.onFileCreatorInit_ = function() {
this.errorCallback_({message: "Test file extension not set."});
return;
}
- console.log(this.fileExtension);
var self = this;
this.fileCreator_.createFile('.log',
function(file, text) {
@@ -130,7 +133,6 @@ TestRunner.prototype.onGetTasks_ = function(fileUrl, tasks) {
console.log('DONE fetching ' + tasks.length + ' tasks');
- tasks = this.filterTasks_(tasks);
chrome.fileBrowserPrivate.executeTask(tasks[0].taskId, [fileUrl]);
};

Powered by Google App Engine
This is Rietveld 408576698