OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: Registration</title> | 2 <title>Service Worker: Registration</title> |
3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src="resources/test-helpers.js"></script> | 5 <script src="resources/test-helpers.js"></script> |
6 <script> | 6 <script> |
7 (function() { | 7 (function() { |
8 var t = async_test('Registering normal pattern'); | 8 var t = async_test('Registering normal pattern'); |
9 t.step(function() { | 9 t.step(function() { |
10 var scope = '/registration/'; | 10 var scope = '/registration/'; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 }), | 72 }), |
73 t.step_func(function(reason) { | 73 t.step_func(function(reason) { |
74 assert_equals(reason.name, 'AbortError', | 74 assert_equals(reason.name, 'AbortError', |
75 'Registration of non-existent script should fail.')
; | 75 'Registration of non-existent script should fail.')
; |
76 t.done(); | 76 t.done(); |
77 }) | 77 }) |
78 ); | 78 ); |
79 }); | 79 }); |
80 }()); | 80 }()); |
81 | 81 |
| 82 (function() { |
| 83 var t = async_test('Registering script without correct MIME type'); |
| 84 t.step(function() { |
| 85 navigator.serviceWorker.register( |
| 86 'resources/plain-text-worker.php' |
| 87 ).then( |
| 88 t.step_func(function(registration) { |
| 89 assert_unreached('Registration of plain text script should fail.
'); |
| 90 }), |
| 91 t.step_func(function(reason) { |
| 92 assert_equals(reason.name, 'AbortError', |
| 93 'Registration of plain text script should fail.'); |
| 94 t.done(); |
| 95 }) |
| 96 ); |
| 97 }); |
| 98 }()); |
| 99 |
82 </script> | 100 </script> |
OLD | NEW |