File tree Expand file tree Collapse file tree 5 files changed +4
-35
lines changed
packages/react-native/src/private/webapis/performance/__tests__ Expand file tree Collapse file tree 5 files changed +4
-35
lines changed Original file line number Diff line number Diff line change 1010
1111import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment' ;
1212
13- import type Performance from 'react-native/src/private/webapis/performance/Performance' ;
14- import type { PerformanceObserverEntryList } from 'react-native/src/private/webapis/performance/PerformanceObserver' ;
15-
1613import MaybeNativePerformance from '../specs/NativePerformance' ;
1714import * as Fantom from '@react-native/fantom' ;
1815import nullthrows from 'nullthrows' ;
1916import { useState } from 'react' ;
2017import { Text , View } from 'react-native' ;
2118import setUpPerformanceObserver from 'react-native/src/private/setup/setUpPerformanceObserver' ;
22- import { PerformanceEventTiming } from 'react-native/src/private/webapis/performance/EventTiming' ;
23- import { PerformanceObserver } from 'react-native/src/private/webapis/performance/PerformanceObserver' ;
2419
2520const NativePerformance = nullthrows ( MaybeNativePerformance ) ;
2621
2722setUpPerformanceObserver ( ) ;
2823
29- declare var performance: Performance ;
30-
3124function sleep ( ms : number ) {
3225 const end = performance . now ( ) + ms ;
3326 while ( performance . now ( ) < end ) { }
Original file line number Diff line number Diff line change 1010
1111import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment' ;
1212
13- import type {
14- PerformanceObserverCallbackOptions ,
15- PerformanceObserverEntryList ,
16- } from 'react-native/src/private/webapis/performance/PerformanceObserver' ;
13+ import type { PerformanceObserverCallbackOptions } from '../PerformanceObserver' ;
1714
1815import * as Fantom from '@react-native/fantom' ;
1916import setUpPerformanceObserver from 'react-native/src/private/setup/setUpPerformanceObserver' ;
20- import { PerformanceLongTaskTiming } from 'react-native/src/private/webapis/performance/LongTasks' ;
21- import { PerformanceObserver } from 'react-native/src/private/webapis/performance/PerformanceObserver' ;
2217
2318setUpPerformanceObserver ( ) ;
2419
Original file line number Diff line number Diff line change 1010
1111import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment' ;
1212
13- import type Performance from 'react-native/src/private/webapis/performance/Performance' ;
14-
1513import * as Fantom from '@react-native/fantom' ;
1614
17- declare var performance: Performance ;
18-
1915const clearMarksAndMeasures = ( ) => {
2016 performance . clearMarks ( ) ;
2117 performance . clearMeasures ( ) ;
Original file line number Diff line number Diff line change 1010
1111import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment' ;
1212
13- import type Performance from '../Performance' ;
14- import type {
15- PerformanceObserver as PerformanceObserverT ,
16- PerformanceObserverEntryList ,
17- } from '../PerformanceObserver' ;
18-
1913import setUpPerformanceObserver from '../../../setup/setUpPerformanceObserver' ;
2014import * as Fantom from '@react-native/fantom' ;
2115
2216setUpPerformanceObserver ( ) ;
2317
24- declare var performance: Performance ;
25- declare var PerformanceObserver: Class < PerformanceObserverT > ;
26-
2718describe ( 'PerformanceObserver' , ( ) => {
2819 it ( 'receives notifications for marks and measures' , ( ) => {
2920 const callback = jest . fn ( ) ;
Original file line number Diff line number Diff line change 1010
1111import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment' ;
1212
13- import type Performance from '../Performance' ;
14- import type {
15- PerformanceEntryJSON ,
16- PerformanceEntryList ,
17- } from '../PerformanceEntry' ;
18-
1913import ensureInstance from '../../../__tests__/utilities/ensureInstance' ;
14+ import setUpPerformanceObserver from '../../../setup/setUpPerformanceObserver' ;
2015import DOMException from '../../errors/DOMException' ;
21- import { PerformanceMark , PerformanceMeasure } from '../UserTiming' ;
2216import * as Fantom from '@react-native/fantom' ;
2317
24- declare var performance: Performance ;
18+ setUpPerformanceObserver ( ) ;
2519
2620function getThrownError ( fn : ( ) = > mixed ) : mixed {
2721 try {
@@ -32,7 +26,7 @@ function getThrownError(fn: () => mixed): mixed {
3226 throw new Error ( 'Expected function to throw' ) ;
3327}
3428
35- function toJSON ( entries : PerformanceEntryList ) : Array < PerformanceEntryJSON > {
29+ function toJSON ( entries : PerformanceEntryList ) : Array < mixed > {
3630 return entries . map ( entry => entry . toJSON ( ) ) ;
3731}
3832
You can’t perform that action at this time.
0 commit comments