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

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

Issue 1889903003: [api] Expose ES6 7.3.14 SetIntegrityLevel on v8::Object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « 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 6bea3eaefee603ed7bc02a56be251082ba6ad27a..d06cd7e7c1f13aceabc30badd25be5844cf6a45f 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -24985,3 +24985,21 @@ TEST(MemoryPressure) {
isolate->MemoryPressureNotification(v8::MemoryPressureLevel::kNone);
CHECK(!CcTest::i_isolate()->heap()->ShouldOptimizeForMemoryUsage());
}
+
+TEST(SetIntegrityLevel) {
+ LocalContext context;
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope scope(isolate);
+
+ v8::Local<v8::Object> obj = v8::Object::New(isolate);
+ CHECK(context->Global()->Set(context.local(), v8_str("o"), obj).FromJust());
+
+ v8::Local<v8::Value> is_frozen = CompileRun("Object.isFrozen(o)");
+ CHECK(!is_frozen->BooleanValue(context.local()).FromJust());
+
+ CHECK(obj->SetIntegrityLevel(context.local(), v8::IntegrityLevel::kFrozen)
+ .FromJust());
+
+ is_frozen = CompileRun("Object.isFrozen(o)");
+ CHECK(is_frozen->BooleanValue(context.local()).FromJust());
+}
« 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