| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <body> |
| 5 <script> |
| 6 |
| 7 // The test involves navigating so we use a iframe for the navigation to |
| 8 // simplify testharness usage in the main page. |
| 9 function conduct_test(frame) { |
| 10 return new Promise(function(resolve, reject) { |
| 11 var IFRAME_SRC = "resources/navigate-during-commit-iframe.html" |
| 12 var onload_count = 0; |
| 13 var frame = document.createElement('iframe'); |
| 14 frame.onload = function () { |
| 15 if (++onload_count == 2) { |
| 16 var success = window[0].location == "about:blank"; |
| 17 document.body.removeChild(frame); |
| 18 if (success) |
| 19 resolve(); |
| 20 else |
| 21 reject(); |
| 22 } |
| 23 }; |
| 24 frame.src = IFRAME_SRC; |
| 25 document.body.appendChild(frame); |
| 26 }); |
| 27 } |
| 28 |
| 29 async_test(function(t) { |
| 30 var step = t.step_func.bind(t); |
| 31 conduct_test() |
| 32 .then(step(function() { t.done(); }), |
| 33 step(function() { assert_true(false, "promised rejected"); })) |
| 34 .catch(step(function() { assert_true(false, "caught exception"); })); |
| 35 }, 'navigate-during-commit'); |
| 36 |
| 37 </script> |
| 38 </body> |
| OLD | NEW |