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

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

Issue 2671703002: Add test to check for initial objects. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index 60dc1dde2b3247c3d327bcc07a8eed2d87e4484b..b8ae486c328200ce806659328912a7fa98129f39 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -108,6 +108,33 @@ TEST(ContextMaps) {
Context::PROMISE_FUNCTION_INDEX);
}
+TEST(InitialObjects) {
+ LocalContext env;
+ HandleScope scope(CcTest::i_isolate());
+ Handle<Context> context = v8::Utils::OpenHandle(*env);
+ // Initial ArrayIterator prototype.
+ CHECK_EQ(
+ context->initial_array_iterator_prototype(),
+ *v8::Utils::OpenHandle(*CompileRun("[][Symbol.iterator]().__proto__")));
+ // Initial ArrayIterator prototype map.
+ CHECK_EQ(context->initial_array_iterator_prototype_map(),
+ context->initial_array_iterator_prototype()->map());
+ // Initial Array prototype.
+ CHECK_EQ(context->initial_array_prototype(),
+ *v8::Utils::OpenHandle(*CompileRun("Array.prototype")));
+ // Initial Generator prototype.
+ CHECK_EQ(context->initial_generator_prototype(),
+ *v8::Utils::OpenHandle(
+ *CompileRun("(function*(){}).__proto__.prototype")));
+ // Initial Iterator prototype.
+ CHECK_EQ(context->initial_iterator_prototype(),
+ *v8::Utils::OpenHandle(
+ *CompileRun("[][Symbol.iterator]().__proto__.__proto__")));
+ // Initial Object prototype.
+ CHECK_EQ(context->initial_object_prototype(),
+ *v8::Utils::OpenHandle(*CompileRun("Object.prototype")));
+}
+
static void CheckOddball(Isolate* isolate, Object* obj, const char* string) {
CHECK(obj->IsOddball());
Handle<Object> handle(obj, isolate);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698