• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<html>
3  <head>
4    <meta charset="utf-8" />
5    <title>exception test of performance.mark and performance.measure</title>
6    <meta rel="help" href="https://w3c.github.io/user-timing/#extensions-performance-interface"/>
7    <script src="/resources/testharness.js"></script>
8    <script src="/resources/testharnessreport.js"></script>
9    <script src="resources/webperftestharness.js"></script>
10  </head>
11  <body>
12    <h1>Description</h1>
13    <p>This test validates exception scenarios of invoking mark() and measure() with timing attributes as value.</p>
14    <div id="log"></div>
15    <script>
16function emit_test(attrName) {
17    test(function() {
18        assert_throws_dom("SyntaxError", function() { window.performance.mark(attrName); });
19    }, "performance.mark should throw if used with timing attribute " + attrName);
20}
21for (var i in timingAttributes) {
22  emit_test(timingAttributes[i]);
23}
24
25function emit_test2(attrName) {
26    test(function() {
27        window.performance.measure(attrName);
28    }, "performance.measure should not throw if used with timing attribute " + attrName);
29}
30for (var i in timingAttributes) {
31  emit_test2(timingAttributes[i]);
32}
33    </script>
34  </body>
35</html>
36