summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/performance/performance-mark-exceptions.html
blob: b33f45c07c7119f5505f60ba56e9ee31bfe4ff1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <script src="../../resources/js-test.js"></script>
    <script>
        description("This tests that 'performance.mark' throws exceptions with reasonable messages.");

        var allTheThings = [
            'navigationStart',
            'unloadEventStart',
            'unloadEventEnd',
            'redirectStart',
            'redirectEnd',
            'fetchStart',
            'domainLookupStart',
            'domainLookupEnd',
            'connectStart',
            'connectEnd',
            'secureConnectionStart',
            'requestStart',
            'responseStart',
            'responseEnd',
            'domLoading',
            'domInteractive',
            'domContentLoadedEventStart',
            'domContentLoadedEventEnd',
            'domComplete',
            'loadEventStart',
            'loadEventEnd',
        ];
        allTheThings.forEach(function(name) {
            shouldThrow('window.performance.mark(\'' + name + '\')', '"SyntaxError: Failed to execute \'mark\' on \'Performance\': \'' + name + '\' is part of the PerformanceTiming interface, and cannot be used as a mark name."');
        });
    </script>
</body>
</html>