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/promises-aplus/lib/mocha.js

Issue 1246933002: Remove unnecessary coupling between Promise tests and Object.observe (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use %EnqueueMicrotask Created 5 years, 5 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/promises-aplus/lib/global.js ('k') | test/promises-aplus/testcfg.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/promises-aplus/lib/mocha.js
diff --git a/test/promises-aplus/lib/mocha.js b/test/promises-aplus/lib/mocha.js
index 24d294ef8f829889fbcdccf1a9893f92635c7aea..0a172b9d2f7f2b7fd71e5986e0c7dbf4aee47007 100644
--- a/test/promises-aplus/lib/mocha.js
+++ b/test/promises-aplus/lib/mocha.js
@@ -41,15 +41,6 @@ var assert = require('assert');
(function() {
var TIMEOUT = 1000;
-function PostMicrotask(fn) {
- var o = {};
- Object.observe(o, function() {
- fn();
- });
- // Change something to enqueue a microtask.
- o.x = 'hello';
-}
-
var context = {
beingDescribed: undefined,
currentSuiteIndex: 0,
@@ -162,7 +153,7 @@ TestCase.prototype.Run = function(suite, postAction) {
if (this.isRegular) {
print('PASS: ' + suite.description + '#' + this.name);
}
- PostMicrotask(postAction);
+ %EnqueueMicrotask(postAction);
}.bind(this));
}.bind(this));
}.bind(this));
@@ -194,14 +185,14 @@ function TestSuite(described) {
TestSuite.prototype.Run = function() {
this.hasRun = this.currentIndex === this.cases.length;
if (this.hasRun) {
- PostMicrotask(Run);
+ %EnqueueMicrotask(Run);
return;
}
// TestCase.prototype.Run cannot throw an exception.
this.cases[this.currentIndex].Run(this, function() {
++this.currentIndex;
- PostMicrotask(Run);
+ %EnqueueMicrotask(Run);
}.bind(this));
};
@@ -224,7 +215,7 @@ TestSuite.prototype.ReportError = function(testCase, e) {
print('FAIL: ' + this.description + '#' + testCase.name + ': ' +
e.name + ' (' + e.message + ')');
++this.currentIndex;
- PostMicrotask(Run);
+ %EnqueueMicrotask(Run);
};
describe = function(description, fn) {
« no previous file with comments | « test/promises-aplus/lib/global.js ('k') | test/promises-aplus/testcfg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698