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.
5 function setupListener() {
6 chrome.syncFileSystem.onFileStatusChanged.addListener(fileInfoReceived);
7 chrome.syncFileSystem.requestFileSystem(function() {});
10 function fileInfoReceived(fileInfo) {
11 // FileEntry object fields.
12 var fileEntry = fileInfo.fileEntry;
13 chrome.test.assertEq("foo.txt", fileEntry.name);
14 chrome.test.assertEq("/foo.txt", fileEntry.fullPath);
15 chrome.test.assertTrue(fileEntry.isFile);
16 chrome.test.assertFalse(fileEntry.isDirectory);
18 chrome.test.assertEq("synced", fileInfo.status);
19 chrome.test.assertEq("added", fileInfo.action);
20 chrome.test.assertEq("remote_to_local", fileInfo.direction);
21 chrome.test.succeed();
24 chrome.test.runTests([