Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 oninstall = function(e) { | |
| 2 e.waitUntil(new Promise(function(r) { setTimeout(r, 5); })); | |
|
jsbell
2014/04/16 17:43:38
I'm not happy with using setTimeout in this test.
kinuko
2014/04/17 11:32:54
I wanted to make this test dead simple / 'minimal'
| |
| 3 }; | |
| 4 | |
| 5 onactivate = function(e) { | |
| 6 e.waitUntil(new Promise(function(r) { setTimeout(r, 5); })); | |
| 7 }; | |
| 8 | |
| 9 onmessage = function(e) { | |
| 10 var message = e.data; | |
| 11 if (typeof message === 'object' && 'port' in message) { | |
|
jsbell
2014/04/16 17:43:38
FWIW, `typeof null === 'object'`; the `Object(x) =
kinuko
2014/04/17 11:32:54
Yup, sgtm, please feel free to fix it.
| |
| 12 var response = 'Ack for: ' + message.from; | |
| 13 try { | |
| 14 message.port.postMessage(response); | |
| 15 } catch (_) {} | |
| 16 } | |
| 17 }; | |
| OLD | NEW |