tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

js-test-post.js (1293B)


      1 /*
      2 Copyright (c) 2019 The Khronos Group Inc.
      3 Use of this source code is governed by an MIT-style license that can be
      4 found in the LICENSE.txt file.
      5 */
      6 
      7 shouldBeTrue("successfullyParsed");
      8 _addSpan('<br /><span class="pass">TEST COMPLETE</span>');
      9 if (_jsTestPreVerboseLogging) {
     10    _bufferedLogToConsole('TEST COMPLETE');
     11 }
     12 
     13 {
     14    const e_results = document.createElement('div');
     15    let fails_class = 'pass';
     16    if (RESULTS.fail) {
     17        fails_class = 'fail';
     18    } else {
     19        const parseBoolean = v => v.toLowerCase().startsWith('t') || parseFloat(v) > 0;
     20        const params = new URLSearchParams(window.location.search);
     21        if (parseBoolean(params.get('runUntilFail') || '')) {
     22          setTimeout(() => {
     23            params.set('runCount', parseInt(params.get('runCount') || '0') + 1);
     24            const url = new URL(window.location.href);
     25            url.search = params.toString();
     26            window.location.href = url.toString();
     27          }, 100);
     28        }
     29    }
     30    e_results.classList.add('pass');
     31    e_results.innerHTML = `<p>TEST COMPLETE: ${RESULTS.pass} PASS, ` +
     32      `<span class="${fails_class}">${RESULTS.fail} FAIL</span></p>`;
     33 
     34    const e_desc = document.getElementById("description");
     35    e_desc.appendChild(e_results);
     36 }
     37 
     38 notifyFinishedToHarness()