diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/content_common.gypi | 2 | ||||
-rw-r--r-- | content/plugin/plugin_main.cc | 2 | ||||
-rw-r--r-- | content/public/common/injection_test_mac.h | 34 | ||||
-rw-r--r-- | content/public/common/injection_test_win.h (renamed from content/common/injection_test_dll.h) | 6 | ||||
-rw-r--r-- | content/renderer/DEPS | 2 | ||||
-rw-r--r-- | content/renderer/renderer_main_platform_delegate_mac.mm | 2 | ||||
-rw-r--r-- | content/renderer/renderer_main_platform_delegate_win.cc | 2 |
7 files changed, 42 insertions, 8 deletions
diff --git a/content/content_common.gypi b/content/content_common.gypi index 725c330..2599db3 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -58,6 +58,8 @@ 'public/common/gpu_info.cc', 'public/common/gpu_info.h', 'public/common/gpu_performance_stats.h', + 'public/common/injection_test_mac.h', + 'public/common/injection_test_win.h', 'public/common/javascript_message_type.h', 'public/common/main_function_params.h', 'public/common/media_stream_request.cc', diff --git a/content/plugin/plugin_main.cc b/content/plugin/plugin_main.cc index 67321cd..14db48e0 100644 --- a/content/plugin/plugin_main.cc +++ b/content/plugin/plugin_main.cc @@ -22,7 +22,7 @@ #include "content/public/common/main_function_params.h" #if defined(OS_WIN) -#include "content/common/injection_test_dll.h" +#include "content/public/common/injection_test_win.h" #include "sandbox/win/src/sandbox.h" #elif defined(OS_POSIX) && !defined(OS_MACOSX) #include "base/global_descriptors_posix.h" diff --git a/content/public/common/injection_test_mac.h b/content/public/common/injection_test_mac.h new file mode 100644 index 0000000..c95e86a --- /dev/null +++ b/content/public/common/injection_test_mac.h @@ -0,0 +1,34 @@ +// 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 CONTENT_PUBLIC_COMMON_INJECTION_TEST_MAC_H_ +#define CONTENT_PUBLIC_COMMON_INJECTION_TEST_MAC_H_ + +#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 // CONTENT_PUBLIC_COMMON_INJECTION_TEST_MAC_H_ diff --git a/content/common/injection_test_dll.h b/content/public/common/injection_test_win.h index 94205bf..cc1e684 100644 --- a/content/common/injection_test_dll.h +++ b/content/public/common/injection_test_win.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_COMMON_INJECTION_TEST_DLL_H_ -#define CONTENT_COMMON_INJECTION_TEST_DLL_H_ +#ifndef CONTENT_COMMON_INJECTION_TEST_WIN_H_ +#define CONTENT_COMMON_INJECTION_TEST_WIN_H_ // This file defines the entry points for any DLL that can be loaded into the // renderer or plugin process for the purposes of testing. The DLL code must @@ -23,4 +23,4 @@ typedef BOOL (__cdecl *RunPluginTests)(int* test_count); #endif } -#endif // CONTENT_COMMON_INJECTION_TEST_DLL_H_ +#endif // CONTENT_COMMON_INJECTION_TEST_WIN_H_ diff --git a/content/renderer/DEPS b/content/renderer/DEPS index c5e4509..e28b22a 100644 --- a/content/renderer/DEPS +++ b/content/renderer/DEPS @@ -1,6 +1,4 @@ include_rules = [ - # TODO(avi): remove this chrome include http://crbug.com/139631 - "+chrome/test/security_tests/renderer_sandbox_tests_mac.h", "+content/public/renderer", "+content/public/browser/native_web_keyboard_event.h", # For tests. "+content/public/browser/web_ui_controller_factory.h", # For tests. diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm index 6846f32..8bc92d8 100644 --- a/content/renderer/renderer_main_platform_delegate_mac.mm +++ b/content/renderer/renderer_main_platform_delegate_mac.mm @@ -10,9 +10,9 @@ #include "base/command_line.h" #include "base/logging.h" #include "base/sys_string_conversions.h" -#import "chrome/test/security_tests/renderer_sandbox_tests_mac.h" #include "content/common/sandbox_mac.h" #include "content/public/common/content_switches.h" +#import "content/public/common/injection_test_mac.h" #include "content/common/sandbox_init_mac.h" RendererMainPlatformDelegate::RendererMainPlatformDelegate( diff --git a/content/renderer/renderer_main_platform_delegate_win.cc b/content/renderer/renderer_main_platform_delegate_win.cc index a4f3095..19467d5 100644 --- a/content/renderer/renderer_main_platform_delegate_win.cc +++ b/content/renderer/renderer_main_platform_delegate_win.cc @@ -10,8 +10,8 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/win/win_util.h" -#include "content/common/injection_test_dll.h" #include "content/public/common/content_switches.h" +#include "content/public/common/injection_test_win.h" #include "content/public/renderer/render_thread.h" #include "sandbox/win/src/sandbox.h" #include "skia/ext/skia_sandbox_support_win.h" |