netwerk/test/mochitests/test_uri_scheme.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/test/mochitests/test_uri_scheme.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +-->
     1.8 +<head>
     1.9 +  <title>Test for URI Manipulation</title>
    1.10 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.11 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.12 +
    1.13 +<script type="text/javascript">
    1.14 +function dotest1()
    1.15 +{
    1.16 +  SimpleTest.waitForExplicitFinish();
    1.17 +  var o = new URL("http://localhost/");
    1.18 +  try { o.href = "foopy:bar:baz"; } catch(e) { }
    1.19 +  o.protocol = "http:";
    1.20 +  o.hostname;
    1.21 +  try { o.href = "http://localhost/"; } catch(e) { }
    1.22 +  ok(o.protocol, "http:");
    1.23 +  dotest2();
    1.24 +}
    1.25 +
    1.26 +function dotest2()
    1.27 +{
    1.28 +  var o = new URL("http://www.mozilla.org/");
    1.29 +  try {
    1.30 +      o.href ="aaaaaaaaaaa:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    1.31 +  } catch(e) { }
    1.32 +  o.hash = "#";
    1.33 +  o.pathname = "/";
    1.34 +  o.protocol = "http:";
    1.35 +  try { o.href = "http://localhost/"; } catch(e) { }
    1.36 +  ok(o.protocol, "http:");
    1.37 +  SimpleTest.finish();
    1.38 +}
    1.39 +</script>
    1.40 +</head>
    1.41 +<body onload="dotest1();">
    1.42 +<p id="display"></p>
    1.43 +<div id="content" style="display: none"></div>
    1.44 +<pre id="test">
    1.45 +</pre>
    1.46 +</body>
    1.47 +</html>
    1.48 +

mercurial