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

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

Issue 983603003: Allow passing sourceMapUrl when compiling scripts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 10 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/compiler/test-linkage.cc ('k') | test/cctest/test-compiler.cc » ('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 44270382d4e76e9f03e04d629066efd59d72b7d6..907543ef548188395804bc57f22c7257ed657631 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -3894,6 +3894,7 @@ static void check_message_3(v8::Handle<v8::Message> message,
CHECK(message->GetScriptOrigin().ResourceIsSharedCrossOrigin()->Value());
CHECK(message->GetScriptOrigin().ResourceIsEmbedderDebugScript()->Value());
CHECK_EQ(6.75, message->GetScriptOrigin().ResourceName()->NumberValue());
+ CHECK_EQ(7.40, message->GetScriptOrigin().SourceMapUrl()->NumberValue());
message_received = true;
}
@@ -3905,10 +3906,10 @@ TEST(MessageHandler3) {
CHECK(!message_received);
v8::V8::AddMessageListener(check_message_3);
LocalContext context;
- v8::ScriptOrigin origin =
- v8::ScriptOrigin(v8_str("6.75"), v8::Integer::New(isolate, 1),
- v8::Integer::New(isolate, 2), v8::True(isolate),
- Handle<v8::Integer>(), v8::True(isolate));
+ v8::ScriptOrigin origin = v8::ScriptOrigin(
+ v8_str("6.75"), v8::Integer::New(isolate, 1),
+ v8::Integer::New(isolate, 2), v8::True(isolate), Handle<v8::Integer>(),
+ v8::True(isolate), v8_str("7.40"));
v8::Handle<v8::Script> script =
Script::Compile(v8_str("throw 'error'"), &origin);
script->Run();
@@ -16280,7 +16281,8 @@ THREADED_TEST(ScriptOrigin) {
v8::String::NewFromUtf8(env->GetIsolate(), "test"),
v8::Integer::New(env->GetIsolate(), 1),
v8::Integer::New(env->GetIsolate(), 1), v8::True(env->GetIsolate()),
- v8::Handle<v8::Integer>(), v8::True(env->GetIsolate()));
+ v8::Handle<v8::Integer>(), v8::True(env->GetIsolate()),
+ v8::String::NewFromUtf8(env->GetIsolate(), "http://sourceMapUrl"));
v8::Handle<v8::String> script = v8::String::NewFromUtf8(
env->GetIsolate(), "function f() {}\n\nfunction g() {}");
v8::Script::Compile(script, &origin)->Run();
@@ -16295,6 +16297,10 @@ THREADED_TEST(ScriptOrigin) {
CHECK_EQ(1, script_origin_f.ResourceLineOffset()->Int32Value());
CHECK(script_origin_f.ResourceIsSharedCrossOrigin()->Value());
CHECK(script_origin_f.ResourceIsEmbedderDebugScript()->Value());
+ printf("is name = %d\n", script_origin_f.SourceMapUrl()->IsUndefined());
+
+ CHECK_EQ(0, strcmp("http://sourceMapUrl",
+ *v8::String::Utf8Value(script_origin_f.SourceMapUrl())));
v8::ScriptOrigin script_origin_g = g->GetScriptOrigin();
CHECK_EQ(0, strcmp("test",
@@ -16302,6 +16308,8 @@ THREADED_TEST(ScriptOrigin) {
CHECK_EQ(1, script_origin_g.ResourceLineOffset()->Int32Value());
CHECK(script_origin_g.ResourceIsSharedCrossOrigin()->Value());
CHECK(script_origin_g.ResourceIsEmbedderDebugScript()->Value());
+ CHECK_EQ(0, strcmp("http://sourceMapUrl",
+ *v8::String::Utf8Value(script_origin_g.SourceMapUrl())));
}
« no previous file with comments | « test/cctest/compiler/test-linkage.cc ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698