summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/acid/acid3/numbered-tests.html
blob: 42d3324c69edc97c1ee455fd3b0533de32cc2f0e (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
<!doctype html>
<title>Acid3 numbered tests</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var tests = undefined;

function gotMessage(e) {
  var m = e.data;
  if (tests === undefined && "num_tests" in m) {
    tests = [];
    for (var i = 0; i < m.num_tests; i++) {
      tests.push(async_test("Test " + i));
    }
  } else if ("result" in m) {
    var test = m.test;
    var passed = m.result === "pass";
    var message = m.message;
    tests[test].step(function() {
      assert_true(passed, message);
    });
    tests[test].done();
  }
}
window.addEventListener("message", gotMessage, false);
</script>
<iframe src="test.html"></iframe>