-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
57 lines (51 loc) · 1.85 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
function fetchManifest()
{
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === XMLHttpRequest.DONE) {
if (httpRequest.status === 200) {
var data = JSON.parse(httpRequest.responseText);
displayTestList(data);
}
}
};
httpRequest.open("GET", "./MANIFEST.json");
httpRequest.send();
}
function displayTestList(aManifest)
{
var i, htmlList;
var reftestList = aManifest.items.reftest;
htmlList = document.getElementById("reftestList");
for (i = 0; i < reftestList.length; i++) {
var reftest = reftestList[i];
var item = "<li>";
item += "<a href=\"" + reftest.url + "\">" + reftest.url + "</a>";
item += " (" + reftest.references[0][1] + " ";
item += "<a href=\"" + reftest.references[0][0] + "\">reference</a>)";
item += "</li>";
htmlList.insertAdjacentHTML("beforeend", item);
}
var testharnessList = aManifest.items.testharness;
htmlList = document.getElementById("scripttestList");
for (i = 0; i < testharnessList.length; i++) {
var test = testharnessList[i];
var item = "<li>";
item += "<a href=\"" + test.url + "\">" + test.url + "</a>";
item += "</li>";
htmlList.insertAdjacentHTML("beforeend", item);
}
var manualtestList = aManifest.items.manual;
htmlList = document.getElementById("manualtestList");
for (i = 0; i < manualtestList.length; i++) {
var test = manualtestList[i];
var item = "<li>";
item += "<a href=\"" + test.url + "\">" + test.url + "</a>";
item += "</li>";
htmlList.insertAdjacentHTML("beforeend", item);
}
}
function displayReftestList(aHTMLList, aReftestList)
{
}
window.addEventListener("DOMContentLoaded", fetchManifest);