Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: webkit/tools/test_shell/test_webworker_helper.cc

Issue 66043: Make OSX TestShell able to run workers, using a new test_worker.dylib which i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/test_webworker_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_webworker_helper.cc
===================================================================
--- webkit/tools/test_shell/test_webworker_helper.cc (revision 13023)
+++ webkit/tools/test_shell/test_webworker_helper.cc (working copy)
@@ -11,13 +11,16 @@
#include "webkit/tools/test_shell/test_webworker_helper.h"
+#if defined(OS_MACOSX)
+#include <dlfcn.h>
+#endif
+
#include "base/logging.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
#include "webkit/glue/webworkerclient.h"
-
WebWorker* TestWebWorkerHelper::CreateWebWorker(WebWorkerClient* client) {
TestWebWorkerHelper* loader = new TestWebWorkerHelper();
return loader->CreateWebWorker_(client, loader);
@@ -43,28 +46,38 @@
return WTF::callOnMainThread(func, context);
}
-bool TestWebWorkerHelper::Load() {
-#if defined(OS_WIN)
+void TestWebWorkerHelper::Load() {
FilePath path;
PathService::Get(base::DIR_EXE, &path);
+
+#if defined(OS_WIN)
path = path.AppendASCII("test_worker.dll");
module_ = LoadLibrary(path.value().c_str());
if (module_ == 0)
- return false;
+ return;
CreateWebWorker_ = reinterpret_cast<CreateWebWorkerFunc>
(GetProcAddress(module_, "CreateWebWorker"));
if (!CreateWebWorker_) {
FreeLibrary(module_);
module_ = 0;
- return false;
}
+#elif defined(OS_MACOSX)
+ path = path.AppendASCII("test_worker.dylib");
- return true;
+ module_ = dlopen(path.value().c_str(), RTLD_NOW | RTLD_LOCAL);
+ if (!module_)
+ return;
+
+ CreateWebWorker_ = reinterpret_cast<CreateWebWorkerFunc>
+ (dlsym(module_, "CreateWebWorker"));
+ if (!CreateWebWorker_) {
+ dlclose(module_);
+ module_ = 0;
+ }
#else
NOTIMPLEMENTED();
- return false;
#endif
}
« no previous file with comments | « webkit/tools/test_shell/test_webworker_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698