• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
21performance.mark('ExistMark');
22test_method_throw_exception('performance.measure()', TypeError);
23test_method_throw_exception('performance.measure("Exception1", "NonExistMark1")', 'SYNTAX_ERR');
24test_method_throw_exception('performance.measure("Exception2", "NonExistMark1", "navigationStart")', 'SYNTAX_ERR');
25test_method_throw_exception('performance.measure("Exception3", "navigationStart", "NonExistMark1")', 'SYNTAX_ERR');
26test_method_throw_exception('performance.measure("Exception4", "NonExistMark1", "ExistMark")', 'SYNTAX_ERR');
27test_method_throw_exception('performance.measure("Exception5", "ExistMark", "NonExistMark1")', 'SYNTAX_ERR');
28test_method_throw_exception('performance.measure("Exception6", "NonExistMark1", "NonExistMark2")', 'SYNTAX_ERR');
29test_method_throw_exception('performance.measure("Exception7", "redirectStart")', 'INVALID_ACCESS_ERR');
30test_method_throw_exception('performance.measure("Exception8", {"detail": "non-empty"})', TypeError);
31test_method_throw_exception('performance.measure("Exception9", {"start": 1, "duration": 2, "end": 3})', TypeError);
32</script>
33</body>
34</html>
35