summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/performance-timeline/supportedEntryTypes.any.js
blob: 25f195939e7b692509625b8131e537164cdf56c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
test(() => {
  if (typeof PerformanceObserver.supportedEntryTypes === "undefined")
    assert_unreached("supportedEntryTypes is not supported.");
  const types = PerformanceObserver.supportedEntryTypes;
  assert_greater_than(types.length, 0,
    "There should be at least one entry in supportedEntryTypes.");
  for (let i = 1; i < types.length; i++) {
    assert_true(types[i-1] < types[i],
      "The strings '" + types[i-1] + "' and '" + types[i] +
      "' are repeated or they are not in alphabetical order.")
  }
}, "supportedEntryTypes exists and returns entries in alphabetical order");

test(() => {
  if (typeof PerformanceObserver.supportedEntryTypes === "undefined")
    assert_unreached("supportedEntryTypes is not supported.");
  assert_true(PerformanceObserver.supportedEntryTypes ===
      PerformanceObserver.supportedEntryTypes);
}, "supportedEntryTypes caches result");