- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / file_system / restore_entry / test.js
1 // Copyright 2013 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 restoreEntryWorks() {
7     var id = 'magic id';
8     chrome.fileSystem.isRestorable(id, chrome.test.callbackPass(
9         function(isRestorable) {
10       chrome.test.assertTrue(isRestorable);
11     }));
12     chrome.fileSystem.restoreEntry(id, chrome.test.callbackPass(
13         function(restoredEntry) {
14       chrome.test.assertTrue(restoredEntry != null);
15       chrome.test.assertEq(
16           chrome.fileSystem.retainEntry(restoredEntry), id);
17       checkEntry(restoredEntry, 'writable.txt', false /* isNew */,
18                  true /*shouldBeWritable */);
19       }));
20     chrome.fileSystem.isRestorable('wrong id', chrome.test.callbackPass(
21         function(isRestorable) {
22       chrome.test.assertFalse(isRestorable);
23     }));
24     chrome.fileSystem.restoreEntry('wrong id', chrome.test.callbackFail(
25         'Unknown id'));
26   }
27 ]);