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