Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / file_system / retain_entry / test.js
blob9555e8e52d33d28fb2a812c6d79c02c2fa24d139
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.
5 chrome.test.runTests([
6   function retainEntryWorks() {
7     chrome.app.window.create('test_other_window.html', chrome.test.callbackPass(
8         function(otherWindow) {
9       otherWindow.contentWindow.callback = chrome.test.callbackPass(
10           function(id, entry) {
11         otherWindow.close();
12         chrome.fileSystem.isRestorable(id, chrome.test.callbackPass(
13             function(isRestorable) {
14           chrome.test.assertTrue(isRestorable);
15         }));
16         chrome.test.assertEq(chrome.fileSystem.retainEntry(entry), id);
17         chrome.fileSystem.restoreEntry(id, chrome.test.callbackPass(
18             function(restoredEntry) {
19           chrome.test.assertEq(restoredEntry, entry);
20           chrome.test.assertEq(
21               chrome.fileSystem.retainEntry(restoredEntry), id);
22           checkEntry(restoredEntry, 'writable.txt', false /* isNew */,
23             false /*shouldBeWritable */);
24         }));
25       });
26     }));
27   }
28 ]);