Skip to content

Commit e15b245

Browse files
author
Daniel Herzog
committed
DFL-3486: network-inspector.network-header-tokenizer testcase link is broken
1 parent 04d921e commit e15b245

File tree

1 file changed

+25
-46
lines changed

1 file changed

+25
-46
lines changed

test-scripts/network-view/header-tokenizer.html renamed to tests/header_tokenizer.qunit.html

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,12 @@
1-
<!DOCTYPE html>
2-
<html>
3-
4-
<link rel="stylesheet" href="../../src/ui-style/ui.css"/>
5-
<link rel="stylesheet" href="../../src/network/network_style.css"/>
6-
<link rel="stylesheet" href="../../src/ui-scripts/tooltip/tooltip.css"/>
7-
8-
<style>
9-
10-
html
11-
{
12-
margin: 5px;
13-
}
14-
15-
.type-1 {
16-
color: blue;
17-
}
18-
19-
.type-2 {
20-
color: red;
21-
}
22-
23-
.type-3 {
24-
color: green;
25-
}
26-
27-
.type-4 {
28-
color: #bada55;
29-
}
30-
31-
</style>
32-
33-
<script src="../../src/scripts/dom.js"></script>
34-
<script src="../../src/syntaxhighlight/http-header/tokenizer.js"></script>
35-
1+
<!doctype html>
2+
<meta charset="utf-8">
3+
<title>Header Tokenizer</title>
4+
<link rel="stylesheet" href="qunit/qunit.css" media="screen">
5+
<script src="qunit/qunit.js"></script>
6+
<script src="../src/lib/elementprototype.js"></script>
7+
<script src="../src/syntaxhighlight/http-header/tokenizer.js"></script>
368
<script>
9+
window.onload = function() {
3710

3811
var token_template = function(token)
3912
{
@@ -90,20 +63,26 @@
9063
Cache-Control:no-cache\n\
9164
Connection:Keep-Alive";
9265

93-
window.onload = function()
94-
{
95-
var headers = [raw_headers, raw_headers2, raw_headers3];
96-
headers.forEach(function(header_string){
97-
var pre = document.body.firstElementChild.render(["pre"])
98-
pre.render(get_tokens(header_string).map(token_template));
99-
if (pre.textContent !== header_string)
100-
throw(new Error("Tokenized headers produced different result."));
101-
});
66+
test("Tokenized headers",
67+
function()
68+
{
69+
var headers = [raw_headers, raw_headers2, raw_headers3];
70+
headers.forEach(function(header_string){
71+
var pre = document.body.firstElementChild.render(["pre"])
72+
pre.render(get_tokens(header_string).map(token_template));
73+
deepEqual(pre.textContent, header_string);
74+
});
75+
}
76+
)
10277
}
103-
10478
</script>
10579
<body>
106-
<pre class="mono"></pre>
80+
<pre style="display: none"></pre>
81+
<h1 id="qunit-header">Dragonfly - Command Processor</h1>
82+
<h2 id="qunit-banner"></h2>
83+
<div id="qunit-testrunner-toolbar"></div>
84+
<h2 id="qunit-userAgent"></h2>
85+
<ol id="qunit-tests"></ol>
10786
</body>
10887
</html>
10988

0 commit comments

Comments
 (0)