1 // Copyright (c) 2011 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.
7 console
.log("Requesting a filesystem...");
8 webkitRequestFileSystem(window
.TEMPORARY
, 100, getFileSystem
, errorCallback
);
10 function getFileSystem(fs
) {
12 console
.log("DONE requesting filesystem: " + fileSystem
.name
);
13 fileSystem
.root
.getDirectory('dir', {create
:true},
14 directoryCallback
, errorCallback
);
17 function directoryCallback(directory
) {
18 console
.log("DONE creating directory: " + directory
.path
);
19 directory
.getFile('file', {create
:true}, fileCallback
, errorCallback
);
22 function fileCallback(file
) {
23 console
.log("DONE creating file: " + file
.path
);
25 // See if we get the same filesystem space in the tab.
26 console
.log("Opening tab...");
32 function errorCallback(error
) {
33 chrome
.test
.fail("Got unexpected error: " + error
.code
);