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

Side by Side Diff: util/test/scoped_temp_dir_test.cc

Issue 837123005: win: Add implementation of ScopedTempDir (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: x instead of u Created 5 years, 11 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
« no previous file with comments | « util/test/scoped_temp_dir_posix.cc ('k') | util/test/scoped_temp_dir_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return true; 55 return true;
56 } 56 }
57 57
58 void CreateFile(const base::FilePath& path) { 58 void CreateFile(const base::FilePath& path) {
59 #if defined(OS_POSIX) 59 #if defined(OS_POSIX)
60 int fd = HANDLE_EINTR(creat(path.value().c_str(), 0644)); 60 int fd = HANDLE_EINTR(creat(path.value().c_str(), 0644));
61 ASSERT_GE(fd, 0) << ErrnoMessage("creat") << " " << path.value(); 61 ASSERT_GE(fd, 0) << ErrnoMessage("creat") << " " << path.value();
62 ASSERT_EQ(0, IGNORE_EINTR(close(fd))) 62 ASSERT_EQ(0, IGNORE_EINTR(close(fd)))
63 << ErrnoMessage("close") << " " << path.value(); 63 << ErrnoMessage("close") << " " << path.value();
64 #elif defined(OS_WIN) 64 #elif defined(OS_WIN)
65 int fd = _wcreat(path.value().c_str(), 0644); 65 int fd = _wcreat(path.value().c_str(), _S_IREAD | _S_IWRITE);
66 ASSERT_GE(fd, 0) << ErrnoMessage("_wcreat") << " " << path.value(); 66 ASSERT_GE(fd, 0) << ErrnoMessage("_wcreat") << " " << path.value();
67 ASSERT_EQ(0, _close(fd)) << ErrnoMessage("_close") << " " << path.value(); 67 ASSERT_EQ(0, _close(fd)) << ErrnoMessage("_close") << " " << path.value();
68 #else 68 #else
69 #error "Not implemented" 69 #error "Not implemented"
70 #endif 70 #endif
71 EXPECT_TRUE(FileExists(path)); 71 EXPECT_TRUE(FileExists(path));
72 } 72 }
73 73
74 void CreateDirectory(const base::FilePath& path) { 74 void CreateDirectory(const base::FilePath& path) {
75 #if defined(OS_POSIX) 75 #if defined(OS_POSIX)
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 EXPECT_FALSE(FileExists(file1)); 135 EXPECT_FALSE(FileExists(file1));
136 EXPECT_FALSE(FileExists(file2)); 136 EXPECT_FALSE(FileExists(file2));
137 EXPECT_FALSE(FileExists(child_dir)); 137 EXPECT_FALSE(FileExists(child_dir));
138 EXPECT_FALSE(FileExists(parent)); 138 EXPECT_FALSE(FileExists(parent));
139 } 139 }
140 140
141 } // namespace 141 } // namespace
142 } // namespace test 142 } // namespace test
143 } // namespace crashpad 143 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/test/scoped_temp_dir_posix.cc ('k') | util/test/scoped_temp_dir_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698