2 * Copyright 2016 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 var msg = "Got exception ";
25 if(e && typeof(e) == "object" && "message")
30 if("tests" in window) next_test();
35 function next_test() {
36 var test = tests.shift();
37 window.setTimeout(guard(test), 0);
40 function run_tests() {
41 tests.push(reportSuccess);
46 return external.ok(b, format_message(m));
50 external.trace(format_message(m));
53 function win_skip(m) {
57 function reportSuccess() {
58 external.reportSuccess();
63 return external.todo_wine_ok(b, format_message(m));
67 function todo_wine_if(expr) {
68 return expr ? todo_wine : { ok: ok };
71 var file_prefix = document.location.pathname;
72 if(document.location.search)
73 file_prefix += document.location.search;
78 function format_message(msg) {
80 if(test_name) p += test_name + ":";
84 function sync_test(name, f)
86 tests.push(function() {
89 test_name = undefined;
94 function async_test(name, f)
96 tests.push(function() {