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

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

Issue 1128113006: Add the concept of a V8 extras exports object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Was mising test-extra.js :( Created 5 years, 7 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/runtime/runtime-test.cc ('k') | test/cctest/test-extra.js » ('j') | 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 a434098cc0a316e331de0bef222f5b845bcc5a52..43d2c7447394e69e8f39a9720560ea45a4066f5c 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -21029,3 +21029,21 @@ TEST(SealHandleScopeNested) {
USE(obj);
}
}
+
+
+TEST(ExtrasExportsObject) {
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope handle_scope(isolate);
+ LocalContext env;
+
+ // standalone.gypi ensures we include the test-extra.js file, which should
+ // add the testExtraShouldReturnFive export
+ v8::Local<v8::Object> exports = env->GetExtrasExportsObject();
+
+ auto func =
+ exports->Get(v8_str("testExtraShouldReturnFive")).As<v8::Function>();
+ auto undefined = v8::Undefined(isolate);
+ auto result = func->Call(undefined, 0, {}).As<v8::Number>();
+
+ CHECK(result->Value() == 5.0);
+}
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | test/cctest/test-extra.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698