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

Unified Diff: chrome/test/data/extensions/api_test/extfs/test.js

Issue 16439016: extfs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « chrome/test/data/extensions/api_test/extfs/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/extfs/test.js
diff --git a/chrome/test/data/extensions/api_test/extfs/test.js b/chrome/test/data/extensions/api_test/extfs/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..12ccd3583675eb6fb49d43e697235be60572ce45
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/extfs/test.js
@@ -0,0 +1,52 @@
+// 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.
+
+chrome.test.runTests([
+ function main() {
+ // First, add a mount point named 'extfs'. This should be done before calling
+ // chrome.fileBrowserPrivate.requestFileSystem()
+ chrome.extfs.addMountPoint(
+ 'extfs',
+ function() {
+ // This will be called via ExtfsProxy::GetFileInfo()
+ chrome.extfs.onGetFileInfo.addListener(
+ function(path, callback) {
+ console.log('@@@ onGetFileInfo: ' + path);
+ var entry = {
+ isDirectory: true,
+ name: '/',
+ };
+ console.log(entry);
+ callback(entry);
+ });
+
+ // Request the access to the file system tree.
+ chrome.fileBrowserPrivate.requestFileSystem(function(filesystem) {
+ console.log('@@@ Got filesystem');
+ var root = filesystem.root;
+ // 'extfs' is mounted as 'extfs' in the root directory.
+ // Get an entry for it.
+ root.getDirectory(
+ 'extfs',
+ {create: false},
+ function(entry) {
+ console.log('@@@ Got dir entry for extfs: ' + entry);
+ // Try read the directory. This will crash at this moment, as
+ // ExtfsProxy::ReadDirectory() is not implemented.
+ var reader = entry.createReader();
+ reader.readEntries(function(results) {
+ for (var i = 0; i < results.length; i++) {
+ console.log('@@@ entry: ' + results[i]);
+ }
+ chrome.test.succeed();
+
+ });
+ },
+ function(error) {
+ console.log('@@@ Failed to get directory entry: ' + error.code);
+ });
+ });
+ });
+ }
+]);
« no previous file with comments | « chrome/test/data/extensions/api_test/extfs/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698