| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 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 <iframe></iframe> |
| 6 <script> | 7 <script> |
| 7 | 8 |
| 8 if (location.href.endsWith('#after-reload')) { | 9 var iframe = document.querySelector('iframe'); |
| 9 test(function() { | |
| 10 assert_equals(navigator.presentation.defaultRequest, null); | |
| 11 }, "Test that navigator.defaultRequest isn't kept alive after reload.") | |
| 12 } else { | |
| 13 navigator.presentation.defaultRequest = new PresentationRequest("https://examp
le.org"); | |
| 14 | 10 |
| 15 location.href += '#after-reload'; | 11 async_test(t => { |
| 16 location.reload(); | 12 iframe.onload = t.step_func(() => { |
| 17 } | 13 var presentation = iframe.contentWindow.navigator.presentation; |
| 14 if (iframe.src.endsWith('#after-reload')) { |
| 15 assert_equals(presentation.defaultRequest, null); |
| 16 t.done(); |
| 17 } else { |
| 18 presentation.defaultRequest = new PresentationRequest("https://example.org
"); |
| 19 assert_not_equals(presentation.defaultRequest, null); |
| 20 |
| 21 iframe.src += '#after-reload'; |
| 22 iframe.contentWindow.location.reload(true); |
| 23 } |
| 24 }); |
| 25 |
| 26 // Navigate the iframe |
| 27 iframe.src = 'resources/blank.html'; |
| 28 }, "Test that navigator.defaultRequest isn't kept alive after reload."); |
| 18 | 29 |
| 19 </script> | 30 </script> |
| 20 </body> | 31 </body> |
| 21 </html> | 32 </html> |
| OLD | NEW |