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

Unified Diff: test/cctest/test-random.cc

Issue 14793004: deprecate Context::New which returns Persistent (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: use Reset instead of operator= Created 7 years, 7 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 | « test/cctest/test-profile-generator.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-random.cc
diff --git a/test/cctest/test-random.cc b/test/cctest/test-random.cc
index 6b6e0e0ff1a101292703b0b3799650a38094d29c..0837ab3e360307febecf069582a8914da89e6b04 100644
--- a/test/cctest/test-random.cc
+++ b/test/cctest/test-random.cc
@@ -39,8 +39,6 @@
using namespace v8::internal;
-static v8::Persistent<v8::Context> env;
-
void SetSeeds(Handle<ByteArray> seeds, uint32_t state0, uint32_t state1) {
for (int i = 0; i < 4; i++) {
@@ -73,11 +71,12 @@ void TestSeeds(Handle<JSFunction> fun,
TEST(CrankshaftRandom) {
- if (env.IsEmpty()) env = v8::Context::New();
+ v8::V8::Initialize();
// Skip test if crankshaft is disabled.
if (!V8::UseCrankshaft()) return;
- v8::HandleScope scope(env->GetIsolate());
- env->Enter();
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope scope(isolate);
+ v8::Context::Scope context_scope(v8::Context::New(isolate));
Handle<Context> context(Isolate::Current()->context());
Handle<JSObject> global(context->global_object());
« no previous file with comments | « test/cctest/test-profile-generator.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698