Index: chrome/test/data/extensions/api_test/file_system/retain_entry/test.js |
diff --git a/chrome/test/data/extensions/api_test/file_system/retain_entry/test.js b/chrome/test/data/extensions/api_test/file_system/retain_entry/test.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6940ab8b65ecbdcd7176a2ee49e7af513602ef5c |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/file_system/retain_entry/test.js |
@@ -0,0 +1,29 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+chrome.test.runTests([ |
+ function retainEntryWorks() { |
+ chrome.runtime.getBackgroundPage( |
+ chrome.test.callbackPass(function(backgroundPage) { |
+ backgroundPage.callback = chrome.test.callbackPass( |
+ function(other_window, id, entry) { |
+ other_window.close(); |
+ chrome.fileSystem.isRestorable(id, chrome.test.callbackPass( |
+ function(isRestorable) { |
+ chrome.test.assertTrue(isRestorable); |
+ })); |
+ chrome.test.assertEq(chrome.fileSystem.retainEntry(entry), id); |
+ chrome.fileSystem.restoreEntry(id, chrome.test.callbackPass( |
+ function(restoredEntry) { |
+ chrome.test.assertEq(restoredEntry, entry); |
+ chrome.test.assertEq( |
+ chrome.fileSystem.retainEntry(restoredEntry), id); |
+ checkEntry(restoredEntry, 'writable.txt', false /* isNew */, |
+ false /*shouldBeWritable */); |
+ })); |
+ }); |
+ chrome.app.window.create('test_other_window.html'); |
+ })); |
+ } |
+]); |