| <script src="../../resources/js-test-pre.js"></script> |
| <div id="description"></div> |
| description('Tests that hashchange events have the expected newURL and oldURL properties.'); |
| var hashIndex = url.lastIndexOf('#'); |
| return hashIndex != -1 ? url.substring(hashIndex) : '[none]'; |
| setTimeout(function() {location.href = '#state1';}, 0); |
| onhashchange = function(event) |
| debug('hashchange fired with oldURL hash "' + hashOf(event.oldURL) + '" and newURL hash "' + hashOf(event.newURL) + '"'); |
| switch (hashOf(event.newURL)) { |
| location.href = '#state2'; |
| testFailed('should always be going forward at #state2'); |
| var jsTestIsAsync = true; |
| <script src="../../resources/js-test-post.js"></script> |