diff --git a/packages/core/test/acceptance/styling_spec.ts b/packages/core/test/acceptance/styling_spec.ts index 39a5bddb65..d15ebe85d7 100644 --- a/packages/core/test/acceptance/styling_spec.ts +++ b/packages/core/test/acceptance/styling_spec.ts @@ -6,8 +6,7 @@ * 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 {DebugNode, LViewDebug, toDebug} from '@angular/core/src/render3/instructions/lview_debug'; -import {loadLContextFromNode} from '@angular/core/src/render3/util/discovery_utils'; +import {getDebugNode} from '@angular/core/src/render3/util/discovery_utils'; import {ngDevModeResetPerfCounters} from '@angular/core/src/util/ng_dev_mode'; import {TestBed} from '@angular/core/testing'; 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) { expect(ngDevMode !.rendererSetStyle).toEqual(countForSet); expect(ngDevMode !.rendererRemoveStyle).toEqual(countForRemove);