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 existent measure
131cb0ef41Sopenharmony_ci    self.performance.clearMeasures("measure1");
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_ci    // test that "measure1" was cleared
161cb0ef41Sopenharmony_ci    entries = self.performance.getEntriesByName("measure1");
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci    assert_equals(entries.length, 0,
191cb0ef41Sopenharmony_ci              "After a call to self.performance.clearMeasures(\"measure1\"), " +
201cb0ef41Sopenharmony_ci              "self.performance.getEntriesByName(\"measure1\") returns an empty object.");
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ci    // test that "measure2" still exists
231cb0ef41Sopenharmony_ci    entries = self.performance.getEntriesByName("measure2");
241cb0ef41Sopenharmony_ci    assert_equals(entries[0].name, "measure2",
251cb0ef41Sopenharmony_ci              "After a call to self.performance.clearMeasures(\"measure1\"), " +
261cb0ef41Sopenharmony_ci              "self.performance.getEntriesByName(\"measure2\") returns an object containing the " +
271cb0ef41Sopenharmony_ci              "\"measure2\" measure.");
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ci}, "Clearing an existent measure doesn't affect other existing measures");
30