| 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 | 5 |
| 6 test(function() { | 6 test(function() { |
| 7 assert_false(new BeforeInstallPromptEvent('eventType').bubbles, 'bubbles'); | 7 assert_false(new BeforeInstallPromptEvent('eventType').bubbles, 'bubbles'); |
| 8 assert_true(new BeforeInstallPromptEvent('eventType').cancelable, 'cancelabl
e'); | 8 assert_false(new BeforeInstallPromptEvent('eventType').cancelable, 'cancelab
le'); |
| 9 }, 'No initializer passed'); | 9 }, 'No initializer passed'); |
| 10 | 10 |
| 11 test(function() { | 11 test(function() { |
| 12 assert_true(new BeforeInstallPromptEvent('eventType', { bubbles: true } ).bu
bbles, 'bubbles'); |
| 13 assert_true(new BeforeInstallPromptEvent('eventType', { cancelable: true } )
.cancelable, 'cancelable'); |
| 14 }, 'Initializer values not respected'); |
| 15 |
| 16 test(function() { |
| 12 var event = new BeforeInstallPromptEvent('eventType', { platforms: ['a'] }); | 17 var event = new BeforeInstallPromptEvent('eventType', { platforms: ['a'] }); |
| 13 assert_array_equals(['a'], event.platforms, 'platforms'); | 18 assert_array_equals(['a'], event.platforms, 'platforms'); |
| 14 }, 'platforms is passed'); | 19 }, 'platforms is passed'); |
| 15 | 20 |
| 16 test(function() { | 21 test(function() { |
| 17 var event = new BeforeInstallPromptEvent('eventType', { platforms: ['a'] }); | 22 var event = new BeforeInstallPromptEvent('eventType', { platforms: ['a'] }); |
| 18 event.preventDefault(); | 23 event.preventDefault(); |
| 19 }, 'preventDefault called'); | 24 }, 'preventDefault called'); |
| 20 | 25 |
| 21 async_test(function(t) { | 26 async_test(function(t) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 .then(t.unreached_func('userChoice should not resolve'), function(){ | 46 .then(t.unreached_func('userChoice should not resolve'), function(){ |
| 42 rejected = true; | 47 rejected = true; |
| 43 }) | 48 }) |
| 44 .catch(function(reason) { thrown = true; }); | 49 .catch(function(reason) { thrown = true; }); |
| 45 t.done(); | 50 t.done(); |
| 46 | 51 |
| 47 assert_true(rejected); | 52 assert_true(rejected); |
| 48 assert_true(thrown); | 53 assert_true(thrown); |
| 49 }, 'userChoice accessed, throws and rejects'); | 54 }, 'userChoice accessed, throws and rejects'); |
| 50 </script> | 55 </script> |
| OLD | NEW |