xref: /third_party/node/test/fixtures/wpt/user-timing/clear_all_measures.any.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/wpt/user-timing/
11cb0ef41Sopenharmony_citest(function()
21cb0ef41Sopenharmony_ci{
31cb0ef41Sopenharmony_ci    self.performance.mark("mark1");
41cb0ef41Sopenharmony_ci    self.performance.measure("measure1", "mark1");
51cb0ef41Sopenharmony_ci    self.performance.mark("mark2");
61cb0ef41Sopenharmony_ci    self.performance.measure("measure2", "mark2");
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci    // test that two measures have been created
91cb0ef41Sopenharmony_ci    var entries = self.performance.getEntriesByType("measure");
101cb0ef41Sopenharmony_ci    assert_equals(entries.length, 2, "Two measures have been created for this test.");
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci    // clear all measures
131cb0ef41Sopenharmony_ci    self.performance.clearMeasures();
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci    // test that all measures were cleared
161cb0ef41Sopenharmony_ci    entries = self.performance.getEntriesByType("measure");
171cb0ef41Sopenharmony_ci    assert_equals(entries.length, 0,
181cb0ef41Sopenharmony_ci              "After a call to self.performance.clearMeasures(), " +
191cb0ef41Sopenharmony_ci              "self.performance.getEntriesByType(\"measure\") returns an empty object.");
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci}, "Clearing all marks remove all of them.");
22

Indexes created Thu Nov 07 10:32:03 CST 2024