(index)
| 51 | }, "Entry 1 is properly created"); |
| 52 | |
| 53 | function test_mark(index) { |
| 54 | test(function () { |
| 55 | const entries = self.performance.getEntriesByName("mark"); |
| 56 | assert_equals(entries[index].name, "mark", "Entry has the proper name"); |
| 57 | }, "Entry " + index + " has the proper name"); |
| 58 | |
| 59 | test(function () { |
| 60 | const entries = self.performance.getEntriesByName("mark"); |
| 61 | assert_approx_equals(entries[index].startTime, expectedTimes[index], testThreshold); |
| 62 | }, "Entry " + index + " startTime is approximately correct (up to " + testThreshold + |
| 63 | "ms difference allowed)"); |
| 64 | |
| 65 | test(function () { |
| 66 | const entries = self.performance.getEntriesByName("mark"); |
| 67 | assert_equals(entries[index].entryType, "mark"); |
| 68 | }, "Entry " + index + " has the proper entryType"); |
| 69 | |
| 70 | test(function () { |
| 71 | const entries = self.performance.getEntriesByName("mark"); |
| 72 | assert_equals(entries[index].duration, 0); |
| 73 | }, "Entry " + index + " duration == 0"); |
| 74 | |
| 75 | test(function () { |
| 76 | const entries = self.performance.getEntriesByName("mark", "mark"); |
| 77 | assert_equals(entries[index].name, "mark"); |
| 78 | }, "getEntriesByName(\"mark\", \"mark\")[" + index + "] returns an " + |
| 79 | "object containing a \"mark\" mark"); |
| 80 | |
| 81 | test(function () { |
| 82 | const entries = self.performance.getEntriesByName("mark", "mark"); |
| 83 | match_entries(entries, index); |
| 84 | }, "The mark returned by getEntriesByName(\"mark\", \"mark\")[" + index |
| 85 | + "] matches the mark returned by " + |
| 86 | "getEntriesByName(\"mark\")[" + index + "]"); |
| 87 | |
| 88 | test(function () { |
| 89 | const entries = filter_entries_by_type(self.performance.getEntries(), "mark"); |
| 90 | assert_equals(entries[index].name, "mark"); |
| 91 | }, "getEntries()[" + index + "] returns an " + |
| 92 | "object containing a \"mark\" mark"); |
| 93 | |
| 94 | test(function () { |
| 95 | const entries = filter_entries_by_type(self.performance.getEntries(), "mark"); |
| 96 | match_entries(entries, index); |
| 97 | }, "The mark returned by getEntries()[" + index |
| 98 | + "] matches the mark returned by " + |
| 99 | "getEntriesByName(\"mark\")[" + index + "]"); |
| 100 | |
| 101 | test(function () { |
| 102 | const entries = self.performance.getEntriesByType("mark"); |
| 103 | assert_equals(entries[index].name, "mark"); |
| 104 | }, "getEntriesByType(\"mark\")[" + index + "] returns an " + |
| 105 | "object containing a \"mark\" mark"); |
| 106 | |
| 107 | test(function () { |
| 108 | const entries = self.performance.getEntriesByType("mark"); |
| 109 | match_entries(entries, index); |
| 110 | }, "The mark returned by getEntriesByType(\"mark\")[" + index |
no test coverage detected