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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/extfs/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 chrome.test.runTests([
6 function main() {
7 // First, add a mount point named 'extfs'. This should be done before callin g
8 // chrome.fileBrowserPrivate.requestFileSystem()
9 chrome.extfs.addMountPoint(
10 'extfs',
11 function() {
12 // This will be called via ExtfsProxy::GetFileInfo()
13 chrome.extfs.onGetFileInfo.addListener(
14 function(path, callback) {
15 console.log('@@@ onGetFileInfo: ' + path);
16 var entry = {
17 isDirectory: true,
18 name: '/',
19 };
20 console.log(entry);
21 callback(entry);
22 });
23
24 // Request the access to the file system tree.
25 chrome.fileBrowserPrivate.requestFileSystem(function(filesystem) {
26 console.log('@@@ Got filesystem');
27 var root = filesystem.root;
28 // 'extfs' is mounted as 'extfs' in the root directory.
29 // Get an entry for it.
30 root.getDirectory(
31 'extfs',
32 {create: false},
33 function(entry) {
34 console.log('@@@ Got dir entry for extfs: ' + entry);
35 // Try read the directory. This will crash at this moment, as
36 // ExtfsProxy::ReadDirectory() is not implemented.
37 var reader = entry.createReader();
38 reader.readEntries(function(results) {
39 for (var i = 0; i < results.length; i++) {
40 console.log('@@@ entry: ' + results[i]);
41 }
42 chrome.test.succeed();
43
44 });
45 },
46 function(error) {
47 console.log('@@@ Failed to get directory entry: ' + error.code);
48 });
49 });
50 });
51 }
52 ]);
OLDNEW
« 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