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

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

Issue 56105: Reland exception propagation fix.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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/cctest.status ('k') | tools/test.py » ('j') | tools/test.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 1639)
+++ test/cctest/test-api.cc (working copy)
@@ -1812,7 +1812,8 @@
if (args.Length() < 1) return v8::Boolean::New(false);
v8::HandleScope scope;
v8::TryCatch try_catch;
- v8::Script::Compile(args[0]->ToString())->Run();
+ Local<Value> result = v8::Script::Compile(args[0]->ToString())->Run();
+ CHECK(!try_catch.HasCaught() || result.IsEmpty());
return v8::Boolean::New(try_catch.HasCaught());
}
@@ -1849,7 +1850,12 @@
// Test that a try-finally block doesn't shadow a try-catch block
// when setting up an external handler.
-THREADED_TEST(TryCatchInTryFinally) {
+//
+// BUG(271): Some of the exception propagation does not work on the
+// ARM simulator because the simulator separates the C++ stack and the
+// JS stack. This test therefore fails on the simulator. The test is
+// not threaded to allow the threading tests to run on the simulator.
+TEST(TryCatchInTryFinally) {
v8::HandleScope scope;
Local<ObjectTemplate> templ = ObjectTemplate::New();
templ->Set(v8_str("CCatcher"),
@@ -1868,6 +1874,7 @@
static void receive_message(v8::Handle<v8::Message> message,
v8::Handle<v8::Value> data) {
+ message->Get();
message_received = true;
}
@@ -1896,8 +1903,9 @@
LocalContext context(0, templ);
v8::TryCatch try_catch;
try_catch.SetVerbose(true);
- CompileRun("ThrowFromC();");
+ Local<Value> result = CompileRun("ThrowFromC();");
CHECK(try_catch.HasCaught());
+ CHECK(result.IsEmpty());
CHECK(message_received);
v8::V8::RemoveMessageListeners(check_message);
}
@@ -1943,6 +1951,7 @@
int expected = args[3]->Int32Value();
if (try_catch.HasCaught()) {
CHECK_EQ(expected, count);
+ CHECK(result.IsEmpty());
CHECK(!i::Top::has_scheduled_exception());
} else {
CHECK_NE(expected, count);
@@ -2000,7 +2009,12 @@
// Each entry is an activation, either JS or C. The index is the count at that
// level. Stars identify activations with exception handlers, the @ identifies
// the exception handler that should catch the exception.
-THREADED_TEST(ExceptionOrder) {
+//
+// BUG(271): Some of the exception propagation does not work on the
+// ARM simulator because the simulator separates the C++ stack and the
+// JS stack. This test therefore fails on the simulator. The test is
+// not threaded to allow the threading tests to run on the simulator.
+TEST(ExceptionOrder) {
v8::HandleScope scope;
Local<ObjectTemplate> templ = ObjectTemplate::New();
templ->Set(v8_str("check"), v8::FunctionTemplate::New(JSCheck));
« no previous file with comments | « test/cctest/cctest.status ('k') | tools/test.py » ('j') | tools/test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698