OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BlinkFuzzerTestSupport_h | 5 #ifndef BlinkFuzzerTestSupport_h |
6 #define BlinkFuzzerTestSupport_h | 6 #define BlinkFuzzerTestSupport_h |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 | 9 |
10 // InitializeBlinkFuzzTest will spin up an environment similar to | 10 // Instantiating BlinkFuzzerTestSupport will spin up an environment similar to |
11 // webkit_unit_tests. It should be called in LLVMFuzzerInitialize. | 11 // webkit_unit_tests. It should be statically initialized and leaked in fuzzers. |
12 void InitializeBlinkFuzzTest(int* argc, char*** argv); | 12 class BlinkFuzzerTestSupport { |
| 13 public: |
| 14 // Use this constructor in LLVMFuzzerTestOneInput. |
| 15 BlinkFuzzerTestSupport(); |
| 16 |
| 17 // Use this constructor in LLVMFuzzerInitialize only if argv is necessary. |
| 18 BlinkFuzzerTestSupport(int argc, char** argv); |
| 19 ~BlinkFuzzerTestSupport(); |
| 20 }; |
13 | 21 |
14 } // namespace blink | 22 } // namespace blink |
15 | 23 |
16 #endif // BlinkFuzzerTestSupport_h | 24 #endif // BlinkFuzzerTestSupport_h |
OLD | NEW |