dom/tests/mochitest/bugs/test_bug132255.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/bugs/test_bug132255.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=132255
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 132255</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.13 +  <base href="http://mochi.test:8888/tests/dom/tests/mochitest/">
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=132255">Mozilla Bug 132255</a>
    1.17 +<p id="display">
    1.18 +  <iframe src="javascript:'<a href=\'foo.html\'>test-anchor</a>'"></iframe>
    1.19 +  <iframe src="javascript:'<base href=\'http://example.com/\'><a href=\'foo.html\'>test-anchor</a>'"></iframe>
    1.20 +</p>
    1.21 +<div id="content" style="display: none">
    1.22 +  
    1.23 +</div>
    1.24 +<pre id="test">
    1.25 +<script type="application/javascript">
    1.26 +
    1.27 +/** Test for Bug 132255 **/
    1.28 +SimpleTest.waitForExplicitFinish();
    1.29 +addLoadEvent(function() {
    1.30 +  is(window.frames[0].document.links[0].href,
    1.31 +     window.location.href.replace(/bugs\/test_bug132255\.html/, "foo.html"),
    1.32 +     "Unexpected anchor href");
    1.33 +  is(window.frames[1].document.links[0].href,
    1.34 +     "http://example.com/foo.html",
    1.35 +     "Unexpected anchor href when base set");
    1.36 +})
    1.37 +addLoadEvent(SimpleTest.finish);
    1.38 +</script>
    1.39 +</pre>
    1.40 +</body>
    1.41 +</html>

mercurial