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

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

Issue 11441: Add an API test for v8::ScriptData::PreCompile() to make sure... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 778)
+++ test/cctest/test-api.cc (working copy)
@@ -5274,3 +5274,17 @@
value = CompileRun("obj.externalSymbol722 = 42");
v8::V8::SetExternalSymbolCallback(NULL);
}
+
+
+// This test verifies that pre-compilation (aka preparsing) can be called
+// without initializing the whole VM. Thus we cannot run this test in a
+// multi-threaded setup.
+TEST(PreCompile) {
+ // TODO(155): This test would break without the initialization of V8. This is
+ // a workaround for now to make this test not fail.
+ v8::V8::Initialize();
+ const char *script = "function foo(a) { return a+1; }";
+ v8::ScriptData *sd = v8::ScriptData::PreCompile(script, strlen(script));
+ CHECK_NE(sd->Length(), 0);
+ CHECK_NE(sd->Data(), NULL);
+}
« 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