1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/general/test_bug628069_1.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=628069 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 628069</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 +</head> 1.15 +<body> 1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=628069">Mozilla Bug 628069</a> 1.17 +<p id="display"></p> 1.18 +<div id="content"> 1.19 + <iframe id="frame" style="height:100px; width:100px; border:0"></iframe> 1.20 + <div id="status" style="display: none"></div> 1.21 +</div> 1.22 +<pre id="test"> 1.23 +<script type="application/javascript;version=1.7"> 1.24 + 1.25 +/** Test for Bug 628069 **/ 1.26 + 1.27 +SimpleTest.waitForExplicitFinish(); 1.28 + 1.29 +popup = window.open('file_bug628069.html'); 1.30 + 1.31 +// Control flows into childLoad, once the popup loads. 1.32 + 1.33 +gOrigURL = null; 1.34 +function childLoad() { 1.35 + gOrigURL = popup.location + ''; 1.36 + 1.37 + popup.location.hash = '#hash'; 1.38 + 1.39 + // This should trigger a hashchange, so control should flow down to 1.40 + // childHashchange. 1.41 +} 1.42 + 1.43 +function childHashchange(e) { 1.44 + is(e.oldURL, gOrigURL, 'event.oldURL'); 1.45 + is(e.newURL, gOrigURL + '#hash', 'event.newURL'); 1.46 + is(e.isTrusted, true, 'Hashchange event should be trusted.'); 1.47 + popup.close(); 1.48 + SimpleTest.finish(); 1.49 +} 1.50 + 1.51 +</script> 1.52 +</body> 1.53 +</html>