summaryrefslogtreecommitdiffstats
path: root/chrome/test/security_tests/renderer_sandbox_tests_mac.h
blob: 36c60b50e3092aad2c660a4b28b705228832517b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_TEST_SECURITY_TESTS_RENDERER_SANDBOX_TESTS_MAC_H_
#define CHROME_TEST_SECURITY_TESTS_RENDERER_SANDBOX_TESTS_MAC_H_
#pragma once

#import <Foundation/Foundation.h>

#include <string>

// Callback function used by sandbox tests to print error messages. It's
// provided in order to avoid linking the logging code of the renderer into this
// loadable bundle. RendererMainPlatformDelegate provides an implementation.
//
//   |message|  - the message that's printed.
//   |is_error| - true if this is an error message, false if an info message.
typedef void (*LogRendererSandboxTestMessage)(std::string message,
                                              bool is_error);

// An ObjC wrapper around sandbox tests.
@interface RendererSandboxTestsRunner : NSObject

// Sets the function that logs the progress of the tests.
+ (void)setLogFunction:(LogRendererSandboxTestMessage)logFunction;

// Runs all tests and logs its progress using the provided log function.
// Returns YES if all tests passed, NO otherwise. This method should be called
// after the sandbox has been turned on.
+ (BOOL)runTests;

@end

#endif  // CHROME_TEST_SECURITY_TESTS_RENDERER_SANDBOX_TESTS_MAC_H_