Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8403)

Unified Diff: chrome/test/data/extensions/api_test/file_system/is_writable_file_entry/test.js

Issue 10692104: Add isWritableFileEntry to the fileSystem API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added presubmit fix Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/file_system/is_writable_file_entry/test.js
diff --git a/chrome/test/data/extensions/api_test/file_system/is_writable_file_entry/test.js b/chrome/test/data/extensions/api_test/file_system/is_writable_file_entry/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..89c712217ac55ff6a4c621acc9f5ef446a22cc8c
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/file_system/is_writable_file_entry/test.js
@@ -0,0 +1,27 @@
+// Copyright (c) 2012 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 isWritableEntry() {
+ chrome.fileSystem.chooseFile({type: 'saveFile'},
+ chrome.test.callbackPass(function(entry) {
+ chrome.test.assertEq('writable.txt', entry.name);
+ // Test that the file is writable, as we requested a 'saveFile'.
+ chrome.fileSystem.isWritableFileEntry(entry, chrome.test.callbackPass(
+ function(isWritable) {
+ chrome.test.assertTrue(isWritable);
+ }));
+ }));
+ },
+ function isNotWritableEntry() {
+ chrome.fileSystem.chooseFile(chrome.test.callbackPass(function(entry) {
+ chrome.test.assertEq('writable.txt', entry.name);
+ // The file should not be writable, since the default is 'openFile'.
+ chrome.fileSystem.isWritableFileEntry(entry, chrome.test.callbackPass(
+ function(isWritable) {
+ chrome.test.assertFalse(isWritable);
+ }));
+ }));
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698