(
private _ngZone: NgZone,
private registry: TestabilityRegistry,
@Inject(TESTABILITY_GETTER) testabilityGetter: GetTestability,
)
| 104 | private readonly pendingTasksInternal = inject(PendingTasksInternal); |
| 105 | private readonly _usePendingTasks = inject(USE_PENDING_TASKS); |
| 106 | constructor( |
| 107 | private _ngZone: NgZone, |
| 108 | private registry: TestabilityRegistry, |
| 109 | @Inject(TESTABILITY_GETTER) testabilityGetter: GetTestability, |
| 110 | ) { |
| 111 | // Attempt to retrieve a `DestroyRef` optionally. |
| 112 | // For backwards compatibility reasons, this cannot be required. |
| 113 | if (isInInjectionContext()) { |
| 114 | this._destroyRef = inject(DestroyRef, {optional: true}) ?? undefined; |
| 115 | } |
| 116 | |
| 117 | // If there was no Testability logic registered in the global scope |
| 118 | // before, register the current testability getter as a global one. |
| 119 | if (!_testabilityGetter) { |
| 120 | setTestabilityGetter(testabilityGetter); |
| 121 | testabilityGetter.addToWindow(registry); |
| 122 | } |
| 123 | this._watchAngularEvents(); |
| 124 | _ngZone.run(() => { |
| 125 | this._taskTrackingZone = |
| 126 | typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone'); |
| 127 | }); |
| 128 | } |
| 129 | |
| 130 | private _watchAngularEvents(): void { |
| 131 | const onUnstableSubscription = this._ngZone.onUnstable.subscribe({ |
nothing calls this directly
no test coverage detected