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

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

Issue 2796243002: Add isPromise V8 extras util (Closed)
Patch Set: Fix typo Created 3 years, 8 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:
Download patch
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 65e6135f8a074c5b3a661b94f12805c62aa22bd3..7e5db8055866a4f49dcdfca0cf189acdb715bb27 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -25492,6 +25492,17 @@ TEST(ExtrasUtilsObject) {
.As<v8::String>();
String::Utf8Value promise_states_string(promise_states);
CHECK_EQ(0, strcmp(*promise_states_string, "pending fulfilled rejected"));
+
+ auto promise_is_promise = result->Get(env.local(), v8_str("promiseIsPromise"))
+ .ToLocalChecked()
+ .As<v8::Boolean>();
+ CHECK_EQ(true, promise_is_promise->Value());
+
+ auto thenable_is_promise =
+ result->Get(env.local(), v8_str("thenableIsPromise"))
+ .ToLocalChecked()
+ .As<v8::Boolean>();
+ CHECK_EQ(false, thenable_is_promise->Value());
}
« src/js/prologue.js ('K') | « src/js/prologue.js ('k') | test/cctest/test-extra.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698