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

Side by Side Diff: native_client_sdk/src/tests/nacl_io_test/mount_http_test.cc

Issue 98713004: NaCl: Update revision in DEPS, r12488 -> r12497 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix out-of-bounds std::map access in nacl_io testing, and correspondingly broken test. All used pa… Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <fcntl.h> 5 #include <fcntl.h>
6 #include <gmock/gmock.h> 6 #include <gmock/gmock.h>
7 #include <ppapi/c/ppb_file_io.h> 7 #include <ppapi/c/ppb_file_io.h>
8 #include <ppapi/c/pp_errors.h> 8 #include <ppapi/c/pp_errors.h>
9 #include <ppapi/c/pp_instance.h> 9 #include <ppapi/c/pp_instance.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 ASSERT_EQ(0, mnt_.Access(Path("/foo"), R_OK)); 79 ASSERT_EQ(0, mnt_.Access(Path("/foo"), R_OK));
80 ASSERT_EQ(EACCES, mnt_.Access(Path("/foo"), W_OK)); 80 ASSERT_EQ(EACCES, mnt_.Access(Path("/foo"), W_OK));
81 ASSERT_EQ(EACCES, mnt_.Access(Path("/foo"), X_OK)); 81 ASSERT_EQ(EACCES, mnt_.Access(Path("/foo"), X_OK));
82 ASSERT_EQ(ENOENT, mnt_.Access(Path("/bar"), F_OK)); 82 ASSERT_EQ(ENOENT, mnt_.Access(Path("/bar"), F_OK));
83 } 83 }
84 84
85 TEST_P(MountHttpTest, OpenAndCloseServerError) { 85 TEST_P(MountHttpTest, OpenAndCloseServerError) {
86 EXPECT_TRUE(ppapi_.server_template()->AddError("file", 500)); 86 EXPECT_TRUE(ppapi_.server_template()->AddError("file", 500));
87 87
88 ScopedMountNode node; 88 ScopedMountNode node;
89 ASSERT_EQ(ENOENT, mnt_.Open(Path("/file"), O_RDONLY, &node)); 89 ASSERT_EQ(EIO, mnt_.Open(Path("/file"), O_RDONLY, &node));
90 } 90 }
91 91
92 TEST_P(MountHttpTest, ReadPartial) { 92 TEST_P(MountHttpTest, ReadPartial) {
93 const char contents[] = "0123456789abcdefg"; 93 const char contents[] = "0123456789abcdefg";
94 ASSERT_TRUE(ppapi_.server_template()->AddEntity("file", contents, NULL)); 94 ASSERT_TRUE(ppapi_.server_template()->AddEntity("file", contents, NULL));
95 ppapi_.server_template()->set_allow_partial(true); 95 ppapi_.server_template()->set_allow_partial(true);
96 96
97 int result_bytes = 0; 97 int result_bytes = 0;
98 98
99 char buf[10]; 99 char buf[10];
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 EXPECT_FALSE(foo->GetStat(&sfoo)); 291 EXPECT_FALSE(foo->GetStat(&sfoo));
292 EXPECT_FALSE(bar->GetStat(&sbar)); 292 EXPECT_FALSE(bar->GetStat(&sbar));
293 293
294 EXPECT_EQ(123, sfoo.st_size); 294 EXPECT_EQ(123, sfoo.st_size);
295 EXPECT_EQ(S_IFREG | S_IRALL, sfoo.st_mode); 295 EXPECT_EQ(S_IFREG | S_IRALL, sfoo.st_mode);
296 296
297 EXPECT_EQ(234, sbar.st_size); 297 EXPECT_EQ(234, sbar.st_size);
298 EXPECT_EQ(S_IFREG | S_IRALL | S_IWALL, sbar.st_mode); 298 EXPECT_EQ(S_IFREG | S_IRALL | S_IWALL, sbar.st_mode);
299 } 299 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/tests/nacl_io_test/fake_pepper_interface_url_loader.cc ('k') | third_party/jsoncpp/jsoncpp.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698