OLD | NEW |
(Empty) | |
| 1 <script src="../../resources/testharness.js"></script> |
| 2 <script src="test-helpers.js?pipe=sub"></script> |
| 3 <body> |
| 4 <script> |
| 5 var host_info = get_host_info(); |
| 6 |
| 7 function load_image(url, cross_origin) { |
| 8 return new Promise(function(resolve) { |
| 9 var img = new Image(); |
| 10 if (cross_origin != '') { |
| 11 img.crossOrigin = cross_origin; |
| 12 } |
| 13 img.onerror = resolve; |
| 14 img.src = url; |
| 15 }); |
| 16 } |
| 17 |
| 18 window.addEventListener('message', function(evt) { |
| 19 var port = evt.ports[0]; |
| 20 Promise.all([load_image('dummy?test1', ''), |
| 21 load_image('dummy?test2', 'anonymous'), |
| 22 load_image('dummy?test3', 'use-credentials')]) |
| 23 .then(function() { port.postMessage({results: 'finish'}); }) |
| 24 .catch(function(e) { port.postMessage({results: 'failure:' + e}); }); |
| 25 }); |
| 26 </script> |
| 27 </body> |
OLD | NEW |