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

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

Issue 199063003: New Compilation API, part 1, try 2 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« no previous file with comments | « test/cctest/test-cpu-profiler.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
index 431bef1d812a81ac147624f14bf21d5c6b2ce6ea..9dfabe1e6a51836ba50f0db4debaaf53f5129340 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -2218,8 +2218,7 @@ TEST(ScriptBreakPointLineTopLevel) {
v8::Local<v8::Function> f;
{
v8::HandleScope scope(env->GetIsolate());
- v8::Script::Compile(
- script, v8::String::NewFromUtf8(env->GetIsolate(), "test.html"))->Run();
+ CompileRunWithOrigin(script, "test.html");
}
f = v8::Local<v8::Function>::Cast(
env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f")));
@@ -2235,8 +2234,7 @@ TEST(ScriptBreakPointLineTopLevel) {
// Recompile and run script and check that break point was hit.
break_point_hit_count = 0;
- v8::Script::Compile(
- script, v8::String::NewFromUtf8(env->GetIsolate(), "test.html"))->Run();
+ CompileRunWithOrigin(script, "test.html");
CHECK_EQ(1, break_point_hit_count);
// Call f and check that there are still no break points.
@@ -2271,9 +2269,7 @@ TEST(ScriptBreakPointTopLevelCrash) {
{
v8::HandleScope scope(env->GetIsolate());
break_point_hit_count = 0;
- v8::Script::Compile(script_source,
- v8::String::NewFromUtf8(env->GetIsolate(), "test.html"))
- ->Run();
+ CompileRunWithOrigin(script_source, "test.html");
CHECK_EQ(1, break_point_hit_count);
}
@@ -6246,8 +6242,7 @@ TEST(ScriptNameAndData) {
CHECK_EQ(3, break_point_hit_count);
CHECK_EQ("new name", last_script_name_hit);
- v8::Handle<v8::Script> script3 = v8::Script::Compile(
- script, &origin2, NULL);
+ v8::Handle<v8::Script> script3 = v8::Script::Compile(script, &origin2);
script3->Run();
f = v8::Local<v8::Function>::Cast(
env->Global()->Get(v8::String::NewFromUtf8(env->GetIsolate(), "f")));
@@ -6988,7 +6983,7 @@ TEST(Backtrace) {
v8::Handle<v8::String> void0 =
v8::String::NewFromUtf8(env->GetIsolate(), "void(0)");
- v8::Handle<v8::Script> script = v8::Script::Compile(void0, void0);
+ v8::Handle<v8::Script> script = CompileWithOrigin(void0, void0);
// Check backtrace from "void(0)" script.
BacktraceData::frame_counter = -10;
@@ -7008,18 +7003,20 @@ TEST(Backtrace) {
TEST(GetMirror) {
DebugLocalContext env;
- v8::HandleScope scope(env->GetIsolate());
+ v8::Isolate* isolate = env->GetIsolate();
+ v8::HandleScope scope(isolate);
v8::Handle<v8::Value> obj =
- v8::Debug::GetMirror(v8::String::NewFromUtf8(env->GetIsolate(), "hodja"));
+ v8::Debug::GetMirror(v8::String::NewFromUtf8(isolate, "hodja"));
v8::Handle<v8::Function> run_test =
- v8::Handle<v8::Function>::Cast(v8::Script::New(
- v8::String::NewFromUtf8(
- env->GetIsolate(),
- "function runTest(mirror) {"
- " return mirror.isString() && (mirror.length() == 5);"
- "}"
- ""
- "runTest;"))->Run());
+ v8::Handle<v8::Function>::Cast(
+ v8::ScriptCompiler::CompileUnbound(
+ isolate,
+ v8::ScriptCompiler::Source(v8_str(
+ "function runTest(mirror) {"
+ " return mirror.isString() && (mirror.length() == 5);"
+ "}"
+ ""
+ "runTest;")))->BindToCurrentContext()->Run());
v8::Handle<v8::Value> result = run_test->Call(env->Global(), 1, &obj);
CHECK(result->IsTrue());
}
« no previous file with comments | « test/cctest/test-cpu-profiler.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698