diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/tools/wave/www/test.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/tools/wave/www/test.html')
-rw-r--r-- | testing/web-platform/tests/tools/wave/www/test.html | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/wave/www/test.html b/testing/web-platform/tests/tools/wave/www/test.html new file mode 100644 index 0000000000..d06b18fef6 --- /dev/null +++ b/testing/web-platform/tests/tools/wave/www/test.html @@ -0,0 +1,155 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <title>Creating Session - Web Platform Tests</title> + <link rel="stylesheet" href="css/bulma-0.7.5/bulma.min.css" /> + <link rel="stylesheet" href="css/style.css" /> + <link rel="stylesheet" href="css/main.css" /> + <script src="lib/wave-service.js"></script> + <style> + #console { + font-family: monospace; + } + .spinner { + height: 0.7em; + width: 0.7em; + } + .fa-pulse { + -webkit-animation: fa-spin 1s steps(8) infinite; + animation: fa-spin 1s steps(8) infinite; + } + @-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + to { + -webkit-transform: rotate(1turn); + transform: rotate(1turn); + } + } + @keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + to { + -webkit-transform: rotate(1turn); + transform: rotate(1turn); + } + } + </style> + </head> + <body> + <section class="section"> + <div class="container"> + <img src="res/wavelogo_2016.jpg" alt="WAVE Logo" class="site-logo" /> + + <h1 class="title is-spaced"> + <span> + <img src="res/spinner-solid.svg" class="spinner fa-pulse" /> + </span> + Creating Session + </h1> + <div id="content"> + <div id="details-wrapper"> + <div class="detail"> + <div>Reference Tokens:</div> + <div id="reference-tokens"></div> + </div> + <div class="detail"> + <div>Test Paths:</div> + <div id="test-path"></div> + </div> + </div> + + <div id="console"></div> + </div> + </div> + </section> + <script> + var screenConsole = document.getElementById("console"); + var log = function() { + var text = ""; + for (var i = 0; i < arguments.length; i++) { + text += arguments[i] + " "; + } + text = text.replace(/ /gm, " "); + text = text.replace(/\n/gm, "<br/>"); + screenConsole.innerHTML += "<br/>" + text; + }; + + window.onerror = function(error) { + log(error); + }; + + var HOSTNAME = location.hostname; + var PORT = location.port; + var PROTOCOL = location.protocol.replace(/:/, ""); + var QUERY = decodeURIComponent(location.search.replace(/\?/, "")); + var match = QUERY.match(/token=([^&]+)/); + var TOKEN = match ? match[1] : null; + QUERY += /[\?&]path=/.test(location.search) ? "" : "&resume=1"; + + var parsedQuery = {}; + + var parts = QUERY.split("&"); + for (var i = 0; i < parts.length; i++) { + var part = parts[i]; + var key = part.split("=")[0]; + var value = part.split("=")[1]; + parsedQuery[key] = value; + } + + var includedTests = []; + var paths = parsedQuery["path"].split(","); + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + includedTests.push(path.trim()); + } + + var excludedTests = [ + "/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html", + "/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html" + ]; + + var referenceTokens = []; + if (parsedQuery["reftoken"]) { + var paths = parsedQuery["reftoken"].split(","); + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + referenceTokens.push(path.trim()); + } + } + + var testPath = document.getElementById("test-path"); + var paths = includedTests; + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + testPath.innerText += path + "\n"; + } + var referenceTokensElement = document.getElementById("reference-tokens"); + if (referenceTokens.length === 0) { + referenceTokensElement.innerText = "none"; + } else { + for (var i = 0; i < referenceTokens.length; i++) { + var token = referenceTokens[i]; + referenceTokensElement.innerText += token + "\n"; + } + } + log("Please wait ..."); + WaveService.createSession( + { + tests: { include: includedTests, exclude: excludedTests }, + referenceTokens: referenceTokens + }, + function(token) { + log("Session created successfully! Token: " + token); + log("Redirecting ..."); + location.href = "/newsession.html?token=" + token; + } + ); + </script> + </body> +</html> |