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

Unified Diff: test/mjsunit/harmony/debug-async-function-async-task-event.js

Issue 2037653002: Some new/fixed async tests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adjust test expectations for Sathya's optimization Created 4 years, 6 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/mjsunit/es6/debug-promises/async-task-event.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/debug-async-function-async-task-event.js
diff --git a/test/mjsunit/es6/debug-promises/async-task-event.js b/test/mjsunit/harmony/debug-async-function-async-task-event.js
similarity index 71%
copy from test/mjsunit/es6/debug-promises/async-task-event.js
copy to test/mjsunit/harmony/debug-async-function-async-task-event.js
index 88030a2e73c93d6d02fe26052c7a783df4bf49c9..249f02fc8f6841a9e8624223443ae6840741bf29 100644
--- a/test/mjsunit/es6/debug-promises/async-task-event.js
+++ b/test/mjsunit/harmony/debug-async-function-async-task-event.js
@@ -1,8 +1,8 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
+// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --expose-debug-as debug
+// Flags: --harmony-async-await --expose-debug-as debug --allow-natives-syntax
Debug = debug.Debug;
@@ -13,13 +13,16 @@ var expected = [
"willHandle #1",
"then #1",
"enqueue #2",
+ "enqueue #3",
"didHandle #1",
"willHandle #2",
"then #2",
- "enqueue #3",
"didHandle #2",
"willHandle #3",
- "didHandle #3"
+ "enqueue #4",
+ "didHandle #3",
+ "willHandle #4",
+ "didHandle #4",
];
function assertLog(msg) {
@@ -37,7 +40,8 @@ function listener(event, exec_state, event_data, data) {
if (base_id < 0)
base_id = event_data.id();
var id = event_data.id() - base_id + 1;
- assertEquals("Promise.resolve", event_data.name());
+ assertTrue("Promise.resolve" == event_data.name() ||
+ "PromiseResolveThenableJob" == event_data.name());
assertLog(event_data.type() + " #" + id);
} catch (e) {
print(e + e.stack)
@@ -51,11 +55,16 @@ var resolver;
var p = new Promise(function(resolve, reject) {
resolver = resolve;
});
-p.then(function() {
+
+async function main() {
+ await p;
assertLog("then #1");
-}).then(function() {
+ await undefined;
assertLog("then #2");
-});
+}
+main();
resolver();
+%RunMicrotasks();
+
assertNull(exception);
« no previous file with comments | « test/mjsunit/es6/debug-promises/async-task-event.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698