measure_exception.html (1845B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>exception test of window.performance.measure</title> 6 <link rel="author" title="Intel" href="http://www.intel.com/" /> 7 <link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="/common/performance-timeline-utils.js"></script> 11 <script src="resources/webperftestharness.js"></script> 12 <script src="resources/webperftestharnessextension.js"></script> 13 </head> 14 15 <body> 16 <h1>Description</h1> 17 <p>This test validates all exception scenarios of method window.performance.measure in User Timing API</p> 18 19 <div id="log"></div> 20 <script> 21 performance.mark('ExistMark'); 22 test_method_throw_exception('performance.measure()', TypeError); 23 test_method_throw_exception('performance.measure("Exception1", "NonExistMark1")', 'SYNTAX_ERR'); 24 test_method_throw_exception('performance.measure("Exception2", "NonExistMark1", "navigationStart")', 'SYNTAX_ERR'); 25 test_method_throw_exception('performance.measure("Exception3", "navigationStart", "NonExistMark1")', 'SYNTAX_ERR'); 26 test_method_throw_exception('performance.measure("Exception4", "NonExistMark1", "ExistMark")', 'SYNTAX_ERR'); 27 test_method_throw_exception('performance.measure("Exception5", "ExistMark", "NonExistMark1")', 'SYNTAX_ERR'); 28 test_method_throw_exception('performance.measure("Exception6", "NonExistMark1", "NonExistMark2")', 'SYNTAX_ERR'); 29 test_method_throw_exception('performance.measure("Exception7", "redirectStart")', 'INVALID_ACCESS_ERR'); 30 test_method_throw_exception('performance.measure("Exception8", {"detail": "non-empty"})', TypeError); 31 test_method_throw_exception('performance.measure("Exception9", {"start": 1, "duration": 2, "end": 3})', TypeError); 32 </script> 33 </body> 34 </html>