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

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

Issue 6759054: Introduce v8::Object::CreationContext method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Next round Created 9 years, 9 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
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+}
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698