summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/resources/test/tests/functional/add_cleanup_err.html
blob: 60357c66ee9e4537ec4483daecd624ff3a58f9fd (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
39
40
41
42
43
44
45
<!DOCTYPE HTML>
<html>
<head>
<title>Test#add_cleanup: error</title>
<script src="../../../testharness.js"></script>
<script src="../../../testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
"use strict";

test(function(t) {
  t.add_cleanup(function() {
    throw new Error('exception in cleanup function');
  });
}, "Exception in cleanup function causes harness failure.");

test(function() {}, "This test should not be run.");
</script>
<script type="text/json" id="expected">
{
  "summarized_status": {
    "status_string": "ERROR",
    "message": "Test named 'Exception in cleanup function causes harness failure.' specified 1 'cleanup' function, and 1 failed."
  },
  "summarized_tests": [
    {
      "status_string": "PASS",
      "name": "Exception in cleanup function causes harness failure.",
      "properties": {},
      "message": null
    },
    {
      "status_string": "NOTRUN",
      "name": "This test should not be run.",
      "properties": {},
      "message": null
    }
  ],
  "type": "complete"
}
</script>
</body>
</html>