4 https://bugzilla.mozilla.org/show_bug.cgi?id=640387
7 <title>Test for Bug
640387</title>
8 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script type=
"application/javascript" src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=640387">Mozilla Bug
640387</a>
15 <!-- Test that, when going from
17 http://example.com/#foo
23 via a non-history load, we do a true load, rather than a scroll. -->
25 <script type='application/javascript;version=
1.7'
>
26 SimpleTest.waitForExplicitFinish();
28 callbackOnLoad = false;
29 function childLoad() {
31 callbackOnLoad = false;
36 errorOnHashchange = false;
37 callbackOnHashchange = false;
38 function childHashchange() {
39 if (errorOnHashchange) {
40 ok(false, 'Got unexpected hashchange.');
42 if (callbackOnHashchange) {
43 callbackOnHashchange = false;
49 var iframe = $('iframe').contentWindow;
51 ok(true, 'Got first load');
53 // Spin the event loop so we exit the onload handler.
54 SimpleTest.executeSoon(function() { gGen.next() });
57 let origLocation = iframe.location + '';
58 callbackOnHashchange = true;
59 iframe.location.hash = '#
1';
60 // Wait for a hashchange event.
63 ok(true, 'Got hashchange.');
65 iframe.location = origLocation;
66 // This should produce a load event and *not* a hashchange, because the
67 // result of the load is a different document than we had previously.
68 callbackOnLoad = true;
69 errorOnHashchange = true;
72 ok(true, 'Got final load.');
74 // Spin the event loop to give hashchange a chance to fire, if it's going to.
75 SimpleTest.executeSoon(function() { gGen.next() });
82 callbackOnLoad = true;
87 <iframe id='iframe' src='file_bug640387.html'
></iframe>