- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / sync_file_system / get_file_status / test.js
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 var testStep = [
6   function() {
7     chrome.syncFileSystem.requestFileSystem(testStep.shift());
8   },
9   // Create empty file.
10   function(fileSystem) {
11     fileSystem.root.getFile('Test.txt', {create: true}, testStep.shift(),
12         errorHandler);
13   },
14   // Confirm file is conflicting as this is the mocked value.
15   function(fileEntry) {
16     chrome.syncFileSystem.getFileStatus(fileEntry, testStep.shift());
17   },
18   function(fileStatus) {
19     chrome.test.assertEq("conflicting", fileStatus);
20     chrome.test.succeed();
21   }
22 ];
23
24 function errorHandler(e) {
25   console.log("Failed test with error" + e);
26   chrome.test.fail();
27 }
28
29 chrome.test.runTests([
30   testStep.shift()
31 ]);