| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <script> | 4 <script> |
| 5 var test_cases = [ | 5 var test_cases = [ |
| 6 { | 6 { |
| 7 name: 'cancel', | 7 name: 'cancel', |
| 8 cancel: true, | 8 cancel: true, |
| 9 }, { | 9 }, { |
| 10 name: 'accept', | 10 name: 'accept', |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 e.userChoice.then(t.step_func(function(result) { | 41 e.userChoice.then(t.step_func(function(result) { |
| 42 assert_equals(result.platform, test_case.platform, 'Resolved pla
tform'); | 42 assert_equals(result.platform, test_case.platform, 'Resolved pla
tform'); |
| 43 assert_equals(result.outcome, test_case.outcome, 'Outcome'); | 43 assert_equals(result.outcome, test_case.outcome, 'Outcome'); |
| 44 banner_test(index + 1); | 44 banner_test(index + 1); |
| 45 t.done(); | 45 t.done(); |
| 46 })); | 46 })); |
| 47 }); | 47 }); |
| 48 window.addEventListener('beforeinstallprompt', event_handler); | 48 window.addEventListener('beforeinstallprompt', event_handler); |
| 49 | 49 |
| 50 testRunner.dispatchBeforeInstallPromptEvent(index, ['foo', 'bar'], t.ste
p_func(function(result) { | 50 testRunner.dispatchBeforeInstallPromptEvent(['foo', 'bar'], t.step_func(
function(result) { |
| 51 assert_equals(result, test_case.cancel, 'Event canceled'); | 51 assert_equals(result, test_case.cancel, 'Event canceled'); |
| 52 if (test_case.cancel) { | 52 if (test_case.cancel) { |
| 53 banner_test(index + 1); | 53 banner_test(index + 1); |
| 54 t.done(); | 54 t.done(); |
| 55 return; | 55 return; |
| 56 } | 56 } |
| 57 testRunner.resolveBeforeInstallPromptPromise(index, test_case.platfo
rm); | 57 testRunner.resolveBeforeInstallPromptPromise(test_case.platform); |
| 58 })); | 58 })); |
| 59 }, test_case.name); | 59 }, test_case.name); |
| 60 } | 60 } |
| 61 | 61 |
| 62 banner_test(0); | 62 banner_test(0); |
| 63 </script> | 63 </script> |
| OLD | NEW |