Bug 1943650 - Command-line --help output misformatted after --dbus-service. r=emilio
[gecko.git] / dom / url / tests / test_url_data.html
blobbeeb7a2d3983025b6984d05ae2ded54bc98f57d6
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Test URL API - data:plain</title>
6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
8 </head>
9 <body>
10 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1018682">Mozilla Bug 1018682</a>
12 <script type="application/javascript">
14 var base = new URL("data:text/plain,");
16 let relative;
17 try {
18 relative = new URL("a", base);
19 ok(false, "Relative URL from a data:text/plain should not work.");
20 } catch (e) {
21 ok(true, "Relative URL from a data:text/plain should not work.");
24 base.protocol = "chrome:";
25 is(base.protocol, "chrome:", "The protocol should be changed from data to chrome.");
27 try {
28 relative = new URL("a", base);
29 ok(true, "Relative URL from a chrome: should work.");
30 } catch (e) {
31 ok(false, "Relative URL from a chrome: should work.");
34 base.protocol = "http:";
35 ok(true, "Protocol: http not changed (special scheme)");
36 is(base.href, "chrome://text/plain,", "Base URL is correct");
38 relative = new URL("a", base);
39 ok(relative, "This works.");
40 is(relative.href, "chrome://text/a", "Relative URL is correct");
42 </script>
44 </body>
45 </html>