OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../js/resources/js-test-pre.js"></script> | 2 <script src="../../js/resources/js-test-pre.js"></script> |
3 <base> | 3 <base> |
4 <a></a> | 4 <a></a> |
5 <script> | 5 <script> |
6 | 6 |
7 description('Tests how setting href attributes affects setting a new base for th
e URL.'); | 7 description('Tests how setting href attributes affects setting a new base for th
e URL.'); |
8 | 8 |
9 var base = document.querySelector('base'); | 9 var base = document.querySelector('base'); |
10 var a = document.querySelector('a'); | 10 var a = document.querySelector('a'); |
11 | 11 |
12 base.href = 'http://old_base/'; | 12 base.href = 'http://old_base/'; |
13 a.href = 'foo?query'; | 13 a.href = 'foo?query'; |
14 shouldBeEqualToString('a.href', 'http://old_base/foo?query'); | 14 shouldBeEqualToString('a.href', 'http://old_base/foo?query'); |
15 base.href = 'http://new_base/'; | 15 base.href = 'http://new_base/'; |
16 shouldBeEqualToString("document.querySelector('a').href", 'http://new_base/foo?q
uery'); | 16 shouldBeEqualToString("document.querySelector('a').href", 'http://new_base/foo?q
uery'); |
17 | 17 |
18 // Remove @href to allow js-test-post to load. | 18 // Remove @href to allow js-test-post to load. |
19 base.href = null; | 19 base.href = null; |
20 | 20 |
21 </script> | 21 </script> |
22 <script src="../../js/resources/js-test-post.js"></script> | |
OLD | NEW |