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

Unified Diff: webkit/fileapi/isolated_context_unittest.cc

Issue 10540070: Make Isolated file system writable only if it is configured so (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added writer wiring for sandbox and test mpp Created 8 years, 6 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
« no previous file with comments | « webkit/fileapi/isolated_context.cc ('k') | webkit/fileapi/isolated_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_context_unittest.cc
diff --git a/webkit/fileapi/isolated_context_unittest.cc b/webkit/fileapi/isolated_context_unittest.cc
index 5a828f58d98d917dc8dfdb6e104eeed7fc05cd91..a1b138b691f5cc60e130afe3285fde6f826aeec6 100644
--- a/webkit/fileapi/isolated_context_unittest.cc
+++ b/webkit/fileapi/isolated_context_unittest.cc
@@ -165,4 +165,28 @@ TEST_F(IsolatedContextTest, TestWithVirtualRoot) {
virtual_path, &cracked_id, &root_path, &cracked_path));
}
+TEST_F(IsolatedContextTest, Writable) {
+ // By default the file system must be read-only.
+ ASSERT_FALSE(isolated_context()->IsWritable(id_));
+
+ // Set writable.
+ ASSERT_TRUE(isolated_context()->SetWritable(id_, true));
+ ASSERT_TRUE(isolated_context()->IsWritable(id_));
+
+ // Set non-writable.
+ ASSERT_TRUE(isolated_context()->SetWritable(id_, false));
+ ASSERT_FALSE(isolated_context()->IsWritable(id_));
+
+ // Set writable again, and revoke the filesystem.
+ ASSERT_TRUE(isolated_context()->SetWritable(id_, true));
+ isolated_context()->RevokeIsolatedFileSystem(id_);
+
+ // IsWritable should return false for non-registered file system.
+ ASSERT_FALSE(isolated_context()->IsWritable(id_));
+ // SetWritable should also return false for non-registered file system
+ // (no matter what value we give).
+ ASSERT_FALSE(isolated_context()->SetWritable(id_, true));
+ ASSERT_FALSE(isolated_context()->SetWritable(id_, false));
+}
+
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/isolated_context.cc ('k') | webkit/fileapi/isolated_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698