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

Unified Diff: test/cctest/cctest.h

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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 | « src/zone-inl.h ('k') | test/cctest/cctest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.h
===================================================================
--- test/cctest/cctest.h (revision 3427)
+++ test/cctest/cctest.h (working copy)
@@ -29,6 +29,7 @@
#define CCTEST_H_
#include "v8.h"
+#include "v8-global-context.h"
#ifndef TEST
#define TEST(Name) \
@@ -56,7 +57,7 @@
typedef void (TestFunction)();
CcTest(TestFunction* callback, const char* file, const char* name,
const char* dependency, bool enabled);
- void Run() { callback_(); }
+ void Run();
static int test_count();
static CcTest* last() { return last_; }
CcTest* prev() { return prev_; }
@@ -74,6 +75,19 @@
CcTest* prev_;
};
+class V8Runner: public v8::internal::Thread {
+ CcTest::TestFunction* callback_;
+
+ virtual void Run() {
+ v8::V8ContextProvider v8context_provider;
+ v8::V8ContextBinder v8context_binder(v8context_provider);
+ callback_();
+ }
+ public:
+ explicit V8Runner(CcTest::TestFunction* callback)
+ :callback_(callback) {}
+};
+
// Switches between all the Api tests using the threading support.
// In order to get a surprising but repeatable pattern of thread
// switching it has extra semaphores to control the order in which
« no previous file with comments | « src/zone-inl.h ('k') | test/cctest/cctest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698