Chromium Code Reviews| Index: test/cctest/test-api.cc |
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
| index 33d505eaaa2640c1cb5018c5e60c521602a46a72..da9fed9b488d0ca04a641ac81f9c72eee38bb8fd 100644 |
| --- a/test/cctest/test-api.cc |
| +++ b/test/cctest/test-api.cc |
| @@ -13629,3 +13629,40 @@ TEST(DefinePropertyPostDetach) { |
| context->DetachGlobal(); |
| define_property->Call(proxy, 0, NULL); |
| } |
| + |
| + |
| +THREADED_TEST(CreationContext) { |
|
Mads Ager (chromium)
2011/04/01 11:19:38
Would be nice to extend this test with stuff creat
antonm
2011/04/01 12:15:46
Done. I'll add more if you think it's still not e
|
| + HandleScope handle_scope; |
| + Persistent<Context> context1 = Context::New(); |
| + Persistent<Context> context2 = Context::New(); |
| + |
| + Local<Object> object1; |
| + { |
| + Context::Scope scope(context1); |
| + object1 = Object::New(); |
| + } |
| + |
| + Local<Object> object2; |
| + { |
| + Context::Scope scope(context2); |
| + object2 = Object::New(); |
| + } |
| + |
| + CHECK(object1->CreationContext() == context1); |
| + CHECK(object2->CreationContext() == context2); |
| + |
| + { |
| + Context::Scope scope(context1); |
| + CHECK(object1->CreationContext() == context1); |
| + CHECK(object2->CreationContext() == context2); |
| + } |
| + |
| + { |
| + Context::Scope scope(context2); |
| + CHECK(object1->CreationContext() == context1); |
| + CHECK(object2->CreationContext() == context2); |
| + } |
| + |
| + context1.Dispose(); |
| + context2.Dispose(); |
| +} |