summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js b/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js
index e1cb9f749c..adc1f8a5aa 100644
--- a/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js
+++ b/dom/canvas/test/webgl-conf/checkout/js/js-test-pre.js
@@ -93,20 +93,25 @@ const RESULTS = {
fail: 0,
};
+// We cache these values since they will potentially be accessed many (100k+)
+// times and accessing window can be significantly slower than a local variable.
+const locationPathname = window.location.pathname;
+const webglTestHarness = window.parent.webglTestHarness;
+
function reportTestResultsToHarness(success, msg) {
if (success) {
RESULTS.pass += 1;
} else {
RESULTS.fail += 1;
}
- if (window.parent.webglTestHarness) {
- window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg);
+ if (webglTestHarness) {
+ webglTestHarness.reportResults(locationPathname, success, msg);
}
}
function reportSkippedTestResultsToHarness(success, msg) {
- if (window.parent.webglTestHarness) {
- window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg, true);
+ if (webglTestHarness) {
+ webglTestHarness.reportResults(locationPathname, success, msg, true);
}
}
@@ -116,8 +121,8 @@ function notifyFinishedToHarness() {
}
window._didNotifyFinishedToHarness = true;
- if (window.parent.webglTestHarness) {
- window.parent.webglTestHarness.notifyFinished(window.location.pathname);
+ if (webglTestHarness) {
+ webglTestHarness.notifyFinished(locationPathname);
}
if (window.nonKhronosFrameworkNotifyDone) {
window.nonKhronosFrameworkNotifyDone();
@@ -268,9 +273,9 @@ function getCurrentTestName()
*/
function testPassedOptions(msg, addSpan)
{
+ reportTestResultsToHarness(true, _currentTestName + ": " + msg);
if (addSpan && !quietMode())
{
- reportTestResultsToHarness(true, _currentTestName + ": " + msg);
_addSpan('<span><span class="pass">PASS</span> ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + '</span>');
}
if (_jsTestPreVerboseLogging) {
@@ -285,9 +290,9 @@ function testPassedOptions(msg, addSpan)
*/
function testSkippedOptions(msg, addSpan)
{
+ reportSkippedTestResultsToHarness(true, _currentTestName + ": " + msg);
if (addSpan && !quietMode())
{
- reportSkippedTestResultsToHarness(true, _currentTestName + ": " + msg);
_addSpan('<span><span class="warn">SKIP</span> ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + '</span>');
}
if (_jsTestPreVerboseLogging) {