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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 24 matching lines...) Expand all
35 var beforeEach; 35 var beforeEach;
36 var afterEach; 36 var afterEach;
37 var RunAllTests; 37 var RunAllTests;
38 38
39 var assert = require('assert'); 39 var assert = require('assert');
40 40
41 (function() { 41 (function() {
42 var TIMEOUT = 1000; 42 var TIMEOUT = 1000;
43 43
44 function PostMicrotask(fn) { 44 function PostMicrotask(fn) {
45 var o = {}; 45 Promise.resolve().then(fn);
46 Object.observe(o, function() {
47 fn();
48 });
49 // Change something to enqueue a microtask.
50 o.x = 'hello';
51 } 46 }
52 47
53 var context = { 48 var context = {
54 beingDescribed: undefined, 49 beingDescribed: undefined,
55 currentSuiteIndex: 0, 50 currentSuiteIndex: 0,
56 suites: [] 51 suites: []
57 }; 52 };
58 53
59 function Run() { 54 function Run() {
60 function current() { 55 function current() {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 250
256 beforeEach = function(fn) { 251 beforeEach = function(fn) {
257 context.beingDescribed.beforeEach = fn; 252 context.beingDescribed.beforeEach = fn;
258 } 253 }
259 254
260 afterEach = function(fn) { 255 afterEach = function(fn) {
261 context.beingDescribed.afterEach = fn; 256 context.beingDescribed.afterEach = fn;
262 } 257 }
263 258
264 }()); 259 }());
OLDNEW
« test/mjsunit/es6/promises.js ('K') | « test/promises-aplus/lib/global.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698