11cb0ef41Sopenharmony_ci// META: script=resources/user-timing-helper.js 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_citest(()=>{ 41cb0ef41Sopenharmony_ci const entry = new PerformanceMark("name"); 51cb0ef41Sopenharmony_ci assert_true(entry instanceof PerformanceMark); 61cb0ef41Sopenharmony_ci checkEntry(entry, {name: "name", entryType: "mark"}); 71cb0ef41Sopenharmony_ci}, "Mark entry can be created by 'new PerformanceMark(string)'."); 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_citest(()=>{ 101cb0ef41Sopenharmony_ci const entry = new PerformanceMark("name", {}); 111cb0ef41Sopenharmony_ci assert_true(entry instanceof PerformanceMark); 121cb0ef41Sopenharmony_ci checkEntry(entry, {name: "name", entryType: "mark"}); 131cb0ef41Sopenharmony_ci}, "Mark entry can be created by 'new PerformanceMark(string, {})'."); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_citest(()=>{ 161cb0ef41Sopenharmony_ci const entry = new PerformanceMark("name", {startTime: 1}); 171cb0ef41Sopenharmony_ci assert_true(entry instanceof PerformanceMark); 181cb0ef41Sopenharmony_ci checkEntry(entry, {name: "name", entryType: "mark", startTime: 1}); 191cb0ef41Sopenharmony_ci}, "Mark entry can be created by 'new PerformanceMark(string, {startTime})'."); 201cb0ef41Sopenharmony_ci 211cb0ef41Sopenharmony_citest(()=>{ 221cb0ef41Sopenharmony_ci const entry = new PerformanceMark("name", {detail: {info: "abc"}}); 231cb0ef41Sopenharmony_ci assert_true(entry instanceof PerformanceMark); 241cb0ef41Sopenharmony_ci checkEntry(entry, {name: "name", entryType: "mark", detail: {info: "abc"}}); 251cb0ef41Sopenharmony_ci}, "Mark entry can be created by 'new PerformanceMark(string, {detail})'."); 261cb0ef41Sopenharmony_ci 271cb0ef41Sopenharmony_citest(()=>{ 281cb0ef41Sopenharmony_ci const entry = 291cb0ef41Sopenharmony_ci new PerformanceMark("name", {startTime: 1, detail: {info: "abc"}}); 301cb0ef41Sopenharmony_ci assert_true(entry instanceof PerformanceMark); 311cb0ef41Sopenharmony_ci checkEntry(entry, {name: "name", entryType: "mark", startTime: 1, detail: {info: "abc"}}); 321cb0ef41Sopenharmony_ci}, "Mark entry can be created by " + 331cb0ef41Sopenharmony_ci "'new PerformanceMark(string, {startTime, detail})'."); 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_citest(()=>{ 361cb0ef41Sopenharmony_ci const entry = new PerformanceMark("name"); 371cb0ef41Sopenharmony_ci assert_true(entry instanceof PerformanceMark); 381cb0ef41Sopenharmony_ci checkEntry(entry, {name: "name", entryType: "mark"}); 391cb0ef41Sopenharmony_ci assert_equals(performance.getEntriesByName("name").length, 0); 401cb0ef41Sopenharmony_ci}, "Using new PerformanceMark() shouldn't add the entry to performance timeline."); 41