forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfetch-url-serialization.html
32 lines (32 loc) · 1023 Bytes
/
fetch-url-serialization.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Request URL handling</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#request">
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<base id="base">
</head>
<body>
<script>
function executeTests(urls)
{
for (url of urls) {
if (url.input) {
test(function() {
document.getElementById("base").setAttribute("href", url.base);
if (url.username || url.password || url.failure)
assert_throws_js(TypeError, function() { new Request(url.input); });
else {
var request = new Request(url.input);
assert_equals(request.url, url.href);
}
}, "Testing Request url '" + url.input + "' with base '" + url.base + "'");
}
}
}
</script>
<script src="fetch-urls.json"></script>
</body>
</html>