| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>subscribe fails in service worker because the manifest cannot be read</ti
tle> | 4 <title>subscribe fails in service worker because the manifest cannot be read</ti
tle> |
| 5 <link rel="manifest" href="resources/push_manifest.json"> | 5 <link rel="manifest" href="resources/push_manifest.json"> |
| 6 <script src="../resources/testharness.js"></script> | 6 <script src="../resources/testharness.js"></script> |
| 7 <script src="../resources/testharnessreport.js"></script> | 7 <script src="../resources/testharnessreport.js"></script> |
| 8 <script src="../serviceworker/resources/test-helpers.js"></script> | 8 <script src="../serviceworker/resources/test-helpers.js"></script> |
| 9 <script src="../notifications/resources/test-helpers.js"></script> | 9 <script src="../notifications/resources/test-helpers.js"></script> |
| 10 </head> | 10 </head> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // id has been specified in the manifest, the manifest cannot be rea
d in a service | 24 // id has been specified in the manifest, the manifest cannot be rea
d in a service |
| 25 // worker context, and no previous subscription will exist from a do
cument context. | 25 // worker context, and no previous subscription will exist from a do
cument context. |
| 26 workerInfo.port.postMessage({command: 'subscribe'}); | 26 workerInfo.port.postMessage({command: 'subscribe'}); |
| 27 | 27 |
| 28 workerInfo.port.addEventListener('message', function(event) { | 28 workerInfo.port.addEventListener('message', function(event) { |
| 29 if (typeof event.data != 'object' || !event.data.command) | 29 if (typeof event.data != 'object' || !event.data.command) |
| 30 assert_unreached('Invalid message from the service worker'); | 30 assert_unreached('Invalid message from the service worker'); |
| 31 | 31 |
| 32 assert_equals(event.data.command, 'subscribe'); | 32 assert_equals(event.data.command, 'subscribe'); |
| 33 assert_false(event.data.success, 'subscribe is not expected to s
ucceed.'); | 33 assert_false(event.data.success, 'subscribe is not expected to s
ucceed.'); |
| 34 assert_regexp_match(event.data.errorMessage, | 34 assert_regexp_match( |
| 35 /gcm_sender_id not found in manifest/); | 35 event.data.errorMessage, |
| 36 /missing applicationServerKey, and gcm_sender_id not found i
n manifest/); |
| 36 | 37 |
| 37 test.done(); | 38 test.done(); |
| 38 }); | 39 }); |
| 39 }) | 40 }) |
| 40 .catch(unreached_rejection(test)); | 41 .catch(unreached_rejection(test)); |
| 41 }, 'subscribe fails in service worker because the manifest cannot be read'); | 42 }, 'subscribe fails in service worker because the manifest cannot be read'); |
| 42 </script> | 43 </script> |
| 43 </body> | 44 </body> |
| 44 </html> | 45 </html> |
| OLD | NEW |