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

Unified Diff: base/memory/shared_memory_unittest.cc

Issue 444323005: Add DACL and fix test for anonymous read-only memory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more tests Created 6 years, 4 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 | « no previous file | base/memory/shared_memory_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_unittest.cc
diff --git a/base/memory/shared_memory_unittest.cc b/base/memory/shared_memory_unittest.cc
index 4d49c36f13656d45445f2d69318158b9899a5fac..1b05e72f683c9c6839018d53b2ebdeb2f17c793f 100644
--- a/base/memory/shared_memory_unittest.cc
+++ b/base/memory/shared_memory_unittest.cc
@@ -434,7 +434,7 @@ TEST(SharedMemoryTest, ShareReadOnly) {
HANDLE temp_handle;
BOOL rv = ::DuplicateHandle(GetCurrentProcess(),
handle,
- GetCurrentProcess,
+ GetCurrentProcess(),
&temp_handle,
FILE_MAP_ALL_ACCESS,
false,
@@ -443,6 +443,17 @@ TEST(SharedMemoryTest, ShareReadOnly) {
<< "Shouldn't be able to duplicate the handle into a writable one.";
if (rv)
base::win::ScopedHandle writable_handle(temp_handle);
+ rv = ::DuplicateHandle(GetCurrentProcess(),
+ handle,
+ GetCurrentProcess(),
+ &temp_handle,
+ FILE_MAP_READ,
+ false,
+ 0);
+ EXPECT_EQ(TRUE, rv)
+ << "Should be able to duplicate the handle into a readable one.";
+ if (rv)
+ base::win::ScopedHandle writable_handle(temp_handle);
#else
#error Unexpected platform; write a test that tries to make 'handle' writable.
#endif // defined(OS_POSIX) || defined(OS_WIN)
« no previous file with comments | « no previous file | base/memory/shared_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698