summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/performance-timeline/resources/postmessage-entry.html
blob: ef5be73395b49d895a2589be547a7f3950f416ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!doctype html>
<script>
addEventListener("load", () => {
  const entry = performance.getEntriesByType("navigation")[0];
  try {
    window.top.postMessage(entry, "*");
  } catch(error) {
    if (error.name == "DataCloneError") {
      window.top.postMessage("PASS", "*");
    } else {
      window.top.postMessage("FAIL - Wrong exception name: " + error.name, "*");
    }
  }
  window.top.postMessage("FAIL - No exception thrown", "*");
});

</script>