|
129 | 129 | iframe.contentWindow.history.pushState('','','#test3'); |
130 | 130 | assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test3' ); |
131 | 131 | }, 'pushState must be able to set location.hash'); |
132 | | - //begin setup for "remove any tasks queued by the history traversal task source" |
133 | 132 | iframe.contentWindow.location.hash = '#test4'; |
134 | | - iframe.contentWindow.history.go(-1); //must be queued |
| 133 | + iframe.contentWindow.history.go(-1); |
135 | 134 | try { |
136 | | - //must remove the queued navigation in the same browsing context |
| 135 | + // Queued a go to test3, the pushState is inserted after test3 |
137 | 136 | iframe.contentWindow.history.pushState('',''); |
138 | 137 | } catch(unsuperr) {} |
139 | | - //allow the browser to mistakenly run the .go if it is going to |
140 | | - //do not put two .go commands in the same thread, in case the browser mistakenly calculates the history position when |
141 | | - //calling .go instead of when executing the traversal task - that could give a false PASS in the next test otherwise |
142 | 138 | setTimeout(tests7,50); |
143 | 139 | } |
144 | 140 | function tests7() { |
145 | | - iframe.contentWindow.history.go(-1); //must be queued, but should not be removed this time |
| 141 | + // Standing at test3, go(-1) should take us to 'test' |
| 142 | + iframe.contentWindow.history.go(-1); |
146 | 143 | iframe.contentWindow.addEventListener("popstate", tests8, {once: true}); |
147 | 144 | } |
148 | 145 | function tests8() { |
149 | 146 | test(function () { |
150 | | - assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test4' ); |
151 | | - }, 'pushState must remove any tasks queued by the history traversal task source'); |
| 147 | + assert_equals( iframe.contentWindow.location.hash.replace(/^#/,''), 'test' ); |
| 148 | + }, 'pushState must not remove tasks queued by the history traversal task source'); |
152 | 149 | //end "remove any tasks queued by the history traversal task source" |
153 | 150 | window.addEventListener('hashchange',function () { hashchng = true; },false); |
154 | 151 | try { |
|