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

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

Issue 660353003: [NaCl SDK] nacl_io: Fix utime() on directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // TODO(binji): If the server doesn't send the content length, this operation 236 // TODO(binji): If the server doesn't send the content length, this operation
237 // will be incredibly slow; it will attempt to read all of the data from the 237 // will be incredibly slow; it will attempt to read all of the data from the
238 // server to find the file length. Can we do anything smarter? 238 // server to find the file length. Can we do anything smarter?
239 ppapi_.server_template()->set_send_content_length(true); 239 ppapi_.server_template()->set_send_content_length(true);
240 240
241 ScopedNode node; 241 ScopedNode node;
242 ASSERT_EQ(0, fs_.Open(Path("/file"), O_RDONLY, &node)); 242 ASSERT_EQ(0, fs_.Open(Path("/file"), O_RDONLY, &node));
243 243
244 struct stat statbuf; 244 struct stat statbuf;
245 EXPECT_EQ(0, node->GetStat(&statbuf)); 245 EXPECT_EQ(0, node->GetStat(&statbuf));
246 EXPECT_EQ(S_IFREG | S_IRUSR | S_IRGRP | S_IROTH, statbuf.st_mode); 246 EXPECT_TRUE(S_ISREG(statbuf.st_mode));
247 EXPECT_EQ(S_IRUSR | S_IRGRP | S_IROTH, statbuf.st_mode & 0777);
247 EXPECT_EQ(size, statbuf.st_size); 248 EXPECT_EQ(size, statbuf.st_size);
248 // These are not currently set. 249 // These are not currently set.
249 EXPECT_EQ(0, statbuf.st_atime); 250 EXPECT_EQ(0, statbuf.st_atime);
250 EXPECT_EQ(0, statbuf.st_ctime); 251 EXPECT_EQ(0, statbuf.st_ctime);
251 EXPECT_EQ(0, statbuf.st_mtime); 252 EXPECT_EQ(0, statbuf.st_mtime);
252 } 253 }
253 254
254 // Instantiate the large file tests, only when cache content is off. 255 // Instantiate the large file tests, only when cache content is off.
255 // TODO(binji): make cache content smarter, so it doesn't try to cache enormous 256 // TODO(binji): make cache content smarter, so it doesn't try to cache enormous
256 // files. See http://crbug.com/369279. 257 // files. See http://crbug.com/369279.
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // Check access to blob file 391 // Check access to blob file
391 ASSERT_EQ(0, fs.Open(Path("/"), O_RDONLY, &node)); 392 ASSERT_EQ(0, fs.Open(Path("/"), O_RDONLY, &node));
392 ASSERT_EQ(true, node->IsaFile()); 393 ASSERT_EQ(true, node->IsaFile());
393 394
394 // Verify file size and permissions 395 // Verify file size and permissions
395 struct stat buf; 396 struct stat buf;
396 ASSERT_EQ(0, node->GetStat(&buf)); 397 ASSERT_EQ(0, node->GetStat(&buf));
397 ASSERT_EQ(S_IRUSR, buf.st_mode & S_IRWXU); 398 ASSERT_EQ(S_IRUSR, buf.st_mode & S_IRWXU);
398 ASSERT_EQ(strlen(kContent), buf.st_size); 399 ASSERT_EQ(strlen(kContent), buf.st_size);
399 } 400 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698