summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/harness/wptrunner/testharnessreport-servodriver.js
blob: 9008944ef5a1df017c8782628c54ca995ac9b210 (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
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

setup({output:%(output)d});

add_completion_callback(function() {
    add_completion_callback(function (tests, status) {
        var subtest_results = tests.map(function(x) {
            return [x.name, x.status, x.message, x.stack]
        });
        var id = location.pathname + location.search + location.hash;
        var results = JSON.stringify([id,
                                      status.status,
                                      status.message,
                                      status.stack,
                                      subtest_results]);
        (function done() {
            if (window.__wd_results_callback__) {
                clearTimeout(__wd_results_timer__);
                __wd_results_callback__(results)
            } else {
                setTimeout(done, 20);
            }
        })()
    })
});