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

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

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 Created 7 years, 4 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/benchmarks/testcfg.py ('k') | test/cctest/test-code-stubs-ia32.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 664f905105e7ca0a1f708c58d68eef22e5265bec..92ab5b8546959c820af1cd46ddfd485e80e0a83a 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -4388,7 +4388,7 @@ TEST(APIThrowMessageOverwrittenToString) {
}
-static void check_custom_error_tostring(
+static void check_custom_error_message(
v8::Handle<v8::Message> message,
v8::Handle<v8::Value> data) {
const char* uncaught_error = "Uncaught MyError toString";
@@ -4399,7 +4399,7 @@ static void check_custom_error_tostring(
TEST(CustomErrorToString) {
LocalContext context;
v8::HandleScope scope(context->GetIsolate());
- v8::V8::AddMessageListener(check_custom_error_tostring);
+ v8::V8::AddMessageListener(check_custom_error_message);
CompileRun(
"function MyError(name, message) { "
" this.name = name; "
@@ -4410,58 +4410,6 @@ TEST(CustomErrorToString) {
" return 'MyError toString'; "
"}; "
"throw new MyError('my name', 'my message'); ");
- v8::V8::RemoveMessageListeners(check_custom_error_tostring);
-}
-
-
-static void check_custom_error_message(
- v8::Handle<v8::Message> message,
- v8::Handle<v8::Value> data) {
- const char* uncaught_error = "Uncaught MyError: my message";
- printf("%s\n", *v8::String::Utf8Value(message->Get()));
- CHECK(message->Get()->Equals(v8_str(uncaught_error)));
-}
-
-
-TEST(CustomErrorMessage) {
- LocalContext context;
- v8::HandleScope scope(context->GetIsolate());
- v8::V8::AddMessageListener(check_custom_error_message);
-
- // Handlebars.
- CompileRun(
- "function MyError(msg) { "
- " this.name = 'MyError'; "
- " this.message = msg; "
- "} "
- "MyError.prototype = new Error(); "
- "throw new MyError('my message'); ");
-
- // Closure.
- CompileRun(
- "function MyError(msg) { "
- " this.name = 'MyError'; "
- " this.message = msg; "
- "} "
- "inherits = function(childCtor, parentCtor) { "
- " function tempCtor() {}; "
- " tempCtor.prototype = parentCtor.prototype; "
- " childCtor.superClass_ = parentCtor.prototype; "
- " childCtor.prototype = new tempCtor(); "
- " childCtor.prototype.constructor = childCtor; "
- "}; "
- "inherits(MyError, Error); "
- "throw new MyError('my message'); ");
-
- // Object.create.
- CompileRun(
- "function MyError(msg) { "
- " this.name = 'MyError'; "
- " this.message = msg; "
- "} "
- "MyError.prototype = Object.create(Error.prototype); "
- "throw new MyError('my message'); ");
-
v8::V8::RemoveMessageListeners(check_custom_error_message);
}
@@ -19915,16 +19863,6 @@ THREADED_TEST(Regress260106) {
}
-THREADED_TEST(JSONParse) {
- LocalContext context;
- HandleScope scope(context->GetIsolate());
- Local<Object> obj = v8::JSON::Parse(v8_str("{\"x\":42}"));
- Handle<Object> global = context->Global();
- global->Set(v8_str("obj"), obj);
- ExpectString("JSON.stringify(obj)", "{\"x\":42}");
-}
-
-
#ifndef WIN32
class ThreadInterruptTest {
public:
« no previous file with comments | « test/benchmarks/testcfg.py ('k') | test/cctest/test-code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698