tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

clear_non_existent_mark.any.js (1196B)


      1 test(function() {
      2    self.performance.mark("mark1");
      3    self.performance.mark("mark2");
      4 
      5    // test that two marks have been created
      6    var entries = self.performance.getEntriesByType("mark");
      7    assert_equals(entries.length, 2, "Two marks have been created for this test.");
      8 
      9    // clear non-existent mark
     10    self.performance.clearMarks("mark3");
     11 
     12    // test that "mark1" still exists
     13    entries = self.performance.getEntriesByName("mark1");
     14    assert_equals(entries[0].name, "mark1",
     15              "After a call to self.performance.clearMarks(\"mark3\"), where \"mark3" +
     16              "\" is a non-existent mark, self.performance.getEntriesByName(\"mark1\") " +
     17              "returns an object containing the \"mark1\" mark.");
     18 
     19    // test that "mark2" still exists
     20    entries = self.performance.getEntriesByName("mark2");
     21    assert_equals(entries[0].name, "mark2",
     22              "After a call to self.performance.clearMarks(\"mark3\"), where \"mark3" +
     23              "\" is a non-existent mark, self.performance.getEntriesByName(\"mark2\") " +
     24              "returns an object containing the \"mark2\" mark.");
     25 
     26 }, "Clearing a non-existent mark doesn't affect existing marks");