diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/user-timing/test_user_timing_mark_exceptions.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/user-timing/test_user_timing_mark_exceptions.html')
-rw-r--r-- | testing/web-platform/tests/user-timing/test_user_timing_mark_exceptions.html | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/testing/web-platform/tests/user-timing/test_user_timing_mark_exceptions.html b/testing/web-platform/tests/user-timing/test_user_timing_mark_exceptions.html new file mode 100644 index 000000000..1fe214f78 --- /dev/null +++ b/testing/web-platform/tests/user-timing/test_user_timing_mark_exceptions.html @@ -0,0 +1,105 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8" /> + <title>window.performance User Timing mark() method is throwing the proper exceptions</title> + <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> + <link rel="help" href="http://www.w3.org/TR/user-timing/#dom-performance-mark"/> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="resources/webperftestharness.js"></script> + + <script type="text/javascript"> + // navigation timing attributes + var timingAttributes = [ + 'connectEnd', + 'connectStart', + 'domComplete', + 'domContentLoadedEventEnd', + 'domContentLoadedEventStart', + 'domInteractive', + 'domLoading', + 'domainLookupEnd', + 'domainLookupStart', + 'fetchStart', + 'loadEventEnd', + 'loadEventStart', + 'navigationStart', + 'redirectEnd', + 'redirectStart', + 'requestStart', + 'responseEnd', + 'responseStart', + 'unloadEventEnd', + 'unloadEventStart' + ]; + + // test data + var markExceptionThrown = false; + + setup({explicit_done: true}); + + test_namespace(); + + function onload_test() + { + // test for existance of User Timing and Performance Timeline interface + if (window.performance.mark == undefined || + window.performance.clearMarks == undefined || + window.performance.measure == undefined || + window.performance.clearMeasures == undefined || + window.performance.getEntriesByName == undefined || + window.performance.getEntriesByType == undefined || + window.performance.getEntries == undefined) + { + test_true(false, + "The User Timing and Performance Timeline interfaces, which are required for this test, " + + "are defined."); + + done(); + } + else + { + test_mark_exceptions(); + } + } + + function test_mark_exceptions() + { + // loop through mark scenarios + for (var i in timingAttributes) + { + try + { + // create the mark + window.performance.mark(timingAttributes[i]); + + test_true(false, + "window.performance.mark(\"" + timingAttributes[i] + "\") threw an exception."); + } + catch(e) + { + test_true(true, + "window.performance.mark(\"" + timingAttributes[i] + "\") threw an exception."); + + // confirm that a SYNTAX_ERR exception is thrown and not any other exception + test_equals(e.code, + e.SYNTAX_ERR, + "window.performance.mark(\"" + timingAttributes[i] + "\") threw a SYNTAX_ERR " + + "exception."); + } + } + + done(); + } + </script> + </head> + <body onload="onload_test();"> + <h1>Description</h1> + <p>This test validates that the performance.mark() method throws a SYNTAX_ERR exception whenever a navigation + timing attribute is provided for the name parameter. + </p> + + <div id="log"></div> + </body> +</html> |