blob: c07e688d96ce478c34b38ac48731fd4659e7e615 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="../../resources/js-test.js"></script>
<script>
description("This tests that 'performance.measure' throws exceptions with reasonable messages.");
shouldThrow('window.performance.measure("DoesNotExist", "AlsoDoesNotExist")', '"SyntaxError: Failed to execute \'measure\' on \'Performance\': The mark \'AlsoDoesNotExist\' does not exist."');
window.performance.mark('mark');
var allTheExceptionalThings = [
'unloadEventStart',
'unloadEventEnd',
'redirectStart',
'redirectEnd',
'secureConnectionStart',
'domInteractive',
'domContentLoadedEventStart',
'domContentLoadedEventEnd',
'domComplete',
'loadEventStart',
'loadEventEnd',
];
allTheExceptionalThings.forEach(function(name) {
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."');
});
</script>
</body>
</html>