| OLD | NEW |
| 1 importScripts('../../resources/get-request-header.js'); | 1 importScripts('../../resources/get-request-header.js'); |
| 2 | 2 |
| 3 if (self.postMessage) | 3 if (self.postMessage) |
| 4 runTests(); | 4 runTests(); |
| 5 else | 5 else |
| 6 onconnect = handleConnect; | 6 onconnect = handleConnect; |
| 7 | 7 |
| 8 function handleConnect(event) | 8 function handleConnect(event) |
| 9 { | 9 { |
| 10 self.postMessage = function (message) { | 10 self.postMessage = function (message) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 function echoCookie() { | 41 function echoCookie() { |
| 42 return connectAndGetRequestHeader('cookie'); | 42 return connectAndGetRequestHeader('cookie'); |
| 43 } | 43 } |
| 44 | 44 |
| 45 function runTests() | 45 function runTests() |
| 46 { | 46 { |
| 47 setCookie() | 47 setCookie() |
| 48 .then(echoCookie) | 48 .then(echoCookie) |
| 49 .then( | 49 .then( |
| 50 function (cookie) { | 50 function (cookie) { |
| 51 if (cookie != 'ws-domain-local-ip=1; ws-path-root=1; ws=1') | 51 if (cookie != 'ws-domain-local-ip=1; ws-path-root=1; ws=1; same-site
-strict=1; same-site-lax=1') |
| 52 return Promise.reject('Echoed cookie is incorrect'); | 52 return Promise.reject('Echoed cookie is incorrect: ' + cookie); |
| 53 | 53 |
| 54 postMessage("DONE"); | 54 postMessage("DONE"); |
| 55 } | 55 } |
| 56 ).catch( | 56 ).catch( |
| 57 function (reason) { | 57 function (reason) { |
| 58 postMessage('FAIL: ' + reason); | 58 postMessage('FAIL: ' + reason); |
| 59 } | 59 } |
| 60 ); | 60 ); |
| 61 } | 61 } |
| OLD | NEW |