• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  test(function () {
2    assert_equals(typeof self.performance, "object");
3    assert_equals(typeof self.performance.getEntriesByType, "function");
4
5    self.performance.mark("mark1");
6    self.performance.measure("measure1");
7
8    const type = [
9      'mark',
10      'measure',
11    ];
12    type.forEach(function(entryType) {
13      if (PerformanceObserver.supportedEntryTypes.includes(entryType)) {
14        const entryTypeUpperCased = entryType.toUpperCase();
15        const entryTypeCapitalized = entryType[0].toUpperCase() + entryType.substring(1);
16        const lowerList = self.performance.getEntriesByType(entryType);
17        const upperList = self.performance.getEntriesByType(entryTypeUpperCased);
18        const mixedList = self.performance.getEntriesByType(entryTypeCapitalized);
19
20        assert_greater_than(lowerList.length, 0, "Entries exist");
21        assert_equals(upperList.length, 0, "getEntriesByType('" + entryTypeCapitalized + "').length");
22        assert_equals(mixedList.length, 0, "getEntriesByType('" + entryTypeCapitalized + "').length");
23      }
24    });
25  }, "getEntriesByType values are case sensitive");
26