Debian Codegraph @

testing/web-platform/tests/tools/wave/www/submitresult.html

raw
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <title>Web Platform Tests</title>
6 <style>
7 #console {
8 font-family: monospace;
9 }
10 </style>
11 <script src="lib/wave-service.js"></script>
12 </head>
13 <body>
14 <div id="console"></div>
15 <script>
16 var screenConsole = document.getElementById("console");
17 var log = function() {
18 var text = "";
19 for (var i = 0; i < arguments.length; i++) {
20 text += arguments[i] + " ";
21 }
22 text = text.replace(/ /gm, "&nbsp;");
23 text = text.replace(/\n/gm, "<br/>");
24 screenConsole.innerHTML += "<br/>" + text;
25 };
26
27 window.onerror = function(error) {
28 log(error);
29 };
30
31 var HOSTNAME = location.hostname;
32 var PORT = location.port;
33 var PROTOCOL = location.protocol.replace(/:/, "");
34 var QUERY = (location.search.replace(/\?/, ""));
35 var match = QUERY.match(/token=([^&]+)/);
36 var TOKEN = match ? match[1] : null;
37 QUERY += /[\?&]path=/.test(location.search) ? "" : "&resume=1";
38 match = QUERY.match(/data=([^&]+)/);
39
40 var parsedQuery = {};
41
42 var parts = QUERY.split("&");
43 for (var i = 0; i < parts.length; i++) {
44 var part = parts[i];
45 var key = part.split("=")[0];
46 var value = part.split("=")[1];
47 parsedQuery[key] = value;
48 }
49
50 var resultData;
51 var rawResult = parsedQuery.result;
52 if (rawResult) {
53 resultData = JSON.parse(decodeURIComponent(rawResult));
54 }
55
56 WaveService.createResult(TOKEN, resultData, function() {
57 WaveService.readNextTest(TOKEN, function(url) {
58 location.href = url;
59 });
60 });
61 </script>
62 </body>
63 </html>