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 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_PUBLIC_COMMON_INJECTION_TEST_MAC_H_ 6 #define CONTENT_PUBLIC_COMMON_INJECTION_TEST_MAC_H_ 7 8 #import <Foundation/Foundation.h> 9 10 #include <string> 11 12 // Callback function used by sandbox tests to print error messages. It's 13 // provided in order to avoid linking the logging code of the renderer into this 14 // loadable bundle. RendererMainPlatformDelegate provides an implementation. 15 // 16 // |message| - the message that's printed. 17 // |is_error| - true if this is an error message, false if an info message. 18 typedef void (*LogRendererSandboxTestMessage)(std::string message, 19 bool is_error); 20 21 // An ObjC wrapper around sandbox tests. 22 @interface RendererSandboxTestsRunner : NSObject 23 24 // Sets the function that logs the progress of the tests. 25 + (void)setLogFunction:(LogRendererSandboxTestMessage)logFunction; 26 27 // Runs all tests and logs its progress using the provided log function. 28 // Returns YES if all tests passed, NO otherwise. This method should be called 29 // after the sandbox has been turned on. 30 + (BOOL)runTests; 31 32 @end 33 34 #endif // CONTENT_PUBLIC_COMMON_INJECTION_TEST_MAC_H_ 35