| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | /* |
| 7 | * JavaScript test library shared functions file for running the tests |
| 8 | * in the browser. Overrides the shell's print function with document.write |
| 9 | * and make everything HTML pretty. |
| 10 | * |
| 11 | * To run the tests in the browser, use the mkhtml.pl script to generate |
| 12 | * html pages that include the shell.js, browser.js (this file), and the |
| 13 | * test js file in script tags. |
| 14 | * |
| 15 | * The source of the page that is generated should look something like this: |
| 16 | * <script src="./../shell.js"></script> |
| 17 | * <script src="./../browser.js"></script> |
| 18 | * <script src="./mytest.js"></script> |
| 19 | */ |
| 20 | |
| 21 | /* |
| 22 | * The earlier versions of the test code used exceptions |
| 23 | * to terminate the test script in "negative" test cases |
| 24 | * before the failure reporting code could run. In order |
| 25 | * to be able to capture errors for the "negative" case |
| 26 | * where the exception is a sign the test actually passed, |
| 27 | * the err online handler will assume that any error is a |
| 28 | * failure unless gExceptionExpected is true. |
| 29 | */ |
| 30 |