OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <base href="https://www.test.com/"> | 3 <base href="https://www.test.com/"> |
4 <script> | 4 <script> |
5 if (window.layoutTestController) | 5 if (window.layoutTestController) |
6 layoutTestController.dumpAsText(); | 6 layoutTestController.dumpAsText(); |
7 | 7 |
8 window.onload = function(){ | 8 window.onload = function(){ |
9 var msg; | 9 var msg; |
10 try { | 10 try { |
11 window.history.replaceState({}, {}, 'https://www.test.com/'); | 11 window.history.replaceState({}, {}, 'https://www.test.com/'); |
12 msg = document.createTextNode("FAIL: URL bar was changed."); | 12 msg = document.createTextNode("FAIL: URL bar was changed."); |
13 } catch (e) { | 13 } catch (e) { |
14 if (e.code == 18) | 14 if (e.code == 18) |
15 msg = document.createTextNode("PASS: Security exception thrown."); | 15 msg = document.createTextNode("PASS: Security exception thrown."); |
16 else | 16 else |
17 msg = document.createTextNode("FAIL: Unknown exception thrown."); | 17 msg = document.createTextNode("FAIL: Unknown exception thrown."); |
18 } | 18 } |
19 document.body.appendChild(msg); | 19 document.body.appendChild(msg); |
20 }; | 20 }; |
21 </script> | 21 </script> |
22 </head> | 22 </head> |
23 <body> | 23 <body> |
24 <p>This page should trigger an error on attempting to set the URL bar to https:/
/www.test.com/</p> | 24 <p>This page should trigger an error on attempting to set the URL bar to https:/
/www.test.com/</p> |
25 </body> | 25 </body> |
26 </html> | 26 </html> |
OLD | NEW |