| 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 // TODO(crbug.com/680298): use iframe to do presentation navigation layout tests | 9 var iframe = document.querySelector('iframe'); |
| 9 if (location.href.endsWith('#after-reload')) { | |
| 10 test(function() { | |
| 11 assert_equals(navigator.presentation.defaultRequest, null); | |
| 12 }, "Test that navigator.defaultRequest with multiple URLs isn't kept alive aft
er reload.") | |
| 13 } else { | |
| 14 navigator.presentation.defaultRequest = new PresentationRequest(["https://exam
ple.org", "cast://google.com/app_id=deadbeef"]); | |
| 15 | 10 |
| 16 location.href += '#after-reload'; | 11 async_test(t => { |
| 17 location.reload(); | 12 t.step(function() { |
| 18 } | 13 iframe.onload = () => { |
| 14 var defaultRequest = iframe.contentWindow.navigator.presentation.defaultRe
quest; |
| 15 if (iframe.src.endsWith('#after-reload')) { |
| 16 assert_equals(defaultRequest, null); |
| 17 t.done(); |
| 18 } else { |
| 19 defaultRequest = new PresentationRequest(["https://example.org", "cast:/
/google.com/app_id=deadbeef"]); |
| 20 assert_not_equals(defaultRequest, null); |
| 21 |
| 22 iframe.src += '#after-reload'; |
| 23 iframe.contentWindow.location.reload(true); |
| 24 } |
| 25 }; |
| 26 |
| 27 // Navigate the iframe |
| 28 iframe.src = 'resources/blank.html'; |
| 29 }); |
| 30 }, "Test that navigator.defaultRequest with multiple URLs isn't kept alive after
reload."); |
| 19 | 31 |
| 20 </script> | 32 </script> |
| 21 </body> | 33 </body> |
| 22 </html> | 34 </html> |
| OLD | NEW |