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

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

Issue 2808079: Mac: Fix broken valgrind suppressions. (Closed)
Patch Set: '' Created 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/valgrind/unit_tests.gtest_mac.txt » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_COMMON_SANDBOX_MAC_UNITTEST_RUNNER_H_ 5 #ifndef CHROME_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_
6 #define CHROME_COMMON_SANDBOX_MAC_UNITTEST_RUNNER_H_ 6 #define CHROME_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/multiprocess_test.h" 9 #include "base/multiprocess_test.h"
10 #include "chrome/common/sandbox_mac.h" 10 #include "chrome/common/sandbox_mac.h"
11 11
12 namespace sandboxtest { 12 namespace sandboxtest {
13 13
14 // Helpers for writing unit tests that runs in the context of the Mac sandbox. 14 // Helpers for writing unit tests that runs in the context of the Mac sandbox.
15 // 15 //
16 // How to write a sandboxed test: 16 // How to write a sandboxed test:
17 // 1. Create a class that inherits from MacSandboxTestCase and overrides 17 // 1. Create a class that inherits from MacSandboxTestCase and overrides
18 // it's functions to run code before or after the sandbox is initialised in a 18 // its functions to run code before or after the sandbox is initialised in a
19 // subprocess. 19 // subprocess.
20 // 2. Register the class you just created with the REGISTER_SANDBOX_TEST_CASE() 20 // 2. Register the class you just created with the REGISTER_SANDBOX_TEST_CASE()
21 // macro. 21 // macro.
22 // 3. Write a test [using TEST_F()] that inherits from MacSandboxTest and call 22 // 3. Write a test [using TEST_F()] that inherits from MacSandboxTest and call
23 // one of it's helper functions to launch the test. 23 // one of its helper functions to launch the test.
24 // 24 //
25 // Example: 25 // Example:
26 // class TestCaseThatRunsInSandboxedSubprocess : 26 // class TestCaseThatRunsInSandboxedSubprocess :
27 // public sandboxtest::MacSandboxTestCase { 27 // public sandboxtest::MacSandboxTestCase {
28 // public: 28 // public:
29 // virtual bool SandboxedTest() { 29 // virtual bool SandboxedTest() {
30 // .. test code that runs in sandbox goes here .. 30 // .. test code that runs in sandbox goes here ..
31 // return true; // always succeed. 31 // return true; // always succeed.
32 // } 32 // }
33 // }; 33 // };
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 #define REGISTER_SANDBOX_TEST_CASE(class_name) \ 107 #define REGISTER_SANDBOX_TEST_CASE(class_name) \
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 // CHROME_COMMON_SANDBOX_MAC_UNITTEST_RUNNER_H_ 117 #endif // CHROME_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/valgrind/unit_tests.gtest_mac.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698