-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrun.html
138 lines (116 loc) · 5.75 KB
/
run.html
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8"/>
<title>i18n test runner</title>
<link rel="stylesheet" type="text/css" href="./runstyle.css">
<script src="runfunctions.js"></script>
<script>
// get parameters
var firstTest = ''
parameters = location.search.split('&');
parameters[0] = parameters[0].substring(1);
for (var p=0;p<parameters.length;p++) {
pairs = parameters[p].split('=');
if (pairs[0] == 'base') { if (pairs[1]) { var base = pairs[1] } }
if (pairs[0] == 'batch') { if (pairs[1]) { var batch = pairs[1] } }
if (pairs[0] == 'test') { if (pairs[1]) { var testparam = pairs[1] } }
}
var ptr = 0; // current index in tests array
// load the appropriate db file
if (! base.match(/\.\./) && ! batch.match(/\.\./)) {
var db = document.createElement('script')
db.src = 'batches/' + batch +'.json'
db.async = false
document.head.appendChild(db)
}
else alert("Invalid base or batch name.")
</script>
<style type="text/css">
.test div { width: 50px; }
body { height: 100%; }
iframe { height: 800px; width: 80%; border: 1px solid #CCC; }
</style>
<script>
function initialise () {
// set select options
for (let t=0; t<tests.length; t++) {
var option = document.createElement('option')
option.value = t
option.appendChild(document.createTextNode(tests[t][0]))
document.getElementById('selector').appendChild(option)
}
// display the requested test
if (testparam) {
if (testparam.match("/\.\./")) {
firstTest = ''
}
else {
for (let t=0;t<tests.length;t++) {
if (tests[t][0] === testparam) { firstTest = t; break; }
}
}
if (firstTest === '') { alert('Bad test name.'); firstTest = 0; }
}
else { firstTest = 0; }
setTest(firstTest, base)
}
</script>
</head>
<body onLoad="initialise()">
<p id="title" class="title">HTTP charset</p>
<p id="scoring" style="display:none;"><button onClick="if (_browsertype == '') { alert('Select a browser!'); return;} adddata(tests[ptr][cTestname], 'pass',getNotes()); if (ptr<tests.length-1) {ptr++; setTest(ptr, base); }">Pass</button>
<button onClick="if (_browsertype == '') { alert('Select a browser!'); return;} adddata(tests[ptr][cTestname], 'fail',getNotes()); if (ptr<tests.length-1) {ptr++; setTest(ptr, base); }">Fail</button>
<button onClick="if (_browsertype == '') { alert('Select a browser!'); return;} adddata(tests[ptr][cTestname], 'partial', getNotes()); if (ptr<tests.length-1) {ptr++; setTest(ptr, base); }">Partial</button>
<button onClick="if (_browsertype == '') { alert('Select a browser!'); return;} adddata(tests[ptr][cTestname], 'skipped', getNotes()); if (ptr<tests.length-1) {ptr++; setTest(ptr, base); }">Skip</button>
<select onChange="_browsertype = this.value">
<option value="">Select a browser</option>
<optgroup label="desktop">
<option value="Firefox">Firefox (Gecko)</option>
<option value="Chrome">Chrome (Blink)</option>
<option value="BlinkEdge">Edge (Blink)</option>
<option value="Safari">Safari (Webkit)</option>
<option value="Opera">Opera (Blink)</option>
<option value="Edge">Edge (EdgeHTML)</option>
<option value="Internet Explorer">Internet Explorer</option>
</optgroup>
<optgroup label="nightlies">
<option value="Nightly">Firefox nightly</option>
<option value="Canary">Google canary</option>
<option value="Webkit">WebKit</option>
</optgroup>
<optgroup label="mobile / tablet">
<option value="Android">Android</option>
<option value="SafariMobile">Safari Mobile</option>
<option value="ChromeMobile">Chrome Mobile</option>
<option value="UC Browser">UC Browser</option>
<option value="OperaAndroid">Opera Android</option>
<option value="OperaMini">Opera Mini</option>
</optgroup>
<option value="Other">Other</option>
</select>
</p>
<div style="display: flex;"><span id="status" style="display: inline-block; width:1.4em;height:1.4em;border-radius:.7em; text-align: center; vertical-align: middle;margin-right: 1em; border: 1px dotted #ccc;" class=""> </span><textarea id="notes" placeholder="Add any notes here before clicking above. Particularly for partial passes." style="width: 60%; height:2em; border:1px dotted #ccc; background-color: white; display: none;"></textarea></div>
<iframe name="testframe" id="testframe" src="none.html">Test framework not supported</iframe>
<div class="nexttest">
<p class="jump" style="margin-top: 0;"><select id="selector" onChange="setTest(this.value, base);"></select></p>
<div style="color:teal; cursor:pointer; text-align:right;"><span onclick="if (ptr>0) {ptr--; setTest(ptr, base); }">Previous</span> • <span onclick="if (ptr<tests.length-1) {ptr++; setTest(ptr, base); }">Next</span></div>
<p class="jump">
<a id="speclink" href="http://www.w3.org/TR/html5/syntax.html#the-input-byte-stream" target="_blank">Link to spec</a><br/>
<a href="http://www.w3.org/International/tests/" target="_blank">i18n tests</a></p>
<div id="prerequisites" class="prereq"></div>
<div id="assertion" class="assert" title="Assertion">The character encoding of the page can be set by a meta element with http-equiv and content attributes.</div>
</div>
<div id="interact">
<div id="info" style="font-size: 90%; font-style: italic;"></div>
<p><button onClick="setUpScoring();">Score</button> <a href="howto" class="jump" style="font-size: 90%; font-style:italic;" target="_blank">How to score and send results</a> <button id="resultsButton" style="display:none;" onClick="dump();">Show results</button>
</p>
</div>
<!--div id=testdetail></div-->
<textarea id="testdetail" style="display:none; width: 80%; height: 200px;"></textarea>
<script>
//setTest(<?php echo $firsttest; ?>,base);
document.getElementById('info').innerHTML = navigator.userAgent;
</script>
</body>
</html>