Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 importScripts('../../../resources/js-test.js'); | 1 importScripts('../../../resources/js-test.js'); |
| 2 | 2 |
| 3 self.jsTestIsAsync = true; | 3 self.jsTestIsAsync = true; |
| 4 | 4 |
| 5 description('Test createImageBitmap with data in workers.'); | 5 description('Test createImageBitmap with data in workers.'); |
| 6 | 6 |
| 7 var bitmapWidth; | |
| 8 var bitmapHeight; | |
| 9 | |
| 7 self.addEventListener('message', function(e) { | 10 self.addEventListener('message', function(e) { |
| 8 createImageBitmap(e.data).then(function() { | 11 createImageBitmap(e.data).then(function(imageBitmap) { |
| 9 testPassed('Promise fulfilled.'); | 12 testPassed('Promise fulfilled.'); |
| 13 bitmapWidth = imageBitmap.width; | |
| 14 bitmapHeight = imageBitmap.height; | |
| 15 shouldBe("bitmapWidth", "50"); | |
| 16 shouldBe("bitmapHeight", "50"); | |
|
xidachen
2015/12/01 02:19:05
This will test that getting the width/height of Im
| |
| 10 finishJSTest(); | 17 finishJSTest(); |
| 11 }, function() { | 18 }, function() { |
| 12 testFailed('Promise rejected.'); | 19 testFailed('Promise rejected.'); |
| 13 finishJSTest(); | 20 finishJSTest(); |
| 14 }); | 21 }); |
| 15 }); | 22 }); |
| OLD | NEW |