Example #1
0
 scheduleMicroTask(() => {
   ran = true;
   _log.add('onMicrotaskEmpty(executeMicrotask)');
 });
Example #2
0
 runNgZoneNoLog(() => macroTask(_log.fn('run')));
Example #3
0
function logOnMicrotaskEmpty() {
  ObservableWrapper.subscribe(_zone.onMicrotaskEmpty, _log.fn('onMicrotaskEmpty'));
}
Example #4
0
 macroTask(() => {
   expect(_log.result()).toEqual('run');
   async.done()
 });
Example #5
0
function logOnUnstable() {
  ObservableWrapper.subscribe(_zone.onUnstable, _log.fn('onUnstable'));
}
Example #6
0
 _zone.run(() => _log.add('nested run'));
Example #7
0
 macroTask(() => {
   expect(_log.result())
       .toEqual(
           'onUnstable; run start; onMicrotaskEmpty; onStable; onUnstable; a then; b then; onMicrotaskEmpty; onStable');
   async.done();
 }, resultTimer);
Example #8
0
 ObservableWrapper.subscribe(_zone.onUnstable, (_) => {
   if (turnStart) throw 'Should not call this more than once';
   _log.add('onUnstable');
   scheduleMicroTask(() => {});
   turnStart = true;
 });
Example #9
0
 ObservableWrapper.subscribe(_zone.onMicrotaskEmpty, (_) => {
   if (turnDone) throw 'Should not call this more than once';
   _log.add('onMicrotaskEmpty');
   scheduleMicroTask(() => {});
   turnDone = true;
 });
Example #10
0
 scheduleMicroTask(() => {
   _log.add('async1');
   scheduleMicroTask(_log.fn('async2'));
 });
Example #11
0
 macroTask(() => {
   expect(_log.result())
       .toEqual('onUnstable; zone run; onMicrotaskEmpty; onStable; ' +
                'onUnstable; promise then; onMicrotaskEmpty; onStable');
   async.done();
 }, resultTimer);
Example #12
0
 _zone.run(() => { scheduleMicroTask(_log.fn('onMicrotaskEmpty(executePromise)')); });
Example #13
0
 _zone.run(() => { scheduleMicroTask(_log.fn('onUnstable(executePromise)')); });
Example #14
0
 .then((_) => {
   _log.add('promise then');
   PromiseWrapper.resolve(null).then(_log.fn('promise foo'));
   return PromiseWrapper.resolve(null);
 })
Example #15
0
 _zone.run(() => {
   _log.add('nested run');
   scheduleMicroTask(_log.fn('nested run microtask'));
 });
Example #16
0
 ObservableWrapper.subscribe(_zone.onStable, (_) => {
   if (eventDone) throw 'Should not call this more than once';
   _log.add('onStable');
   scheduleMicroTask(() => {});
   eventDone = true;
 });
Example #17
0
 ObservableWrapper.subscribe(_zone.onMicrotaskEmpty, (_) => {
   _log.add('onMicrotaskEmpty:started');
   _zone.run(() => _log.add('nested run'));
   _log.add('onMicrotaskEmpty:finished');
 });
Example #18
0
 macroTask(() => { _zone.run(_log.fn('run')); });
Example #19
0
 macroTask(() => {
   expect(_log.result())
       .toEqual(
           'onUnstable; start run; onMicrotaskEmpty; onMicrotaskEmpty:started; nested run; onMicrotaskEmpty:finished; onStable');
   async.done();
 }, resultTimer);
Example #20
0
 ObservableWrapper.subscribe(_zone.onMicrotaskEmpty, (_) => {
   _log.add('onMyMicrotaskEmpty');
   if (turnDone) return;
   _zone.run(() => { scheduleMicroTask(() => {}); });
   turnDone = true;
 });
Example #21
0
 macroTask(() => { _zone.runOutsideAngular(_log.fn('run')); });
Example #22
0
 ObservableWrapper.subscribe(_zone.onStable, (_) => {
   NgZone.assertNotInAngularZone();
   _log.add('onMyTaskDone');
 });
Example #23
0
 macroTask(() => {
   NgZone.assertInAngularZone();
   completer.promise.then(_log.fn('executedMicrotask'));
 });
Example #24
0
 macroTask(() => {
   expect(_log.result())
       .toEqual('onUnstable; run; onMicrotaskEmpty; onStable; onMyTaskDone');
   async.done();
 });
Example #25
0
 macroTask(() => {
   NgZone.assertNotInAngularZone();
   _log.add('scheduling a microtask');
   completer.resolve(null);
 });
Example #26
0
 macroTask(() => {
   _log.add('run start');
   scheduleMicroTask(_log.fn('async'));
   _log.add('run end');
 });
Example #27
0
 scheduleMicroTask(() => {
   ran = true;
   _log.add('executedMicrotask');
 });
Example #28
0
 macroTask(() => {
   // The microtask (async) is executed after the macrotask (run)
   expect(_log.result())
       .toEqual('onUnstable; run start; run end; async; onMicrotaskEmpty; onStable');
   async.done();
 }, resultTimer);
Example #29
0
 macroTask(() => {
   _log.add('scheduleMicroTask');
   scheduleMicroTask(_log.fn('run(executeMicrotask)'));
 });
Example #30
0
 PromiseWrapper.resolve(null).then((_) => log.add(2));