Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../../../websocket/resources/get-request-header.js"></script> | |
| 3 <script src="../../../../websocket/resources/cookie-test-util.js"></script> | |
|
Mike West
2016/06/28 11:25:37
Nit: Ditto with the `..` bits.
tyoshino (SeeGerritForStatus)
2016/06/30 08:24:13
Done.
| |
| 4 <script> | |
| 5 function notifySuccess(value) { | |
| 6 window.parent.postMessage('DONE', '*'); | |
| 7 } | |
| 8 | |
| 9 function notifyFailure(reason) { | |
| 10 window.parent.postMessage('FAIL: ' + reason, '*'); | |
| 11 } | |
| 12 | |
| 13 setCookie(CROSS_ORIGIN_WS_SERVER).then( | |
| 14 () => connectAndGetRequestHeadersFrom(CROSS_ORIGIN_WS_SERVER), | |
| 15 notifyFailure | |
| 16 ).then( | |
| 17 headers => { | |
| 18 const cookie = headers['cookie']; | |
| 19 return clear(CROSS_ORIGIN_WS_SERVER).then(() => { | |
| 20 if (cookie === undefined) { | |
| 21 notifySuccess(); | |
| 22 } else { | |
| 23 notifyFailure('cookie was not undefined: ' + cookie); | |
| 24 } | |
| 25 }); | |
| 26 } | |
| 27 ).catch( | |
| 28 notifyFailure | |
| 29 ); | |
| 30 </script> | |
| OLD | NEW |