Backed out changeset 8fc3326bce7f (bug 1943032) for causing failures at browser_tab_g...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / js / js-test-post.js
blob2b19b3b98fc00a6395b288725b3554102850bfb5
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 */
7 shouldBeTrue("successfullyParsed");
8 _addSpan('<br /><span class="pass">TEST COMPLETE</span>');
9 if (_jsTestPreVerboseLogging) {
10 _bufferedLogToConsole('TEST COMPLETE');
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);
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>`;
34 const e_desc = document.getElementById("description");
35 e_desc.appendChild(e_results);
38 notifyFinishedToHarness()