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

Unified Diff: test/cctest/compiler/test-run-jsexceptions.cc

Issue 1408283006: Remove deprecated API usage from compiler cctests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-arguments-inline-3
Patch Set: Created 5 years, 2 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-run-jscalls.cc ('k') | test/cctest/compiler/test-run-jsobjects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-jsexceptions.cc
diff --git a/test/cctest/compiler/test-run-jsexceptions.cc b/test/cctest/compiler/test-run-jsexceptions.cc
index 2ba8fdfcc8fc16a5cfd0a9d5f6d5c48519fb0f33..852cf2fa1b0a376d6c8fb5bfa7257c0fd92d3004 100644
--- a/test/cctest/compiler/test-run-jsexceptions.cc
+++ b/test/cctest/compiler/test-run-jsexceptions.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// TODO(jochen): Remove this after the setting is turned on globally.
+#define V8_IMMINENT_DEPRECATION_WARNINGS
+
#include "src/v8.h"
#include "test/cctest/compiler/function-tester.h"
@@ -26,18 +29,19 @@ TEST(ThrowMessagePosition) {
" throw 4; \n"
"}) ";
FunctionTester T(src);
- v8::Handle<v8::Message> message;
+ v8::Local<v8::Message> message;
+ v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext();
message = T.CheckThrowsReturnMessage(T.Val(1), T.undefined());
- CHECK_EQ(2, message->GetLineNumber());
+ CHECK_EQ(2, message->GetLineNumber(context).FromMaybe(-1));
CHECK_EQ(40, message->GetStartPosition());
message = T.CheckThrowsReturnMessage(T.Val(2), T.undefined());
- CHECK_EQ(3, message->GetLineNumber());
+ CHECK_EQ(3, message->GetLineNumber(context).FromMaybe(-1));
CHECK_EQ(67, message->GetStartPosition());
message = T.CheckThrowsReturnMessage(T.Val(3), T.undefined());
- CHECK_EQ(4, message->GetLineNumber());
+ CHECK_EQ(4, message->GetLineNumber(context).FromMaybe(-1));
CHECK_EQ(95, message->GetStartPosition());
}
@@ -48,13 +52,15 @@ TEST(ThrowMessageDirectly) {
" if (a) { throw b; } else { throw new Error(b); }"
"})";
FunctionTester T(src);
- v8::Handle<v8::Message> message;
+ v8::Local<v8::Message> message;
+ v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext();
+ v8::Maybe<bool> t = v8::Just(true);
message = T.CheckThrowsReturnMessage(T.false_value(), T.Val("Wat?"));
- CHECK(message->Get()->Equals(v8_str("Uncaught Error: Wat?")));
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Error: Wat?")));
message = T.CheckThrowsReturnMessage(T.true_value(), T.Val("Kaboom!"));
- CHECK(message->Get()->Equals(v8_str("Uncaught Kaboom!")));
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Kaboom!")));
}
@@ -69,13 +75,15 @@ TEST(ThrowMessageIndirectly) {
" }"
"})";
FunctionTester T(src);
- v8::Handle<v8::Message> message;
+ v8::Local<v8::Message> message;
+ v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext();
+ v8::Maybe<bool> t = v8::Just(true);
message = T.CheckThrowsReturnMessage(T.false_value(), T.Val("Wat?"));
- CHECK(message->Get()->Equals(v8_str("Uncaught Error: Wat?")));
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Error: Wat?")));
message = T.CheckThrowsReturnMessage(T.true_value(), T.Val("Kaboom!"));
- CHECK(message->Get()->Equals(v8_str("Uncaught Kaboom!")));
+ CHECK(t == message->Get()->Equals(context, v8_str("Uncaught Kaboom!")));
}
« no previous file with comments | « test/cctest/compiler/test-run-jscalls.cc ('k') | test/cctest/compiler/test-run-jsobjects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698