11cb0ef41Sopenharmony_ci<!DOCTYPE html>
21cb0ef41Sopenharmony_ci<html>
31cb0ef41Sopenharmony_ci    <head>
41cb0ef41Sopenharmony_ci        <meta charset="UTF-8" />
51cb0ef41Sopenharmony_ci        <title>window.performance User Timing mark() method is throwing the proper exceptions</title>
61cb0ef41Sopenharmony_ci        <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
71cb0ef41Sopenharmony_ci        <link rel="help" href="http://w3c.github.io/user-timing/#dom-performance-mark"/>
81cb0ef41Sopenharmony_ci        <script src="/resources/testharness.js"></script>
91cb0ef41Sopenharmony_ci        <script src="/resources/testharnessreport.js"></script>
101cb0ef41Sopenharmony_ci        <script src="resources/webperftestharness.js"></script>
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci    <script>
131cb0ef41Sopenharmony_cifunction test_exception(attrName) {
141cb0ef41Sopenharmony_ci    test(function () {
151cb0ef41Sopenharmony_ci        assert_throws_dom("SyntaxError", function () {
161cb0ef41Sopenharmony_ci            window.performance.mark(attrName);
171cb0ef41Sopenharmony_ci        })
181cb0ef41Sopenharmony_ci    }, "window.performance.mark(\"" + attrName + "\") throws a SyntaxError exception.");
191cb0ef41Sopenharmony_ci}
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_citest(() => {
221cb0ef41Sopenharmony_ci    assert_throws_js(TypeError, function() {
231cb0ef41Sopenharmony_ci        window.performance.mark();
241cb0ef41Sopenharmony_ci    });
251cb0ef41Sopenharmony_ci}, 'window.performance.mark() throws a TypeError exception.')
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ci// loop through mark scenarios
281cb0ef41Sopenharmony_cifor (var i in timingAttributes) {
291cb0ef41Sopenharmony_ci    test_exception(timingAttributes[i]);
301cb0ef41Sopenharmony_ci}
311cb0ef41Sopenharmony_ci    </script>
321cb0ef41Sopenharmony_ci    </head>
331cb0ef41Sopenharmony_ci    <body>
341cb0ef41Sopenharmony_ci        <h1>Description</h1>
351cb0ef41Sopenharmony_ci        <p>This test validates that the performance.mark() method throws a SYNTAX_ERR exception whenever a navigation
361cb0ef41Sopenharmony_ci           timing attribute is provided for the name parameter.
371cb0ef41Sopenharmony_ci        </p>
381cb0ef41Sopenharmony_ci
391cb0ef41Sopenharmony_ci        <div id="log"></div>
401cb0ef41Sopenharmony_ci    </body>
411cb0ef41Sopenharmony_ci</html>
42