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

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

Issue 13940003: Move context retrieval method around. Use delegation for implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« 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 13392 matching lines...) Expand 10 before | Expand all | Expand 10 after
13403 v8::Persistent<Context> calling_context1; 13403 v8::Persistent<Context> calling_context1;
13404 v8::Persistent<Context> calling_context2; 13404 v8::Persistent<Context> calling_context2;
13405 13405
13406 13406
13407 // Check that the call to the callback is initiated in 13407 // Check that the call to the callback is initiated in
13408 // calling_context2, the directly calling context is calling_context1 13408 // calling_context2, the directly calling context is calling_context1
13409 // and the callback itself is in calling_context0. 13409 // and the callback itself is in calling_context0.
13410 static v8::Handle<Value> GetCallingContextCallback(const v8::Arguments& args) { 13410 static v8::Handle<Value> GetCallingContextCallback(const v8::Arguments& args) {
13411 ApiTestFuzzer::Fuzz(); 13411 ApiTestFuzzer::Fuzz();
13412 CHECK(Context::GetCurrent() == calling_context0); 13412 CHECK(Context::GetCurrent() == calling_context0);
13413 CHECK(Context::GetCurrent(args.GetIsolate()) == calling_context0); 13413 CHECK(args.GetIsolate()->GetCurrentContext() == calling_context0);
13414 CHECK(Context::GetCalling() == calling_context1); 13414 CHECK(Context::GetCalling() == calling_context1);
13415 CHECK(Context::GetEntered() == calling_context2); 13415 CHECK(Context::GetEntered() == calling_context2);
13416 return v8::Integer::New(42); 13416 return v8::Integer::New(42);
13417 } 13417 }
13418 13418
13419 13419
13420 THREADED_TEST(GetCallingContext) { 13420 THREADED_TEST(GetCallingContext) {
13421 v8::HandleScope scope(v8::Isolate::GetCurrent()); 13421 v8::HandleScope scope(v8::Isolate::GetCurrent());
13422 13422
13423 calling_context0 = Context::New(); 13423 calling_context0 = Context::New();
(...skipping 4896 matching lines...) Expand 10 before | Expand all | Expand 10 after
18320 i::Semaphore* sem_; 18320 i::Semaphore* sem_;
18321 volatile int sem_value_; 18321 volatile int sem_value_;
18322 }; 18322 };
18323 18323
18324 18324
18325 THREADED_TEST(SemaphoreInterruption) { 18325 THREADED_TEST(SemaphoreInterruption) {
18326 ThreadInterruptTest().RunTest(); 18326 ThreadInterruptTest().RunTest();
18327 } 18327 }
18328 18328
18329 #endif // WIN32 18329 #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