Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / fileapi / background.js
blobb33cc224a1ab921d64ba6b6ac14666c11bdc474a
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.
5 var fileSystem = null;
7 console.log("Requesting a filesystem...");
8 webkitRequestFileSystem(window.TEMPORARY, 100, getFileSystem, errorCallback);
10 function getFileSystem(fs) {
11 fileSystem = 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...");
27 chrome.tabs.create({
28 url: "tab.html"
29 });
32 function errorCallback(error) {
33 chrome.test.fail("Got unexpected error: " + error.code);