mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(profiling): resetProfiles doesn't reset all profiles (#5425)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { assert, assertEqual, assertFalse, assertTrue, assertThrows } from "../TKUnit";
|
||||
import { assert, assertEqual, assertFalse, assertNull, assertTrue, assertThrows } from "../TKUnit";
|
||||
import { enable, disable, profile, time, start, stop, timer, isRunning, resetProfiles } from "tns-core-modules/profiling";
|
||||
|
||||
enable();
|
||||
@@ -99,6 +99,19 @@ export function test_isRunning_withReentrancy() {
|
||||
assertFalse(isRunning(name), "isRunning should be false after second stop");
|
||||
}
|
||||
|
||||
export function test_reset_profiles() {
|
||||
resetProfiles();
|
||||
const name = "test_reset_profiles";
|
||||
|
||||
start(name);
|
||||
stop(name);
|
||||
resetProfiles();
|
||||
|
||||
const res = timer(name);
|
||||
|
||||
assertNull(res);
|
||||
}
|
||||
|
||||
export function test_start_stop() {
|
||||
resetProfiles();
|
||||
const name = "test_start_stop";
|
||||
|
||||
Reference in New Issue
Block a user