test(ivy): remove extra implementation of `getDebugNode` (#32843)
PR Close #32843
This commit is contained in:
parent
fe54af9ba6
commit
a54adcaff0
|
@ -6,8 +6,7 @@
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
import {Component, ComponentFactoryResolver, ComponentRef, Directive, ElementRef, HostBinding, Input, NgModule, ViewChild, ViewContainerRef} from '@angular/core';
|
import {Component, ComponentFactoryResolver, ComponentRef, Directive, ElementRef, HostBinding, Input, NgModule, ViewChild, ViewContainerRef} from '@angular/core';
|
||||||
import {DebugNode, LViewDebug, toDebug} from '@angular/core/src/render3/instructions/lview_debug';
|
import {getDebugNode} from '@angular/core/src/render3/util/discovery_utils';
|
||||||
import {loadLContextFromNode} from '@angular/core/src/render3/util/discovery_utils';
|
|
||||||
import {ngDevModeResetPerfCounters} from '@angular/core/src/util/ng_dev_mode';
|
import {ngDevModeResetPerfCounters} from '@angular/core/src/util/ng_dev_mode';
|
||||||
import {TestBed} from '@angular/core/testing';
|
import {TestBed} from '@angular/core/testing';
|
||||||
import {By, DomSanitizer, SafeStyle} from '@angular/platform-browser';
|
import {By, DomSanitizer, SafeStyle} from '@angular/platform-browser';
|
||||||
|
@ -2037,19 +2036,6 @@ describe('styling', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function getDebugNode(element: Node): DebugNode|null {
|
|
||||||
const lContext = loadLContextFromNode(element);
|
|
||||||
const lViewDebug = toDebug(lContext.lView) as LViewDebug;
|
|
||||||
const debugNodes = lViewDebug.nodes || [];
|
|
||||||
for (let i = 0; i < debugNodes.length; i++) {
|
|
||||||
const n = debugNodes[i];
|
|
||||||
if (n.native === element) {
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function assertStyleCounters(countForSet: number, countForRemove: number) {
|
function assertStyleCounters(countForSet: number, countForRemove: number) {
|
||||||
expect(ngDevMode !.rendererSetStyle).toEqual(countForSet);
|
expect(ngDevMode !.rendererSetStyle).toEqual(countForSet);
|
||||||
expect(ngDevMode !.rendererRemoveStyle).toEqual(countForRemove);
|
expect(ngDevMode !.rendererRemoveStyle).toEqual(countForRemove);
|
||||||
|
|
Loading…
Reference in New Issue