summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/wave/www/submitresult.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/tools/wave/www/submitresult.html')
-rw-r--r--testing/web-platform/tests/tools/wave/www/submitresult.html63
1 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/wave/www/submitresult.html b/testing/web-platform/tests/tools/wave/www/submitresult.html
new file mode 100644
index 0000000000..07e9f35235
--- /dev/null
+++ b/testing/web-platform/tests/tools/wave/www/submitresult.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Web Platform Tests</title>
+ <style>
+ #console {
+ font-family: monospace;
+ }
+ </style>
+ <script src="lib/wave-service.js"></script>
+ </head>
+ <body>
+ <div id="console"></div>
+ <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, "&nbsp;");
+ 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 = (location.search.replace(/\?/, ""));
+ var match = QUERY.match(/token=([^&]+)/);
+ var TOKEN = match ? match[1] : null;
+ QUERY += /[\?&]path=/.test(location.search) ? "" : "&resume=1";
+ match = QUERY.match(/data=([^&]+)/);
+
+ 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 resultData;
+ var rawResult = parsedQuery.result;
+ if (rawResult) {
+ resultData = JSON.parse(decodeURIComponent(rawResult));
+ }
+
+ WaveService.createResult(TOKEN, resultData, function() {
+ WaveService.readNextTest(TOKEN, function(url) {
+ location.href = url;
+ });
+ });
+ </script>
+ </body>
+</html>