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

Side by Side Diff: test/cctest/test-api.cc

Issue 11968011: Implement Context::GetIsolate() (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 const char* c_source = "1 + 2 + 3"; 162 const char* c_source = "1 + 2 + 3";
163 Local<String> source = String::New(c_source); 163 Local<String> source = String::New(c_source);
164 Local<Script> script = Script::Compile(source); 164 Local<Script> script = Script::Compile(source);
165 CHECK_EQ(6, script->Run()->Int32Value()); 165 CHECK_EQ(6, script->Run()->Int32Value());
166 166
167 local_env->Exit(); 167 local_env->Exit();
168 } 168 }
169 169
170 170
171 THREADED_TEST(IsolateOfContext) {
172 v8::HandleScope scope;
173 v8::Persistent<Context> env = Context::New();
174
175 CHECK(!env->InContext());
176 CHECK(env->GetIsolate() == v8::Isolate::GetCurrent());
177 env->Enter();
178 CHECK(env->InContext());
179 CHECK(env->GetIsolate() == v8::Isolate::GetCurrent());
180 env->Exit();
181 CHECK(!env->InContext());
182 CHECK(env->GetIsolate() == v8::Isolate::GetCurrent());
183
184 env.Dispose();
185 }
186
187
171 THREADED_TEST(ReceiverSignature) { 188 THREADED_TEST(ReceiverSignature) {
172 v8::HandleScope scope; 189 v8::HandleScope scope;
173 LocalContext env; 190 LocalContext env;
174 v8::Handle<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(); 191 v8::Handle<v8::FunctionTemplate> fun = v8::FunctionTemplate::New();
175 v8::Handle<v8::Signature> sig = v8::Signature::New(fun); 192 v8::Handle<v8::Signature> sig = v8::Signature::New(fun);
176 fun->PrototypeTemplate()->Set( 193 fun->PrototypeTemplate()->Set(
177 v8_str("m"), 194 v8_str("m"),
178 v8::FunctionTemplate::New(IncrementingSignatureCallback, 195 v8::FunctionTemplate::New(IncrementingSignatureCallback,
179 v8::Handle<Value>(), 196 v8::Handle<Value>(),
180 sig)); 197 sig));
(...skipping 17940 matching lines...) Expand 10 before | Expand all | Expand 10 after
18121 18138
18122 i::Semaphore* sem_; 18139 i::Semaphore* sem_;
18123 volatile int sem_value_; 18140 volatile int sem_value_;
18124 }; 18141 };
18125 18142
18126 18143
18127 THREADED_TEST(SemaphoreInterruption) { 18144 THREADED_TEST(SemaphoreInterruption) {
18128 ThreadInterruptTest().RunTest(); 18145 ThreadInterruptTest().RunTest();
18129 } 18146 }
18130 #endif // WIN32 18147 #endif // WIN32
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698