Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / performance / performance-measure-exceptions.html
blobc07e688d96ce478c34b38ac48731fd4659e7e615
1 <!DOCTYPE html>
2 <html>
3 <head>
4 </head>
5 <body>
6 <script src="../../resources/js-test.js"></script>
7 <script>
8 description("This tests that 'performance.measure' throws exceptions with reasonable messages.");
10 shouldThrow('window.performance.measure("DoesNotExist", "AlsoDoesNotExist")', '"SyntaxError: Failed to execute \'measure\' on \'Performance\': The mark \'AlsoDoesNotExist\' does not exist."');
12 window.performance.mark('mark');
14 var allTheExceptionalThings = [
15 'unloadEventStart',
16 'unloadEventEnd',
17 'redirectStart',
18 'redirectEnd',
19 'secureConnectionStart',
20 'domInteractive',
21 'domContentLoadedEventStart',
22 'domContentLoadedEventEnd',
23 'domComplete',
24 'loadEventStart',
25 'loadEventEnd',
27 allTheExceptionalThings.forEach(function(name) {
28 shouldThrow('window.performance.measure("measuring", \'' + name + '\', "mark")', '"InvalidAccessError: Failed to execute \'measure\' on \'Performance\': \'' + name + '\' is empty: either the event hasn\'t happened yet, or it would provide cross-origin timing information."');
29 });
30 </script>
31 </body>
32 </html>