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

Side by Side Diff: sandbox/src/named_pipe_policy_test.cc

Issue 160176: Merge 21292 - Fix FORWARD_NULL defects reported by Coverity. We should... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sandbox/src/process_policy_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /trunk/src/sandbox/src/named_pipe_policy_test.cc:r21292
Merged /branches/chrome_webkit_merge_branch/sandbox/src/named_pipe_policy_test.cc:r69-2775
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "sandbox/src/sandbox.h" 6 #include "sandbox/src/sandbox.h"
7 #include "sandbox/src/sandbox_policy.h" 7 #include "sandbox/src/sandbox_policy.h"
8 #include "sandbox/src/sandbox_factory.h" 8 #include "sandbox/src/sandbox_factory.h"
9 #include "sandbox/tests/common/controller.h" 9 #include "sandbox/tests/common/controller.h"
10 10
11 namespace sandbox { 11 namespace sandbox {
12 12
13 13
14 SBOX_TESTS_COMMAND int NamedPipe_Create(int argc, wchar_t **argv) { 14 SBOX_TESTS_COMMAND int NamedPipe_Create(int argc, wchar_t **argv) {
15 if (argc != 1) { 15 if (argc != 1) {
16 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; 16 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND;
17 } 17 }
18 if ((NULL != argv) && (NULL == argv[0])) { 18 if ((NULL == argv) || (NULL == argv[0])) {
19 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND; 19 return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND;
20 } 20 }
21 21
22 HANDLE pipe = ::CreateNamedPipeW(argv[0], 22 HANDLE pipe = ::CreateNamedPipeW(argv[0],
23 PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, 23 PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
24 PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 1, 4096, 24 PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 1, 4096,
25 4096, 2000, NULL); 25 4096, 2000, NULL);
26 if (INVALID_HANDLE_VALUE == pipe) 26 if (INVALID_HANDLE_VALUE == pipe)
27 return SBOX_TEST_DENIED; 27 return SBOX_TEST_DENIED;
28 28
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // namedpipe name. Here we apply it like a wildcard. http://b/893603 67 // namedpipe name. Here we apply it like a wildcard. http://b/893603
68 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_NAMED_PIPES, 68 EXPECT_TRUE(runner.AddRule(TargetPolicy::SUBSYS_NAMED_PIPES,
69 TargetPolicy::NAMEDPIPES_ALLOW_ANY, 69 TargetPolicy::NAMEDPIPES_ALLOW_ANY,
70 L"\\\\.\\pipe\\test*")); 70 L"\\\\.\\pipe\\test*"));
71 71
72 EXPECT_EQ(SBOX_TEST_SUCCEEDED, 72 EXPECT_EQ(SBOX_TEST_SUCCEEDED,
73 runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\testbleh")); 73 runner.RunTest(L"NamedPipe_Create \\\\.\\pipe\\testbleh"));
74 } 74 }
75 75
76 } // namespace sandbox 76 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/src/process_policy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698