| OLD | NEW |
| 1 <script src="../resources/get-host-info.sub.js"></script> | 1 <script src="/common/get-host-info.sub.js"></script> |
| 2 <script src="test-helpers.sub.js?pipe=sub"></script> | 2 <script src="test-helpers.sub.js?pipe=sub"></script> |
| 3 <script> | 3 <script> |
| 4 var host_info = get_host_info(); | 4 var host_info = get_host_info(); |
| 5 var uri = document.location + '?check-ua-header'; | 5 var uri = document.location + '?check-ua-header'; |
| 6 | 6 |
| 7 var headers = new Headers(); | 7 var headers = new Headers(); |
| 8 headers.set('User-Agent', 'custom_ua'); | 8 headers.set('User-Agent', 'custom_ua'); |
| 9 | 9 |
| 10 // Check the custom UA case | 10 // Check the custom UA case |
| 11 fetch(uri, { headers: headers }).then(function(response) { | 11 fetch(uri, { headers: headers }).then(function(response) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 }).then(function(text) { | 57 }).then(function(text) { |
| 58 if (text === '*/*') { | 58 if (text === '*/*') { |
| 59 parent.postMessage('PASS', '*'); | 59 parent.postMessage('PASS', '*'); |
| 60 } else { | 60 } else { |
| 61 parent.postMessage('accept FAIL - expected */* got "' + text + '"', '*'); | 61 parent.postMessage('accept FAIL - expected */* got "' + text + '"', '*'); |
| 62 } | 62 } |
| 63 }).catch(function(err) { | 63 }).catch(function(err) { |
| 64 parent.postMessage('accept FAIL - unexpected error: ' + err, '*'); | 64 parent.postMessage('accept FAIL - unexpected error: ' + err, '*'); |
| 65 }); | 65 }); |
| 66 </script> | 66 </script> |
| OLD | NEW |