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

Unified Diff: native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc

Issue 15800004: [NaCl SDK] nacl_io: Added support for access() syscall. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to HEAD. Created 7 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
Index: native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc
diff --git a/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc b/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc
index f7c21de5abbddc74730baba4a0efa0c0fea6f469..4c885afc01361bbe9876bce76d1d74d6d6f96ca4 100644
--- a/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc
+++ b/native_client_sdk/src/libraries/nacl_io_test/mount_http_test.cc
@@ -386,6 +386,36 @@ TEST_F(MountHttpNodeTest, GetStat) {
EXPECT_EQ(42, stat.st_size);
}
+TEST_F(MountHttpNodeTest, Access) {
+ StringMap_t smap;
+ smap["cache_content"] = "false";
+ SetMountArgs(StringMap_t());
+ ExpectOpen("HEAD");
+ ExpectHeaders("");
+ SetResponse(200, "");
+ ASSERT_EQ(0, mnt_->Access(Path(path_), R_OK));
+}
+
+TEST_F(MountHttpNodeTest, AccessWrite) {
+ StringMap_t smap;
+ smap["cache_content"] = "false";
+ SetMountArgs(StringMap_t());
+ ExpectOpen("HEAD");
+ ExpectHeaders("");
+ SetResponse(200, "");
+ ASSERT_EQ(EACCES, mnt_->Access(Path(path_), W_OK));
+}
+
+TEST_F(MountHttpNodeTest, AccessNotFound) {
+ StringMap_t smap;
+ smap["cache_content"] = "false";
+ SetMountArgs(StringMap_t());
+ ExpectOpen("HEAD");
+ ExpectHeaders("");
+ SetResponseExpectFail(404, "");
+ ASSERT_EQ(ENOENT, mnt_->Access(Path(path_), R_OK));
+}
+
TEST_F(MountHttpNodeTest, ReadCached) {
size_t result_size = 0;
int result_bytes = 0;

Powered by Google App Engine
This is Rietveld 408576698