summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:18:09 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:18:09 +0000
commit108c2a1d2780d49121e16b18a29580ef4d28c790 (patch)
treeeca587b489c7c22924814f4475c4a56ec5bc5b8e /webkit
parent9e241cc8a7320c0a818da0ddac1bc3910fc1b60a (diff)
downloadchromium_src-108c2a1d2780d49121e16b18a29580ef4d28c790.zip
chromium_src-108c2a1d2780d49121e16b18a29580ef4d28c790.tar.gz
chromium_src-108c2a1d2780d49121e16b18a29580ef4d28c790.tar.bz2
Porting the browser tests to Unix.
The browser tests are an alternative to UI tests. They provide a way to exercise the browser from within the test (without having the test and the browser running in different processes). In order to ensure atexit hanlders are run after each tests and static initializers start fresh for each test, each test is run in a new process (on Linux and Mac). On Windows, a DLL containing the test is loaded/unloaded for each tests. BUG=None TEST=Run the browser tests. Review URL: http://codereview.chromium.org/115896 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_lib.cc15
-rw-r--r--webkit/glue/plugins/plugin_lib_mac.mm11
2 files changed, 13 insertions, 13 deletions
diff --git a/webkit/glue/plugins/plugin_lib.cc b/webkit/glue/plugins/plugin_lib.cc
index c5b2d21..563e1a3 100644
--- a/webkit/glue/plugins/plugin_lib.cc
+++ b/webkit/glue/plugins/plugin_lib.cc
@@ -15,14 +15,6 @@
#include "webkit/glue/plugins/plugin_host.h"
#include "webkit/glue/plugins/plugin_list.h"
-// A macro for converting string constants into appropriate
-// NativeLibraryFunctionNameTypes.
-#if defined(OS_MACOSX)
-#define NATIVE_LIBRARY_FUNCTION_NAME(x) CFSTR(x)
-#else
-#define NATIVE_LIBRARY_FUNCTION_NAME(x) x
-#endif // OS_*
-
namespace NPAPI
{
@@ -176,22 +168,21 @@ bool PluginLib::Load() {
entry_points_.np_initialize =
(NP_InitializeFunc)base::GetFunctionPointerFromNativeLibrary(library,
- NATIVE_LIBRARY_FUNCTION_NAME("NP_Initialize"));
+ "NP_Initialize");
if (entry_points_.np_initialize == 0)
rv = false;
#if !defined(OS_LINUX)
entry_points_.np_getentrypoints =
(NP_GetEntryPointsFunc)base::GetFunctionPointerFromNativeLibrary(
- library,
- NATIVE_LIBRARY_FUNCTION_NAME("NP_GetEntryPoints"));
+ library, "NP_GetEntryPoints");
if (entry_points_.np_getentrypoints == 0)
rv = false;
#endif
entry_points_.np_shutdown =
(NP_ShutdownFunc)base::GetFunctionPointerFromNativeLibrary(library,
- NATIVE_LIBRARY_FUNCTION_NAME("NP_Shutdown"));
+ "NP_Shutdown");
if (entry_points_.np_shutdown == 0)
rv = false;
} else {
diff --git a/webkit/glue/plugins/plugin_lib_mac.mm b/webkit/glue/plugins/plugin_lib_mac.mm
index 04510a4..4137dd8 100644
--- a/webkit/glue/plugins/plugin_lib_mac.mm
+++ b/webkit/glue/plugins/plugin_lib_mac.mm
@@ -8,7 +8,9 @@
#include "webkit/glue/plugins/plugin_lib.h"
+#include "base/native_library.h"
#include "base/scoped_cftyperef.h"
+#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "webkit/glue/plugins/plugin_list.h"
@@ -296,7 +298,14 @@ bool PluginLib::ReadWebPluginInfo(const FilePath &filename,
//
// Strictly speaking, only STR# 128 is required.
- scoped_cftyperef<CFBundleRef> bundle(base::LoadNativeLibrary(filename));
+ // We are accessing the bundle contained in the NativeLibrary but not
+ // unloading it. We use a scoped_ptr to make sure the NativeLibraryStruct is
+ // not leaked.
+ scoped_ptr<base::NativeLibraryStruct> native_library(
+ base::LoadNativeLibrary(filename));
+ if (native_library->type != base::BUNDLE)
+ return false;
+ scoped_cftyperef<CFBundleRef> bundle(native_library->bundle);
if (!bundle)
return false;