@@ -18,7 +18,6 @@ import {
1818 ViewContainerRef ,
1919} from '../../src/core' ;
2020import { bypassSanitizationTrustStyle } from '../../src/sanitization/bypass' ;
21- import { ngDevModeResetPerfCounters } from '../../src/util/ng_dev_mode' ;
2221import { TestBed } from '../../testing' ;
2322import {
2423 getElementClasses ,
@@ -27,11 +26,8 @@ import {
2726 getSortedStyle ,
2827} from '../../testing/src/styling' ;
2928import { By , DomSanitizer , SafeStyle } from '@angular/platform-browser' ;
30- import { expectPerfCounters } from '@angular/private/testing' ;
3129
3230describe ( 'styling' , ( ) => {
33- beforeEach ( ngDevModeResetPerfCounters ) ;
34-
3531 describe ( 'apply in prioritization order' , ( ) => {
3632 it ( 'should perform static bindings' , ( ) => {
3733 @Component ( {
@@ -1917,9 +1913,6 @@ describe('styling', () => {
19171913 expect ( element . style . height ) . toEqual ( '900px' ) ;
19181914 expect ( element . style . fontSize ) . toEqual ( '100px' ) ;
19191915
1920- // once for the template flush and again for the host bindings
1921- ngDevModeResetPerfCounters ( ) ;
1922-
19231916 component . opacity = '0.6' ;
19241917 component . compWithStyling ! . height = '100px' ;
19251918 component . compWithStyling ! . width = '100px' ;
@@ -2217,75 +2210,65 @@ describe('styling', () => {
22172210 const fixture = TestBed . createComponent ( Cmp ) ;
22182211 const comp = fixture . componentInstance ;
22192212
2220- ngDevModeResetPerfCounters ( ) ;
22212213 fixture . detectChanges ( ) ;
22222214 const element = fixture . nativeElement . querySelector ( 'div' ) ;
22232215
22242216 assertStyle ( element , 'width' , '111px' ) ;
22252217 assertStyle ( element , 'height' , '111px' ) ;
22262218
22272219 comp . width = '222px' ;
2228- ngDevModeResetPerfCounters ( ) ;
22292220 fixture . detectChanges ( ) ;
22302221
22312222 assertStyle ( element , 'width' , '222px' ) ;
22322223 assertStyle ( element , 'height' , '111px' ) ;
22332224
22342225 comp . height = '222px' ;
2235- ngDevModeResetPerfCounters ( ) ;
22362226 fixture . detectChanges ( ) ;
22372227
22382228 assertStyle ( element , 'width' , '222px' ) ;
22392229 assertStyle ( element , 'height' , '222px' ) ;
22402230
22412231 comp . width = undefined ;
2242- ngDevModeResetPerfCounters ( ) ;
22432232 fixture . detectChanges ( ) ;
22442233
22452234 assertStyle ( element , 'width' , '555px' ) ;
22462235 assertStyle ( element , 'height' , '222px' ) ;
22472236
22482237 comp . width = '123px' ;
22492238 comp . height = '123px' ;
2250- ngDevModeResetPerfCounters ( ) ;
22512239 fixture . detectChanges ( ) ;
22522240
22532241 assertStyle ( element , 'width' , '123px' ) ;
22542242 assertStyle ( element , 'height' , '123px' ) ;
22552243
22562244 comp . map = { } ;
2257- ngDevModeResetPerfCounters ( ) ;
22582245 fixture . detectChanges ( ) ;
22592246
22602247 // No change, hence no write
22612248 assertStyle ( element , 'width' , '123px' ) ;
22622249 assertStyle ( element , 'height' , '123px' ) ;
22632250
22642251 comp . width = undefined ;
2265- ngDevModeResetPerfCounters ( ) ;
22662252 fixture . detectChanges ( ) ;
22672253
22682254 assertStyle ( element , 'width' , '999px' ) ;
22692255 assertStyle ( element , 'height' , '123px' ) ;
22702256
22712257 comp . dir . map = null ;
2272- ngDevModeResetPerfCounters ( ) ;
22732258 fixture . detectChanges ( ) ;
22742259
22752260 // the width is only applied once
22762261 assertStyle ( element , 'width' , '0px' ) ;
22772262 assertStyle ( element , 'height' , '123px' ) ;
22782263
22792264 comp . dir . map = { width : '1000px' , height : '1100px' , color : 'red' } ;
2280- ngDevModeResetPerfCounters ( ) ;
22812265 fixture . detectChanges ( ) ;
22822266
22832267 assertStyle ( element , 'width' , '1000px' ) ;
22842268 assertStyle ( element , 'height' , '123px' ) ;
22852269 assertStyle ( element , 'color' , 'red' ) ;
22862270
22872271 comp . height = undefined ;
2288- ngDevModeResetPerfCounters ( ) ;
22892272 fixture . detectChanges ( ) ;
22902273
22912274 // height gets applied twice and all other
@@ -2295,7 +2278,6 @@ describe('styling', () => {
22952278 assertStyle ( element , 'color' , 'red' ) ;
22962279
22972280 comp . map = { color : 'blue' , width : '2000px' , opacity : '0.5' } ;
2298- ngDevModeResetPerfCounters ( ) ;
22992281 fixture . detectChanges ( ) ;
23002282
23012283 assertStyle ( element , 'width' , '2000px' ) ;
@@ -2304,7 +2286,6 @@ describe('styling', () => {
23042286 assertStyle ( element , 'opacity' , '0.5' ) ;
23052287
23062288 comp . map = { color : 'blue' , width : '2000px' } ;
2307- ngDevModeResetPerfCounters ( ) ;
23082289 fixture . detectChanges ( ) ;
23092290
23102291 // all four are applied because the map was altered
0 commit comments