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