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

Side by Side Diff: content/common/sandbox_mac_unittest_helper.h

Issue 8589001: Load mac sandbox definitions from resources instead of the bundle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also remove old bundle gyp code Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ 5 #ifndef CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_
6 #define CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ 6 #define CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/test/multiprocess_test.h" 9 #include "base/test/multiprocess_test.h"
10 #include "content/common/sandbox_mac.h" 10 #include "content/common/sandbox_mac.h"
(...skipping 27 matching lines...) Expand all
38 // TEST_F(MacSandboxTest, ATest) { 38 // TEST_F(MacSandboxTest, ATest) {
39 // EXPECT_TRUE(RunTestInAllSandboxTypes( 39 // EXPECT_TRUE(RunTestInAllSandboxTypes(
40 // "TestCaseThatRunsInSandboxedSubprocess", 40 // "TestCaseThatRunsInSandboxedSubprocess",
41 // NULL)); 41 // NULL));
42 // } 42 // }
43 43
44 // Base test type with helper functions to spawn a subprocess that exercises 44 // Base test type with helper functions to spawn a subprocess that exercises
45 // a given test in the sandbox. 45 // a given test in the sandbox.
46 class MacSandboxTest : public base::MultiProcessTest { 46 class MacSandboxTest : public base::MultiProcessTest {
47 public: 47 public:
48 // Runs a test specified by |test_name| in a sandbox of the type specified 48 // Runs a test specified by |test_name| in a sandbox of the type specified by
Jói 2011/11/17 13:50:21 type specified by -> as defined by the resource wi
49 // by |sandbox_type|. |test_data| is a custom string that a test can pass 49 // |sandbox_definition_resource_id|. |test_data| is a custom string that a
50 // to the child process runing in the sandbox. 50 // test can pass to the child process runing in the sandbox.
51 // Returns true if the test passes, false if either of the functions in 51 // Returns true if the test passes, false if either of the functions in
52 // the corresponding MacSandboxTestCase return false. 52 // the corresponding MacSandboxTestCase return false.
53 bool RunTestInSandbox(sandbox::Sandbox::SandboxProcessType sandbox_type, 53 bool RunTestInSandbox(int sandbox_definition_resource_id,
54 const char* test_name, 54 const char* test_name,
55 const char* test_data); 55 const char* test_data);
56 56
57 // Runs the test specified by |test_name| in all the different sandbox types, 57 // Runs the test specified by |test_name| in all the different sandbox types,
58 // one by one. 58 // one by one.
59 // Returns true if the test passes, false if either of the functions in 59 // Returns true if the test passes, false if either of the functions in
60 // the corresponding MacSandboxTestCase return false in any of the spawned 60 // the corresponding MacSandboxTestCase return false in any of the spawned
61 // processes. 61 // processes.
62 bool RunTestInAllSandboxTypes(const char* test_name, 62 bool RunTestInAllSandboxTypes(const char* test_name,
63 const char* test_data); 63 const char* test_data);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 namespace { \ 108 namespace { \
109 sandboxtest::internal::RegisterSandboxTest<class_name> \ 109 sandboxtest::internal::RegisterSandboxTest<class_name> \
110 register_test##class_name(#class_name); \ 110 register_test##class_name(#class_name); \
111 } // namespace 111 } // namespace
112 112
113 } // namespace internal 113 } // namespace internal
114 114
115 } // namespace sandboxtest 115 } // namespace sandboxtest
116 116
117 #endif // CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ 117 #endif // CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698