OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bu
gs/Public/show_bug.cgi?id=17155 is fixed --> | 2 <!-- this tests the spec as it hopefully will be once bug https://www.w3.org/Bug
s/Public/show_bug.cgi?id=17155 is fixed --> |
3 <title>Fragment Navigation: hashchange event</title> | 3 <title>Fragment Navigation: hashchange event</title> |
4 <script src="/resources/testharness.js"></script> | 4 <script src="/resources/testharness.js"></script> |
5 <script src="/resources/testharnessreport.js"></script> | 5 <script src="/resources/testharnessreport.js"></script> |
6 <body> | 6 <body> |
7 <div id="log"></div> | 7 <div id="log"></div> |
8 <script> | 8 <script> |
9 var t = async_test(); | 9 var t = async_test(); |
10 t.step(function() { | 10 t.step(function() { |
11 var original_url = location.href; | 11 var original_url = location.href; |
12 assert_equals(location.hash, "", "Page must be loaded with no hash"); | 12 assert_equals(location.hash, "", "Page must be loaded with no hash"); |
13 location.hash = "test"; | 13 location.hash = "test"; |
14 | 14 |
15 addEventListener("hashchange", | 15 addEventListener("hashchange", |
16 t.step_func(function(e) { | 16 t.step_func(function(e) { |
17 assert_equals(e.oldURL, original_url, "oldURL property"); | 17 assert_equals(e.oldURL, original_url, "oldURL property"); |
18 assert_equals(e.newURL, location.href, "newURL property"); | 18 assert_equals(e.newURL, location.href, "newURL property"); |
19 location.hash = ""; | 19 location.hash = ""; |
20 t.done(); | 20 t.done(); |
21 }), true); | 21 }), true); |
22 }); | 22 }); |
23 </script> | 23 </script> |
OLD | NEW |