resolvedPromise.then((_) => log.add(2));
runNgZoneNoLog(() => macroTask(_log.fn('run')));
macroTask(() => { _log.add('scheduleMicroTask'); scheduleMicroTask(_log.fn('run(executeMicrotask)')); });
macroTask(() => { expect(_log.result()).toEqual('run'); async.done(); });
macroTask(() => { NgZone.assertInAngularZone(); promise.then(_log.fn('executedMicrotask')); });
macroTask(() => { expect(_log.result()) .toEqual( 'onUnstable; start run; onMicrotaskEmpty; onMicrotaskEmpty:started; nested run; onMicrotaskEmpty:finished; onStable'); async.done(); }, resultTimer);
macroTask(() => { expect(_log.result()) .toEqual( 'onUnstable; run start; onMicrotaskEmpty; onStable; onUnstable; a then; b then; onMicrotaskEmpty; onStable'); async.done(); }, resultTimer);
next: () => { if (turnDone) throw 'Should not call this more than once'; _log.add('onMicrotaskEmpty'); scheduleMicroTask(() => {}); turnDone = true; }
next: () => { if (eventDone) throw 'Should not call this more than once'; _log.add('onStable'); scheduleMicroTask(() => {}); eventDone = true; }
scheduleMicroTask(() => { _log.add('async1'); scheduleMicroTask(_log.fn('async2')); });