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

Unified Diff: test/cctest/test-code-stub-assembler.cc

Issue 2585133002: [builtins] move PromiseBuiltinsAssembler to it's own header file (Closed)
Patch Set: Created 4 years 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 | « src/v8.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-code-stub-assembler.cc
diff --git a/test/cctest/test-code-stub-assembler.cc b/test/cctest/test-code-stub-assembler.cc
index 4c78ab38c03db1ac9d8c1ba4cc920b3b1718eed1..84f4f5641a9da62308bcedabe3de7b51845b70a3 100644
--- a/test/cctest/test-code-stub-assembler.cc
+++ b/test/cctest/test-code-stub-assembler.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "src/base/utils/random-number-generator.h"
+#include "src/builtins/builtins-promise.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
#include "src/compiler/node.h"
@@ -1974,5 +1975,26 @@ TEST(IsPrivateSymbol) {
CHECK_EQ(isolate->heap()->true_value(), *result);
}
+TEST(PromiseHasHandler) {
+ Isolate* isolate(CcTest::InitIsolateOnce());
+
+ const int kNumParams = 1;
+ CodeAssemblerTester data(isolate, kNumParams);
+ PromiseBuiltinsAssembler m(data.state());
+
+ Node* const context = m.Parameter(kNumParams + 2);
+ Node* const promise = m.AllocateJSPromise(context);
+ m.PromiseInit(promise);
+ m.Return(m.SelectBooleanConstant(m.PromiseHasHandler(promise)));
+
+ Handle<Code> code = data.GenerateCode();
+ CHECK(!code.is_null());
+
+ FunctionTester ft(code, kNumParams);
+ Handle<Object> result =
+ ft.Call(isolate->factory()->undefined_value()).ToHandleChecked();
+ CHECK_EQ(isolate->heap()->false_value(), *result);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/v8.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698