Index: chrome/test/data/file_manager/unit_tests/mocks/mock_entry.js |
diff --git a/chrome/test/data/file_manager/unit_tests/mocks/mock_entry.js b/chrome/test/data/file_manager/unit_tests/mocks/mock_entry.js |
index 9c0b5924ec5845346d19439d5de0b9a0ec268831..36759dad73271383c89c267204a8ee71b1845797 100644 |
--- a/chrome/test/data/file_manager/unit_tests/mocks/mock_entry.js |
+++ b/chrome/test/data/file_manager/unit_tests/mocks/mock_entry.js |
@@ -45,6 +45,9 @@ MockEntry.prototype = { |
*/ |
get name() { |
return this.fullPath.replace(/^.*\//, ''); |
+ }, |
+ get fileSystem() { |
hirono
2014/10/24 07:12:21
Is it needed? We already have filesystem property.
yawano
2014/10/27 00:25:08
Sorry, this method was unnecessary. I deleted.
|
+ return this.filesystem; |
} |
}; |
@@ -54,7 +57,11 @@ MockEntry.prototype = { |
* @return {string} Fake URL. |
*/ |
MockEntry.prototype.toURL = function() { |
- return 'filesystem:' + this.filesystem.fileSystemId + this.fullPath; |
+ if(this.filesystem.fileSystemId) { |
+ return 'filesystem:' + this.filesystem.fileSystemId + this.fullPath; |
+ } else { |
+ return 'filesystem:' + this.filesystem.name + this.fullPath; |
+ } |
}; |
/** |
@@ -212,3 +219,23 @@ MockDirectoryEntry.prototype.getDirectory = |
else |
onSuccess(this.filesystem.entries[fullPath]); |
}; |
+ |
+/** |
+ * Creates a MockDirectoryReader for the entry. |
+ */ |
+MockDirectoryEntry.prototype.createReader = function() { |
+ return new MockDirectoryReader(); |
+} |
+ |
+/** |
+ * Mock class for DirectoryReader. |
+ */ |
+function MockDirectoryReader() {} |
+ |
+/** |
+ * Reads entries. |
+ * Current implementation just calls success callback. |
+ */ |
+MockDirectoryReader.prototype.readEntries = function(success, error) { |
+ success(); |
+} |